Class JExprs

java.lang.Object
org.jboss.jdeparser.JExprs

public final class JExprs extends Object
The factory for generating simple expressions.
  • Field Details

  • Constructor Details

    • JExprs

      private JExprs()
  • Method Details

    • decimal

      public static JExpr decimal(int val)
      Generate an int value in decimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • decimal

      public static JExpr decimal(long val)
      Generate a long value in decimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • decimal

      public static JExpr decimal(float val)
      Generate a float value in decimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • decimal

      public static JExpr decimal(double val)
      Generate a double value in decimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • hex

      public static JExpr hex(int val)
      Generate an int value in hexadecimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • hex

      public static JExpr hex(long val)
      Generate a long value in hexadecimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • hex

      public static JExpr hex(float val)
      Generate a float value in hexadecimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • hex

      public static JExpr hex(double val)
      Generate a double value in hexadecimal base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • binary

      public static JExpr binary(int val)
      Generate an int value in binary base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • binary

      public static JExpr binary(long val)
      Generate a long value in binary base.
      Parameters:
      val - the value
      Returns:
      the value expression
    • str

      public static JExpr str(String string)
      Generate a string constant value.
      Parameters:
      string - the string
      Returns:
      the string expression
    • ch

      public static JExpr ch(int val)
      Generate a char value constant.
      Parameters:
      val - the value
      Returns:
      the value expression
    • call

      public static JCall call(ExecutableElement element)
      Generate a method call expression to the given element.
      Parameters:
      element - the method to call
      Returns:
      the method call
    • call

      public static JCall call(String name)
      Generate a method call expression to the given method name.
      Parameters:
      name - the name of the method to call
      Returns:
      the method call
    • callStatic

      public static JCall callStatic(String type, String name)
      Generate a method call expression to a method on the given static type.
      Parameters:
      type - the type to call against
      name - the name of the method to call
      Returns:
      the method call
    • callStatic

      public static JCall callStatic(JType type, String name)
      Generate a method call expression to a method on the given static type.
      Parameters:
      type - the type to call against
      name - the name of the method to call
      Returns:
      the method call
    • callStatic

      public static JCall callStatic(Class<?> type, String name)
      Generate a method call expression to a method on the given static type.
      Parameters:
      type - the type to call against
      name - the name of the method to call
      Returns:
      the method call
    • $v

      public static JAssignableExpr $v(String name)
      Return a name expression. This method is a shortcut for name(String).
      Parameters:
      name - the name
      Returns:
      the expression
    • $v

      public static JAssignableExpr $v(JParamDeclaration paramDeclaration)
      Return a name expression from an annotation processor parameter declaration.
      Parameters:
      paramDeclaration - the method parameter
      Returns:
      the expression
    • $v

      public static JAssignableExpr $v(JVarDeclaration varDeclaration)
      Return a name expression from an annotation processor variable declaration.
      Parameters:
      varDeclaration - the variable declaration
      Returns:
      the expression
    • name

      public static JAssignableExpr name(String name)
      Return a name expression.
      Parameters:
      name - the name
      Returns:
      the expression
    • name

      public static JAssignableExpr name(JParamDeclaration paramDeclaration)
      Return a name expression from an annotation processor parameter declaration.
      Parameters:
      paramDeclaration - the method parameter
      Returns:
      the expression
    • name

      public static JAssignableExpr name(JVarDeclaration varDeclaration)
      Return a name expression from an annotation processor variable declaration.
      Parameters:
      varDeclaration - the variable declaration
      Returns:
      the expression
    • array

      public static JArrayExpr array()
      Return a new array expression. The array is initially empty.
      Returns:
      an array expression
    • array

      public static JArrayExpr array(JExpr... members)
      Return a new array expression. The array is initially filled with the given members.
      Parameters:
      members - the initial members of the array
      Returns:
      an array expression
    • array

      public static JArrayExpr array(String... members)
      Return a new array expression. The array is initially filled with the given strings.
      Parameters:
      members - the initial members of the array
      Returns:
      an array expression
    • array

      public static JArrayExpr array(int... members)
      Return a new array expression. The array is initially filled with the given integers.
      Parameters:
      members - the initial members of the array
      Returns:
      an array expression
    • array

      public static JArrayExpr array(long... members)
      Return a new array expression. The array is initially filled with the given integers.
      Parameters:
      members - the initial members of the array
      Returns:
      an array expression
    • lambda

      public static JLambda lambda()
      Return a lambda expression. The expression is initially empty.
      Returns:
      the lambda expression