Package ognl
Class OgnlParser
- java.lang.Object
-
- ognl.OgnlParser
-
- All Implemented Interfaces:
OgnlParserConstants,OgnlParserTreeConstants
public class OgnlParser extends java.lang.Object implements OgnlParserTreeConstants, OgnlParserConstants
OgnlParser is a JavaCC parser class; it translates OGNL expressions into abstract syntax trees (ASTs) that can then be interpreted by the getValue and setValue methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classOgnlParser.JJCallsprivate static classOgnlParser.LookaheadSuccess
-
Field Summary
Fields Modifier and Type Field Description private OgnlParser.JJCalls[]jj_2_rtnsprivate intjj_endposprivate java.util.Listjj_expentriesprivate int[]jj_expentryprivate intjj_gcprivate intjj_gen(package private) JavaCharStreamjj_input_streamprivate intjj_kindprivate intjj_laprivate int[]jj_la1private static int[]jj_la1_0private static int[]jj_la1_1private static int[]jj_la1_2private Tokenjj_lastposprivate int[]jj_lasttokensprivate booleanjj_lookingAheadWhether we are looking ahead.private OgnlParser.LookaheadSuccessjj_lsTokenjj_ntNext token.private intjj_ntkprivate booleanjj_rescanprivate Tokenjj_scanposprivate booleanjj_semLAprotected JJTOgnlParserStatejjtreeTokentokenCurrent token.OgnlParserTokenManagertoken_sourceGenerated Token Manager.-
Fields inherited from interface ognl.OgnlParserConstants
BACK_CHAR_ESC, BACK_CHAR_LITERAL, CHAR_LITERAL, DEC_DIGITS, DEC_FLT, DEFAULT, DIGIT, DYNAMIC_SUBSCRIPT, EOF, ESC, EXPONENT, FLT_LITERAL, FLT_SUFF, IDENT, INT_LITERAL, LETTER, STRING_ESC, STRING_LITERAL, tokenImage, WithinBackCharLiteral, WithinCharLiteral, WithinStringLiteral
-
Fields inherited from interface ognl.OgnlParserTreeConstants
JJTADD, JJTAND, JJTASSIGN, JJTBITAND, JJTBITNEGATE, JJTBITOR, JJTCHAIN, JJTCONST, JJTCTOR, JJTDIVIDE, JJTEQ, JJTEVAL, JJTGREATER, JJTGREATEREQ, JJTIN, JJTINSTANCEOF, JJTKEYVALUE, JJTLESS, JJTLESSEQ, JJTLIST, JJTMAP, JJTMETHOD, JJTMULTIPLY, JJTNEGATE, jjtNodeName, JJTNOT, JJTNOTEQ, JJTNOTIN, JJTOR, JJTPROJECT, JJTPROPERTY, JJTREMAINDER, JJTROOTVARREF, JJTSELECT, JJTSELECTFIRST, JJTSELECTLAST, JJTSEQUENCE, JJTSHIFTLEFT, JJTSHIFTRIGHT, JJTSTATICFIELD, JJTSTATICMETHOD, JJTSUBTRACT, JJTTEST, JJTTHISVARREF, JJTUNSIGNEDSHIFTRIGHT, JJTVARREF, JJTVOID, JJTXOR
-
-
Constructor Summary
Constructors Constructor Description OgnlParser(java.io.InputStream stream)Constructor with InputStream.OgnlParser(java.io.InputStream stream, java.lang.String encoding)Constructor with InputStream and supplied encodingOgnlParser(java.io.Reader stream)Constructor.OgnlParser(OgnlParserTokenManager tm)Constructor with generated Token Manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadditiveExpression()voidandExpression()voidassignmentExpression()java.lang.StringclassName()java.lang.StringclassReference()voidconditionalTestExpression()voidconstructorCall()voiddisable_tracing()Disable tracing.voidenable_tracing()Enable tracing.voidequalityExpression()voidexclusiveOrExpression()voidexpression()ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.voidinclusiveOrExpression()voidindex()private booleanjj_2_1(int xla)private booleanjj_2_10(int xla)private booleanjj_2_11(int xla)private booleanjj_2_12(int xla)private booleanjj_2_13(int xla)private booleanjj_2_14(int xla)private booleanjj_2_15(int xla)private booleanjj_2_16(int xla)private booleanjj_2_2(int xla)private booleanjj_2_3(int xla)private booleanjj_2_4(int xla)private booleanjj_2_5(int xla)private booleanjj_2_6(int xla)private booleanjj_2_7(int xla)private booleanjj_2_8(int xla)private booleanjj_2_9(int xla)private booleanjj_3_1()private booleanjj_3_10()private booleanjj_3_11()private booleanjj_3_12()private booleanjj_3_13()private booleanjj_3_14()private booleanjj_3_15()private booleanjj_3_16()private booleanjj_3_2()private booleanjj_3_3()private booleanjj_3_4()private booleanjj_3_5()private booleanjj_3_6()private booleanjj_3_7()private booleanjj_3_8()private booleanjj_3_9()private booleanjj_3R_21()private booleanjj_3R_22()private booleanjj_3R_23()private booleanjj_3R_24()private booleanjj_3R_25()private booleanjj_3R_26()private booleanjj_3R_27()private booleanjj_3R_28()private booleanjj_3R_29()private booleanjj_3R_30()private booleanjj_3R_31()private booleanjj_3R_32()private booleanjj_3R_33()private booleanjj_3R_34()private booleanjj_3R_35()private booleanjj_3R_36()private booleanjj_3R_37()private booleanjj_3R_38()private booleanjj_3R_39()private booleanjj_3R_40()private booleanjj_3R_41()private booleanjj_3R_42()private booleanjj_3R_43()private booleanjj_3R_44()private booleanjj_3R_45()private booleanjj_3R_46()private booleanjj_3R_47()private booleanjj_3R_48()private booleanjj_3R_49()private booleanjj_3R_50()private booleanjj_3R_51()private booleanjj_3R_52()private booleanjj_3R_53()private booleanjj_3R_54()private booleanjj_3R_55()private booleanjj_3R_56()private booleanjj_3R_57()private booleanjj_3R_58()private booleanjj_3R_59()private booleanjj_3R_60()private booleanjj_3R_61()private booleanjj_3R_62()private booleanjj_3R_63()private booleanjj_3R_64()private booleanjj_3R_65()private booleanjj_3R_66()private booleanjj_3R_67()private voidjj_add_error_token(int kind, int pos)private Tokenjj_consume_token(int kind)private static voidjj_la1_init_0()private static voidjj_la1_init_1()private static voidjj_la1_init_2()private intjj_ntk()private voidjj_rescan_token()private voidjj_save(int index, int xla)private booleanjj_scan_token(int kind)voidkeyValueExpression()voidlogicalAndExpression()voidlogicalOrExpression()voidmethodCall()voidmultiplicativeExpression()voidnavigationChain()voidprimaryExpression()voidprojection()Apply an expression to all elements of a collection, creating a new collection as the result.voidpropertyName()voidReInit(java.io.InputStream stream)Reinitialise.voidReInit(java.io.InputStream stream, java.lang.String encoding)Reinitialise.voidReInit(java.io.Reader stream)Reinitialise.voidReInit(OgnlParserTokenManager tm)Reinitialise.voidrelationalExpression()voidselectAll()Apply a boolean expression to all elements of a collection, creating a new collection containing those elements for which the expression returned true.voidselectFirst()Apply a boolean expression to all elements of a collection, creating a new collection containing those elements for the first element for which the expression returned true.voidselection()voidselectLast()Apply a boolean expression to all elements of a collection, creating a new collection containing those elements for the last element for which the expression returned true.voidshiftExpression()voidstaticMethodCall(java.lang.String className)voidstaticReference()NodetopLevelExpression()This is the top-level construct of OGNL.voidunaryExpression()
-
-
-
Field Detail
-
jjtree
protected JJTOgnlParserState jjtree
-
token_source
public OgnlParserTokenManager token_source
Generated Token Manager.
-
jj_input_stream
JavaCharStream jj_input_stream
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
jj_ntk
private int jj_ntk
-
jj_scanpos
private Token jj_scanpos
-
jj_lastpos
private Token jj_lastpos
-
jj_la
private int jj_la
-
jj_lookingAhead
private boolean jj_lookingAhead
Whether we are looking ahead.
-
jj_semLA
private boolean jj_semLA
-
jj_gen
private int jj_gen
-
jj_la1
private final int[] jj_la1
-
jj_la1_0
private static int[] jj_la1_0
-
jj_la1_1
private static int[] jj_la1_1
-
jj_la1_2
private static int[] jj_la1_2
-
jj_2_rtns
private final OgnlParser.JJCalls[] jj_2_rtns
-
jj_rescan
private boolean jj_rescan
-
jj_gc
private int jj_gc
-
jj_ls
private final OgnlParser.LookaheadSuccess jj_ls
-
jj_expentries
private java.util.List jj_expentries
-
jj_expentry
private int[] jj_expentry
-
jj_kind
private int jj_kind
-
jj_lasttokens
private int[] jj_lasttokens
-
jj_endpos
private int jj_endpos
-
-
Constructor Detail
-
OgnlParser
public OgnlParser(java.io.InputStream stream)
Constructor with InputStream.- Parameters:
stream- the InputStream to parse.
-
OgnlParser
public OgnlParser(java.io.InputStream stream, java.lang.String encoding)Constructor with InputStream and supplied encoding- Parameters:
stream- the InputStream to parse.encoding- the encoding to use for the stream.
-
OgnlParser
public OgnlParser(java.io.Reader stream)
Constructor.- Parameters:
stream- the Reader to parse.
-
OgnlParser
public OgnlParser(OgnlParserTokenManager tm)
Constructor with generated Token Manager.- Parameters:
tm- the OgnParserTokenManager to use during parsing.
-
-
Method Detail
-
topLevelExpression
public final Node topLevelExpression() throws ParseException
This is the top-level construct of OGNL.- Returns:
- the Node representing the top-level expression.
- Throws:
ParseException- if the expression parsing fails.
-
expression
public final void expression() throws ParseException- Throws:
ParseException
-
assignmentExpression
public final void assignmentExpression() throws ParseException- Throws:
ParseException
-
conditionalTestExpression
public final void conditionalTestExpression() throws ParseException- Throws:
ParseException
-
logicalOrExpression
public final void logicalOrExpression() throws ParseException- Throws:
ParseException
-
logicalAndExpression
public final void logicalAndExpression() throws ParseException- Throws:
ParseException
-
inclusiveOrExpression
public final void inclusiveOrExpression() throws ParseException- Throws:
ParseException
-
exclusiveOrExpression
public final void exclusiveOrExpression() throws ParseException- Throws:
ParseException
-
andExpression
public final void andExpression() throws ParseException- Throws:
ParseException
-
equalityExpression
public final void equalityExpression() throws ParseException- Throws:
ParseException
-
relationalExpression
public final void relationalExpression() throws ParseException- Throws:
ParseException
-
shiftExpression
public final void shiftExpression() throws ParseException- Throws:
ParseException
-
additiveExpression
public final void additiveExpression() throws ParseException- Throws:
ParseException
-
multiplicativeExpression
public final void multiplicativeExpression() throws ParseException- Throws:
ParseException
-
unaryExpression
public final void unaryExpression() throws ParseException- Throws:
ParseException
-
navigationChain
public final void navigationChain() throws ParseException- Throws:
ParseException
-
primaryExpression
public final void primaryExpression() throws ParseException- Throws:
ParseException
-
keyValueExpression
public final void keyValueExpression() throws ParseException- Throws:
ParseException
-
staticReference
public final void staticReference() throws ParseException- Throws:
ParseException
-
classReference
public final java.lang.String classReference() throws ParseException- Throws:
ParseException
-
className
public final java.lang.String className() throws ParseException- Throws:
ParseException
-
constructorCall
public final void constructorCall() throws ParseException- Throws:
ParseException
-
propertyName
public final void propertyName() throws ParseException- Throws:
ParseException
-
staticMethodCall
public final void staticMethodCall(java.lang.String className) throws ParseException- Throws:
ParseException
-
methodCall
public final void methodCall() throws ParseException- Throws:
ParseException
-
projection
public final void projection() throws ParseExceptionApply an expression to all elements of a collection, creating a new collection as the result.- Throws:
ParseException- if the application of the projection expression fails.
-
selection
public final void selection() throws ParseException- Throws:
ParseException
-
selectAll
public final void selectAll() throws ParseExceptionApply a boolean expression to all elements of a collection, creating a new collection containing those elements for which the expression returned true.- Throws:
ParseException- if the application of the select all expression fails.
-
selectFirst
public final void selectFirst() throws ParseExceptionApply a boolean expression to all elements of a collection, creating a new collection containing those elements for the first element for which the expression returned true.- Throws:
ParseException- if the application of the select first expression fails.
-
selectLast
public final void selectLast() throws ParseExceptionApply a boolean expression to all elements of a collection, creating a new collection containing those elements for the last element for which the expression returned true.- Throws:
ParseException- if the application of the select last expression fails.
-
index
public final void index() throws ParseException- Throws:
ParseException
-
jj_2_1
private boolean jj_2_1(int xla)
-
jj_2_2
private boolean jj_2_2(int xla)
-
jj_2_3
private boolean jj_2_3(int xla)
-
jj_2_4
private boolean jj_2_4(int xla)
-
jj_2_5
private boolean jj_2_5(int xla)
-
jj_2_6
private boolean jj_2_6(int xla)
-
jj_2_7
private boolean jj_2_7(int xla)
-
jj_2_8
private boolean jj_2_8(int xla)
-
jj_2_9
private boolean jj_2_9(int xla)
-
jj_2_10
private boolean jj_2_10(int xla)
-
jj_2_11
private boolean jj_2_11(int xla)
-
jj_2_12
private boolean jj_2_12(int xla)
-
jj_2_13
private boolean jj_2_13(int xla)
-
jj_2_14
private boolean jj_2_14(int xla)
-
jj_2_15
private boolean jj_2_15(int xla)
-
jj_2_16
private boolean jj_2_16(int xla)
-
jj_3R_56
private boolean jj_3R_56()
-
jj_3R_55
private boolean jj_3R_55()
-
jj_3R_54
private boolean jj_3R_54()
-
jj_3R_31
private boolean jj_3R_31()
-
jj_3_13
private boolean jj_3_13()
-
jj_3R_53
private boolean jj_3R_53()
-
jj_3R_26
private boolean jj_3R_26()
-
jj_3R_52
private boolean jj_3R_52()
-
jj_3R_42
private boolean jj_3R_42()
-
jj_3_12
private boolean jj_3_12()
-
jj_3_11
private boolean jj_3_11()
-
jj_3R_67
private boolean jj_3R_67()
-
jj_3_2
private boolean jj_3_2()
-
jj_3R_66
private boolean jj_3R_66()
-
jj_3R_64
private boolean jj_3R_64()
-
jj_3_1
private boolean jj_3_1()
-
jj_3R_23
private boolean jj_3R_23()
-
jj_3R_41
private boolean jj_3R_41()
-
jj_3R_30
private boolean jj_3R_30()
-
jj_3R_32
private boolean jj_3R_32()
-
jj_3R_51
private boolean jj_3R_51()
-
jj_3R_29
private boolean jj_3R_29()
-
jj_3R_40
private boolean jj_3R_40()
-
jj_3R_33
private boolean jj_3R_33()
-
jj_3R_63
private boolean jj_3R_63()
-
jj_3R_28
private boolean jj_3R_28()
-
jj_3R_50
private boolean jj_3R_50()
-
jj_3R_39
private boolean jj_3R_39()
-
jj_3_10
private boolean jj_3_10()
-
jj_3R_24
private boolean jj_3R_24()
-
jj_3R_49
private boolean jj_3R_49()
-
jj_3R_48
private boolean jj_3R_48()
-
jj_3_16
private boolean jj_3_16()
-
jj_3R_47
private boolean jj_3R_47()
-
jj_3_15
private boolean jj_3_15()
-
jj_3R_38
private boolean jj_3R_38()
-
jj_3R_46
private boolean jj_3R_46()
-
jj_3_14
private boolean jj_3_14()
-
jj_3R_62
private boolean jj_3R_62()
-
jj_3R_45
private boolean jj_3R_45()
-
jj_3R_37
private boolean jj_3R_37()
-
jj_3R_22
private boolean jj_3R_22()
-
jj_3_9
private boolean jj_3_9()
-
jj_3R_36
private boolean jj_3R_36()
-
jj_3R_61
private boolean jj_3R_61()
-
jj_3R_60
private boolean jj_3R_60()
-
jj_3R_59
private boolean jj_3R_59()
-
jj_3_3
private boolean jj_3_3()
-
jj_3R_21
private boolean jj_3R_21()
-
jj_3R_58
private boolean jj_3R_58()
-
jj_3R_35
private boolean jj_3R_35()
-
jj_3R_44
private boolean jj_3R_44()
-
jj_3_8
private boolean jj_3_8()
-
jj_3R_57
private boolean jj_3R_57()
-
jj_3R_34
private boolean jj_3R_34()
-
jj_3_7
private boolean jj_3_7()
-
jj_3R_25
private boolean jj_3R_25()
-
jj_3_6
private boolean jj_3_6()
-
jj_3_5
private boolean jj_3_5()
-
jj_3R_27
private boolean jj_3R_27()
-
jj_3_4
private boolean jj_3_4()
-
jj_3R_65
private boolean jj_3R_65()
-
jj_3R_43
private boolean jj_3R_43()
-
jj_la1_init_0
private static void jj_la1_init_0()
-
jj_la1_init_1
private static void jj_la1_init_1()
-
jj_la1_init_2
private static void jj_la1_init_2()
-
ReInit
public void ReInit(java.io.InputStream stream)
Reinitialise.- Parameters:
stream- the InputStream to parse.
-
ReInit
public void ReInit(java.io.InputStream stream, java.lang.String encoding)Reinitialise.- Parameters:
stream- the InputStream to parse.encoding- the encoding to use for the stream.
-
ReInit
public void ReInit(java.io.Reader stream)
Reinitialise.- Parameters:
stream- the Reader to parse.
-
ReInit
public void ReInit(OgnlParserTokenManager tm)
Reinitialise.- Parameters:
tm- the OgnParserTokenManager to use during parsing.
-
jj_consume_token
private Token jj_consume_token(int kind) throws ParseException
- Throws:
ParseException
-
jj_scan_token
private boolean jj_scan_token(int kind)
-
getNextToken
public final Token getNextToken()
Get the next Token.- Returns:
- the next Token result from parsing.
-
getToken
public final Token getToken(int index)
Get the specific Token.- Parameters:
index- specifies how far to scan ahead for the Token.- Returns:
- the Token at the given index.
-
jj_ntk
private int jj_ntk()
-
jj_add_error_token
private void jj_add_error_token(int kind, int pos)
-
generateParseException
public ParseException generateParseException()
Generate ParseException.- Returns:
- a ParseException with information about current token parsing state.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
jj_rescan_token
private void jj_rescan_token()
-
jj_save
private void jj_save(int index, int xla)
-
-