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 Expression
Expression under construction.protected final ClassBuilder
Source builder.Fields inherited from class org.jibx.schema.codegen.ASTBuilderBase
m_ast
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCharacterLiteralOperand
(char value) Add a character literal operand to expression.void
Add anull
literal operand to expression.void
addNumberLiteralOperand
(String value) Add a number literal operand to expression.protected abstract void
addOperand
(Expression operand) Add operand to expression.void
addStringLiteralOperand
(String value) Add a string literal operand to expression.void
addVariableOperand
(String name) Add a local variable or field name operand to expression.(package private) Expression
Get 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 anull
literal operand to expression.
-