Codota Logo
QueryException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.mulgara.query.QueryException
constructor

Best Java code snippets using org.mulgara.query.QueryException.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.openrdf.mulgara/mulgara-query

public int compare(Object left, Object right) throws QueryException {
 if (!(right instanceof Boolean)) throw new QueryException("Type Error: Cannot compare a boolean to a: " + right.getClass());
 return ((Boolean)left).compareTo((Boolean)right);
}
public ValueLiteral newLiteral(Object data) { return new Bool((Boolean)data); }
origin: org.openrdf.mulgara/mulgara-query

public int compare(Object left, Object right) throws QueryException {
 if (!(right instanceof Number)) throw new QueryException("Type Error: Cannot compare a double to a: " + right.getClass());
 return ((Double)left).compareTo(((Number)right).doubleValue());
}
public ValueLiteral newLiteral(Object data) { return new NumericLiteral((Double)data); }
origin: org.openrdf.mulgara/mulgara-query

public int compare(Object left, Object right) throws QueryException {
 Float fleft = (Float)left;
 if (!(right instanceof Number)) throw new QueryException("Type Error: Cannot compare a float to a: " + right.getClass());
 // if right has more precision, then promote lfloat, and compare the other way around
 if (right instanceof Double) return -((Double)right).compareTo(fleft.doubleValue());
 return fleft.compareTo(((Number)right).floatValue());
}
public ValueLiteral newLiteral(Object data) { return new NumericLiteral((Float)data); }
origin: org.openrdf.mulgara/mulgara-resolver-core

private void assertExternallyManagedXA() throws QueryException {
 if (transactionFactory == null) {
  transactionFactory = externalFactory = transactionManager.getExternalFactory();
 } else if (externalFactory == null) {
  throw new QueryException("Attempt to use external transaction control in internally managed session");
 }
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * Resolve this variable in its current context
 * @return An expression value wrapping the data bound to this point
 * @throws QueryException Indicates an error getting data out of the context, or globalizing.
 */
public ComparableExpression resolveComparable() throws QueryException {
 RDFTerm v = resolve();
 if (!(v instanceof ComparableExpression)) throw new QueryException("Type Error: Cannot compare against a: " + v.getClass().getSimpleName());
 return (ComparableExpression)v;
}
origin: org.openrdf.mulgara/mulgara-resolver-spi

/**
 * Tests if a given column is bound in the current context.
 * @return <code>true</code> iff the column exists and is bound.
 */
public boolean isBound(int columnNumber) throws QueryException {
 try {
  return columnNumber != NOT_BOUND && tuples.getColumnValue(columnNumber) != Tuples.UNBOUND;
 } catch (Exception te) {  // TuplesException
  throw new QueryException("Error resolving column", te);
 }
}
origin: org.openrdf.mulgara/mulgara-query

/** {@inheritDoc} */
public boolean test(Context context) throws QueryException {
 if (type == null) return ((String)value).length() != 0;
 TypeInfo test = infoMap.get(type);
 if (test == null) throw new QueryException("Type Error: no effective boolean value for: " + toString());
 return test.ebv(value.toString());
}
origin: org.openrdf.mulgara/mulgara-query

 /**
  * Applies this function to its operands to get back a result.
  * @return A language code for the operand.
  * @throws QueryException If the operand was not a literal.
  */
 protected RDFTerm resolve() throws QueryException {
  if (!operand.isLiteral()) throw new QueryException("Disallowed type in LANG function. Expected a Literal. Got a : " + operand.getClass().getSimpleName());
  return ((ValueLiteral)operand).getLang();
 }
}
origin: org.openrdf.mulgara/mulgara-resolver-core

public void setAutoCommit(boolean autoCommit) throws QueryException {
 if (logger.isDebugEnabled()) {
  logger.debug("setAutoCommit(" + autoCommit + ") called.");
 }
 assertInternallyManagedXA();
 try {
  internalFactory.setAutoCommit(this, autoCommit);
 } catch (MulgaraTransactionException em) {
  throw new QueryException("Error setting autocommit", em);
 }
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * Get the type from the underlying operand
 * @return The operands type IRI
 * @throws QueryException If there was an error resolving the operand 
 */
protected RDFTerm resolve() throws QueryException {
 if (!operand.isLiteral()) throw new QueryException("Disallowed type in DATATYPE function. Expected a Literal. Got a : " + operand.getClass().getSimpleName());
 return ((ValueLiteral)operand).getType();
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * Tests a value to see if it is a simple literal, and throws an exception if it is.
 * Simple literals do a similar test when compared with a ComparableExpression.
 * @param v The comparable expression to test.
 * @throws QueryException If the comparable expression resolves to a {@link SimpleLiteral}.
 */
private void compatibilityTest(ComparableExpression v) throws QueryException {
 if (v.isLiteral() && ((ValueLiteral)v).isSimple()) throw new QueryException("Type Error: cannot compare a simple literal with a: " + getClass().getSimpleName());
}
origin: org.openrdf.mulgara/mulgara-resolver-core

public void rollback() throws QueryException {
 logger.debug("Rollback transaction");
 assertInternallyManagedXA();
 try {
  internalFactory.rollback(this);
 } catch (MulgaraTransactionException em) {
  throw new QueryException("Error performing rollback", em);
 }
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * @see org.mulgara.query.filter.value.ValueLiteral#getLexical()
 * @throws QueryException if the operand does not resolve
 */
public String getLexical() throws QueryException {
 Object value = operand.getValue();
 // Works fine without this test, but the SPARQL spec wants to prevent it
 if (value instanceof BNode) throw new QueryException("Not permitted to convert a blank node to a String in SPARQL");
 return operand.getValue().toString();
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * @see org.mulgara.query.filter.value.ValueLiteral#getType()
 * @throws QueryException if this function does not resolve to a literal.
 */
public IRI getType() throws QueryException {
 RDFTerm result = resolve();
 if (result.isLiteral()) return ((ValueLiteral)result).getType();
 throw new QueryException("Not valid to ask the type of a: " + result.getClass().getSimpleName());
}
origin: org.openrdf.mulgara/mulgara-query

/** @see org.mulgara.query.filter.value.ComparableExpression#lessThan(org.mulgara.query.filter.value.ComparableExpression) */
public boolean lessThan(ComparableExpression v) throws QueryException {
 if (!isLiteral()) throw new QueryException("Type Error: cannot compare a: " + getClass().getSimpleName());
 return ((ValueLiteral)resolve()).lessThan(v);
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * Extended numerical comparison function. Currently unused.
 * @param v The term to compare against.
 * @return <code>true</code> if this compares against v with semantic equivalence, regardless of lexical equivalence
 * @throws QueryException Thrown when a value cannot be resolved, or if the types are no numbers.
 */
@SuppressWarnings("unused")
private boolean numberCompare(RDFTerm v) throws QueryException {
 if (!(value instanceof Number) || !(v.getValue() instanceof Number)) throw new QueryException("Terms are not equal");
 return compare(value, v) == 0;
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * Tests if the parameter is a {@link org.mulgara.query.filter.value.SimpleLiteral}.
 * Throws an exception if it is not.
 * @param v The parameter to test
 * @throws QueryException Thrown if v is not a simple literal.
 */
private void testSimple(RDFTerm v) throws QueryException {
 if (!v.isLiteral() || !((ValueLiteral)v).isSimple()) throw new QueryException("Type Error: LangMatches requires simple literals");
}
origin: org.openrdf.mulgara/mulgara-query

/**
 * @see org.mulgara.query.filter.value.ValueLiteral#getLang()
 * @throws QueryException if this function does not resolve to a literal.
 */
public SimpleLiteral getLang() throws QueryException {
 RDFTerm result = resolve();
 if (result.isLiteral()) return ((ValueLiteral)result).getLang();
 throw new QueryException("Not valid to ask the language of a: " + result.getClass().getSimpleName());
}
origin: org.openrdf.mulgara/mulgara-query

public boolean test(Context context) throws QueryException {
 setCurrentContext(context);
 RDFTerm term = resolve();
 if (!term.isLiteral()) throw new QueryException("Cannot get an effective boolean value for a non-literal: " + term.getClass().getSimpleName());
 return ((ComparableExpression)term).test(context);
}
origin: org.openrdf.mulgara/mulgara-query

/** @see org.mulgara.query.filter.value.ValueLiteral#test(org.mulgara.query.filter.Context) */
public boolean test(Context context) throws QueryException {
 setCurrentContext(context);
 RDFTerm term = resolve();
 if (term.isLiteral()) {
  return ((ValueLiteral)term).test(context);
 } else if (term instanceof Filter) {
  return ((Filter)term).test(context);
 }
 throw new QueryException("Type error. Cannot get a boolean from a: " + term.getClass().getSimpleName());
}
org.mulgara.queryQueryException<init>

Javadoc

CONSTRUCTOR QueryException TO DO

Popular methods of QueryException

  • getCause

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now