Codota Logo
ConstantExpression
Code IndexAdd Codota to your IDE (free)

How to use
ConstantExpression
in
org.apache.activemq.artemis.selector.filter

Best Java code snippets using org.apache.activemq.artemis.selector.filter.ConstantExpression (Showing top 20 results out of 315)

  • Common ways to obtain ConstantExpression
private void myMethod () {
ConstantExpression c =
  • Codota IconString text;ConstantExpression.createFloat(text)
  • Codota IconString text;ConstantExpression.createFromHex(text)
  • Codota IconString text;ConstantExpression.createFromOctal(text)
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

case STRING_LITERAL:
 s = stringLitteral();
      left = new ConstantExpression(s);
 break;
case DECIMAL_LITERAL:
 t = jj_consume_token(DECIMAL_LITERAL);
      left = ConstantExpression.createFromDecimal(t.image);
 break;
case HEX_LITERAL:
 t = jj_consume_token(HEX_LITERAL);
      left = ConstantExpression.createFromHex(t.image);
 break;
case OCTAL_LITERAL:
 t = jj_consume_token(OCTAL_LITERAL);
      left = ConstantExpression.createFromOctal(t.image);
 break;
case FLOATING_POINT_LITERAL:
 t = jj_consume_token(FLOATING_POINT_LITERAL);
      left = ConstantExpression.createFloat(t.image);
 break;
case TRUE:
origin: wildfly/wildfly

@Override
public String toString() {
 return "XQUERY " + ConstantExpression.encodeString(xpath);
}
origin: wildfly/wildfly

/**
* Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot
* not be NULL TRUE or FALSE literals.
*
* @param expr
*/
public static void checkEqualOperand(Expression expr) {
 if (expr instanceof ConstantExpression) {
   Object value = ((ConstantExpression) expr).getValue();
   if (value == null) {
    throw new RuntimeException("'" + expr + "' cannot be compared.");
   }
 }
}
origin: wildfly/wildfly

public static ConstantExpression createFloat(String text) {
 Number value = new Double(text);
 return new ConstantExpression(value);
}
origin: wildfly/wildfly

public static ConstantExpression createFromOctal(String text) {
 Number value = Long.valueOf(Long.parseLong(text, 8));
 long l = value.longValue();
 if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
   value = Integer.valueOf(value.intValue());
 }
 return new ConstantExpression(value);
}
origin: wildfly/wildfly

case STRING_LITERAL:
 s = stringLitteral();
      left = new ConstantExpression(s);
 break;
case DECIMAL_LITERAL:
 t = jj_consume_token(DECIMAL_LITERAL);
      left = ConstantExpression.createFromDecimal(t.image);
 break;
case HEX_LITERAL:
 t = jj_consume_token(HEX_LITERAL);
      left = ConstantExpression.createFromHex(t.image);
 break;
case OCTAL_LITERAL:
 t = jj_consume_token(OCTAL_LITERAL);
      left = ConstantExpression.createFromOctal(t.image);
 break;
case FLOATING_POINT_LITERAL:
 t = jj_consume_token(FLOATING_POINT_LITERAL);
      left = ConstantExpression.createFloat(t.image);
 break;
case TRUE:
origin: wildfly/wildfly

public static ConstantExpression createFromHex(String text) {
 Number value = Long.valueOf(Long.parseLong(text.substring(2), 16));
 long l = value.longValue();
 if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
   value = Integer.valueOf(value.intValue());
 }
 return new ConstantExpression(value);
}
origin: wildfly/wildfly

@Override
public String toString() {
 return "XPATH " + ConstantExpression.encodeString(xpath);
}
origin: wildfly/wildfly

/**
* Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions.
*
* @param expr
*/
public static void checkLessThanOperand(Expression expr) {
 if (expr instanceof ConstantExpression) {
   Object value = ((ConstantExpression) expr).getValue();
   if (value instanceof Number) {
    return;
   }
   // Else it's boolean or a String..
   throw new RuntimeException("Value '" + expr + "' cannot be compared.");
 }
 if (expr instanceof BooleanExpression) {
   throw new RuntimeException("Value '" + expr + "' cannot be compared.");
 }
}
origin: apache/activemq-artemis

case STRING_LITERAL:
 s = stringLitteral();
      left = new ConstantExpression(s);
 break;
case DECIMAL_LITERAL:
 t = jj_consume_token(DECIMAL_LITERAL);
      left = ConstantExpression.createFromDecimal(t.image);
 break;
case HEX_LITERAL:
 t = jj_consume_token(HEX_LITERAL);
      left = ConstantExpression.createFromHex(t.image);
 break;
case OCTAL_LITERAL:
 t = jj_consume_token(OCTAL_LITERAL);
      left = ConstantExpression.createFromOctal(t.image);
 break;
case FLOATING_POINT_LITERAL:
 t = jj_consume_token(FLOATING_POINT_LITERAL);
      left = ConstantExpression.createFloat(t.image);
 break;
case TRUE:
origin: wildfly/wildfly

public static ConstantExpression createFromDecimal(String text) {
 // Strip off the 'l' or 'L' if needed.
 if (text.endsWith("l") || text.endsWith("L")) {
   text = text.substring(0, text.length() - 1);
 }
 Number value;
 try {
   value = new Long(text);
 } catch (NumberFormatException e) {
   // The number may be too big to fit in a long.
   value = new BigDecimal(text);
 }
 long l = value.longValue();
 if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
   value = Integer.valueOf(value.intValue());
 }
 return new ConstantExpression(value);
}
origin: wildfly/wildfly

/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
 if (value == null) {
   return "NULL";
 }
 if (value instanceof Boolean) {
   return ((Boolean) value).booleanValue() ? "TRUE" : "FALSE";
 }
 if (value instanceof String) {
   return encodeString((String) value);
 }
 return value.toString();
}
origin: apache/activemq-artemis

/**
* Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot
* not be NULL TRUE or FALSE literals.
*
* @param expr
*/
public static void checkEqualOperand(Expression expr) {
 if (expr instanceof ConstantExpression) {
   Object value = ((ConstantExpression) expr).getValue();
   if (value == null) {
    throw new RuntimeException("'" + expr + "' cannot be compared.");
   }
 }
}
origin: apache/activemq-artemis

case STRING_LITERAL:
 s = stringLitteral();
      left = new ConstantExpression(s);
 break;
case DECIMAL_LITERAL:
 t = jj_consume_token(DECIMAL_LITERAL);
      left = ConstantExpression.createFromDecimal(t.image);
 break;
case HEX_LITERAL:
 t = jj_consume_token(HEX_LITERAL);
      left = ConstantExpression.createFromHex(t.image);
 break;
case OCTAL_LITERAL:
 t = jj_consume_token(OCTAL_LITERAL);
      left = ConstantExpression.createFromOctal(t.image);
 break;
case FLOATING_POINT_LITERAL:
 t = jj_consume_token(FLOATING_POINT_LITERAL);
      left = ConstantExpression.createFloat(t.image);
 break;
case TRUE:
origin: apache/activemq-artemis

public static ConstantExpression createFloat(String text) {
 Number value = new Double(text);
 return new ConstantExpression(value);
}
origin: apache/activemq-artemis

@Override
public String toString() {
 return "XQUERY " + ConstantExpression.encodeString(xpath);
}
origin: org.apache.activemq/artemis-selector

/**
* Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot
* not be NULL TRUE or FALSE literals.
*
* @param expr
*/
public static void checkEqualOperand(Expression expr) {
 if (expr instanceof ConstantExpression) {
   Object value = ((ConstantExpression) expr).getValue();
   if (value == null) {
    throw new RuntimeException("'" + expr + "' cannot be compared.");
   }
 }
}
origin: org.jboss.eap/wildfly-client-all

case STRING_LITERAL:
 s = stringLitteral();
      left = new ConstantExpression(s);
 break;
case DECIMAL_LITERAL:
 t = jj_consume_token(DECIMAL_LITERAL);
      left = ConstantExpression.createFromDecimal(t.image);
 break;
case HEX_LITERAL:
 t = jj_consume_token(HEX_LITERAL);
      left = ConstantExpression.createFromHex(t.image);
 break;
case OCTAL_LITERAL:
 t = jj_consume_token(OCTAL_LITERAL);
      left = ConstantExpression.createFromOctal(t.image);
 break;
case FLOATING_POINT_LITERAL:
 t = jj_consume_token(FLOATING_POINT_LITERAL);
      left = ConstantExpression.createFloat(t.image);
 break;
case TRUE:
origin: org.apache.activemq/artemis-selector

public static ConstantExpression createFloat(String text) {
 Number value = new Double(text);
 return new ConstantExpression(value);
}
origin: apache/activemq-artemis

@Override
public String toString() {
 return "XPATH " + ConstantExpression.encodeString(xpath);
}
org.apache.activemq.artemis.selector.filterConstantExpression

Javadoc

Represents a constant expression

Most used methods

  • <init>
  • createFloat
  • createFromDecimal
  • createFromHex
  • createFromOctal
  • encodeString
    Encodes the value of string so that it looks like it would look like when it was provided in a selec
  • getValue

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
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