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
public abstract class ExpressionBuilderBase extends ASTBuilderBase
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
Fields Modifier and Type Field Description protected Expression
m_expression
Expression under construction.protected ClassBuilder
m_source
Source builder.-
Fields inherited from class org.jibx.schema.codegen.ASTBuilderBase
m_ast
-
-
Constructor Summary
Constructors Constructor Description ExpressionBuilderBase(ClassBuilder source, Expression expr)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addCharacterLiteralOperand(char value)
Add a character literal operand to expression.void
addNullOperand()
Add anull
literal operand to expression.void
addNumberLiteralOperand(java.lang.String value)
Add a number literal operand to expression.protected abstract void
addOperand(Expression operand)
Add operand to expression.void
addStringLiteralOperand(java.lang.String value)
Add a string literal operand to expression.void
addVariableOperand(java.lang.String name)
Add a local variable or field name operand to expression.(package private) Expression
getExpression()
Get expression.-
Methods inherited from class org.jibx.schema.codegen.ASTBuilderBase
numberLiteral, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStatic, stringLiteral
-
-
-
-
Field Detail
-
m_source
protected final ClassBuilder m_source
Source builder.
-
m_expression
protected final Expression m_expression
Expression under construction.
-
-
Constructor Detail
-
ExpressionBuilderBase
public ExpressionBuilderBase(ClassBuilder source, Expression expr)
Constructor.- Parameters:
source
-expr
-
-
-
Method Detail
-
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
public void addVariableOperand(java.lang.String name)
Add a local variable or field name operand to expression.- Parameters:
name
-
-
addStringLiteralOperand
public void addStringLiteralOperand(java.lang.String value)
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
public void addNumberLiteralOperand(java.lang.String value)
Add a number literal operand to expression.- Parameters:
value
-
-
addNullOperand
public void addNullOperand()
Add anull
literal operand to expression.
-
-