Package org.jibx.schema.codegen
Class ExpressionBuilderBase
java.lang.Object
org.jibx.schema.codegen.ASTBuilderBase
org.jibx.schema.codegen.ExpressionBuilderBase
- Direct Known Subclasses:
ArrayAccessBuilder,CastBuilder,InfixExpressionBuilder,InvocationBuilder,NewArrayBuilder,NewInstanceBuilder,PrefixExpressionBuilder
Abstract syntax tree expression builder base. This is used for expressions with multiple component operands. It adds
convenience methods and control information to the base builder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExpressionExpression under construction.protected final ClassBuilderSource builder.Fields inherited from class org.jibx.schema.codegen.ASTBuilderBase
m_ast -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterLiteralOperand(char value) Add a character literal operand to expression.voidAdd anullliteral operand to expression.voidaddNumberLiteralOperand(String value) Add a number literal operand to expression.protected abstract voidaddOperand(Expression operand) Add operand to expression.voidaddStringLiteralOperand(String value) Add a string literal operand to expression.voidaddVariableOperand(String name) Add a local variable or field name operand to expression.(package private) ExpressionGet expression.Methods inherited from class org.jibx.schema.codegen.ASTBuilderBase
numberLiteral, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStatic, stringLiteral
-
Field Details
-
m_source
Source builder. -
m_expression
protected final Expression m_expressionExpression under construction.
-
-
Constructor Details
-
ExpressionBuilderBase
Constructor.- Parameters:
source-expr-
-
-
Method Details
-
getExpression
Expression getExpression()Get expression. This is provided only for use by other classes in this package.- Returns:
- expression
-
addOperand
protected abstract void addOperand(Expression operand) Add operand to expression. This must be implemented by each subclass to handle adding another operand.- Parameters:
operand-
-
addVariableOperand
Add a local variable or field name operand to expression.- Parameters:
name-
-
addStringLiteralOperand
Add a string literal operand to expression.- Parameters:
value-
-
addCharacterLiteralOperand
public void addCharacterLiteralOperand(char value) Add a character literal operand to expression.- Parameters:
value-
-
addNumberLiteralOperand
Add a number literal operand to expression.- Parameters:
value-
-
addNullOperand
public void addNullOperand()Add anullliteral operand to expression.
-