|
http://www.eteks.com | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eteks.parser.AbstractSyntax | +--com.eteks.jeks.ResourceSyntax | +--com.eteks.jeks.JeksFunctionSyntax
Localized syntax used by the parser to compile user functions.
Field Summary | |
static java.lang.Integer |
JEKS_FUNCTION_AND
|
static java.lang.Integer |
JEKS_FUNCTION_CHAR
|
static java.lang.Integer |
JEKS_FUNCTION_CODE
|
static java.lang.Integer |
JEKS_FUNCTION_DATE
|
static java.lang.Integer |
JEKS_FUNCTION_DATEVALUE
|
static java.lang.Integer |
JEKS_FUNCTION_DAY
|
static java.lang.Integer |
JEKS_FUNCTION_FACT
|
static java.lang.Integer |
JEKS_FUNCTION_FALSE
|
static java.lang.Integer |
JEKS_FUNCTION_FIND
|
static java.lang.Integer |
JEKS_FUNCTION_HOUR
|
static java.lang.Integer |
JEKS_FUNCTION_MINUTE
|
static java.lang.Integer |
JEKS_FUNCTION_MODULO
|
static java.lang.Integer |
JEKS_FUNCTION_MONTH
|
static java.lang.Integer |
JEKS_FUNCTION_NOW
|
static java.lang.Integer |
JEKS_FUNCTION_OR
|
static java.lang.Integer |
JEKS_FUNCTION_RAND
|
static java.lang.Integer |
JEKS_FUNCTION_SECOND
|
static java.lang.Integer |
JEKS_FUNCTION_SUM
|
static java.lang.Integer |
JEKS_FUNCTION_TIME
|
static java.lang.Integer |
JEKS_FUNCTION_TIMEVALUE
|
static java.lang.Integer |
JEKS_FUNCTION_TRUE
|
static java.lang.Integer |
JEKS_FUNCTION_WEEKDAY
|
static java.lang.Integer |
JEKS_FUNCTION_YEAR
|
static java.lang.Integer |
MESSAGE_ASSIGN_OPERATOR_EXPECTED
|
static java.lang.Integer |
MESSAGE_CLOSING_BRACKET_EXPECTED
|
static java.lang.Integer |
MESSAGE_CLOSING_BRACKET_WITHOUT_OPENING_BRACKET
|
static java.lang.Integer |
MESSAGE_COMPILATION_ERROR_TITLE
|
static java.lang.Integer |
MESSAGE_DUPLICATED_PARAMETER_NAME
|
static java.lang.Integer |
MESSAGE_ELSE_OPERATOR_EXPECTED
|
static java.lang.Integer |
MESSAGE_ELSE_OPERATOR_WITHOUT_IF_THEN_OPERATORS
|
static java.lang.Integer |
MESSAGE_FUNCTION_NAME_ALREADY_EXISTS
|
static java.lang.Integer |
MESSAGE_INVALID_FUNCTION_NAME
|
static java.lang.Integer |
MESSAGE_INVALID_JEKS_FILE
|
static java.lang.Integer |
MESSAGE_INVALID_PARAMETER_NAME
|
static java.lang.Integer |
MESSAGE_INVALID_PARAMETERS_COUNT_IN_FUNCTION_CALL
|
static java.lang.Integer |
MESSAGE_MISSING_PARAMETERS_IN_FUNCTION_CALL
|
static java.lang.Integer |
MESSAGE_OPENING_BRACKET_EXPECTED
|
static java.lang.Integer |
MESSAGE_RESERVED_WORD
|
static java.lang.Integer |
MESSAGE_SYNTAX_ERROR
|
static java.lang.Integer |
MESSAGE_THEN_OPERATOR_EXPECTED
|
static java.lang.Integer |
MESSAGE_THEN_OPERATOR_WITHOUT_IF_OPERATOR
|
static java.lang.Integer |
MESSAGE_UNKOWN_IDENTIFIER
|
Constructor Summary | |
JeksFunctionSyntax()
Creates an instance of JeksFunctionSyntax using default locale. |
|
JeksFunctionSyntax(java.util.Locale locale)
Creates an instance of JeksFunctionSyntax initialized with the resource bundle
com.eteks.jeks.syntax . |
Method Summary | |
java.lang.String |
getExceptionMessage(CompilationException exception)
Returns the localized message matching the exception. |
java.lang.String |
getJeksFunction(java.lang.Object jeksFunctionKey)
Returns the Jeks function name matching the key jeksFunctionKey
(one of the JEKS_FUNCTION_... constants). |
java.lang.Object |
getJeksFunctionKey(java.lang.String jeksFunction)
Returns the key matching the Jeks function of name jeksFunction . |
java.lang.Object |
getLiteral(java.lang.String expression,
java.lang.StringBuffer extractedLiteral)
Returns the value of the literal parsed from the string expression
or null if expression doesn't start with a literal. |
java.util.Locale |
getLocale()
Returns the locale of this syntax. |
java.lang.String |
getMessage(java.lang.Object messageKey)
Returns the localized message matching the key messageKey (one of the
MESSAGE_... constants). |
java.text.NumberFormat |
getNumberFormat()
Returns the number format instance used to format and parse numbers. |
char |
getQuoteCharacter()
Returns the char used to quote string litterals. |
boolean |
isValidIdentifier(java.lang.String identifier)
Returns true if identifier is a correct name of function
or parameter. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Integer JEKS_FUNCTION_SUM
public static final java.lang.Integer JEKS_FUNCTION_RAND
public static final java.lang.Integer JEKS_FUNCTION_MODULO
public static final java.lang.Integer JEKS_FUNCTION_FACT
public static final java.lang.Integer JEKS_FUNCTION_AND
public static final java.lang.Integer JEKS_FUNCTION_OR
public static final java.lang.Integer JEKS_FUNCTION_TRUE
public static final java.lang.Integer JEKS_FUNCTION_FALSE
public static final java.lang.Integer JEKS_FUNCTION_DATE
public static final java.lang.Integer JEKS_FUNCTION_DATEVALUE
public static final java.lang.Integer JEKS_FUNCTION_NOW
public static final java.lang.Integer JEKS_FUNCTION_TIME
public static final java.lang.Integer JEKS_FUNCTION_TIMEVALUE
public static final java.lang.Integer JEKS_FUNCTION_YEAR
public static final java.lang.Integer JEKS_FUNCTION_MONTH
public static final java.lang.Integer JEKS_FUNCTION_DAY
public static final java.lang.Integer JEKS_FUNCTION_WEEKDAY
public static final java.lang.Integer JEKS_FUNCTION_HOUR
public static final java.lang.Integer JEKS_FUNCTION_MINUTE
public static final java.lang.Integer JEKS_FUNCTION_SECOND
public static final java.lang.Integer JEKS_FUNCTION_CHAR
public static final java.lang.Integer JEKS_FUNCTION_FIND
public static final java.lang.Integer JEKS_FUNCTION_CODE
public static final java.lang.Integer MESSAGE_COMPILATION_ERROR_TITLE
public static final java.lang.Integer MESSAGE_OPENING_BRACKET_EXPECTED
public static final java.lang.Integer MESSAGE_INVALID_FUNCTION_NAME
public static final java.lang.Integer MESSAGE_RESERVED_WORD
public static final java.lang.Integer MESSAGE_FUNCTION_NAME_ALREADY_EXISTS
public static final java.lang.Integer MESSAGE_CLOSING_BRACKET_EXPECTED
public static final java.lang.Integer MESSAGE_ASSIGN_OPERATOR_EXPECTED
public static final java.lang.Integer MESSAGE_INVALID_PARAMETER_NAME
public static final java.lang.Integer MESSAGE_DUPLICATED_PARAMETER_NAME
public static final java.lang.Integer MESSAGE_SYNTAX_ERROR
public static final java.lang.Integer MESSAGE_CLOSING_BRACKET_WITHOUT_OPENING_BRACKET
public static final java.lang.Integer MESSAGE_UNKOWN_IDENTIFIER
public static final java.lang.Integer MESSAGE_MISSING_PARAMETERS_IN_FUNCTION_CALL
public static final java.lang.Integer MESSAGE_INVALID_PARAMETERS_COUNT_IN_FUNCTION_CALL
public static final java.lang.Integer MESSAGE_THEN_OPERATOR_EXPECTED
public static final java.lang.Integer MESSAGE_ELSE_OPERATOR_EXPECTED
public static final java.lang.Integer MESSAGE_THEN_OPERATOR_WITHOUT_IF_OPERATOR
public static final java.lang.Integer MESSAGE_ELSE_OPERATOR_WITHOUT_IF_THEN_OPERATORS
public static final java.lang.Integer MESSAGE_INVALID_JEKS_FILE
Constructor Detail |
public JeksFunctionSyntax()
JeksFunctionSyntax
using default locale.public JeksFunctionSyntax(java.util.Locale locale)
JeksFunctionSyntax
initialized with the resource bundle
com.eteks.jeks.syntax
. The syntax may be localized with an appropriate
locale. See the default locale file com/eteks/jeks/resources/syntax.properties to see which
type of syntax is described by a JeksFunctionSyntax
object.Method Detail |
public java.util.Locale getLocale()
public java.lang.String getMessage(java.lang.Object messageKey)
messageKey
(one of the
MESSAGE_...
constants).public java.lang.String getExceptionMessage(CompilationException exception)
public java.lang.Object getJeksFunctionKey(java.lang.String jeksFunction)
jeksFunction
. Jeks
functions may be localized.public java.lang.String getJeksFunction(java.lang.Object jeksFunctionKey)
jeksFunctionKey
(one of the JEKS_FUNCTION_...
constants). Jeks functions may be localized.public java.lang.Object getLiteral(java.lang.String expression, java.lang.StringBuffer extractedLiteral)
expression
or null
if expression
doesn't start with a literal. If a
literal is found at the beginning of expression
, this method extracts
the parsed literal in the string buffer extractedLiteral
.
The extracted literal is a number, a string or a character. Numbers are parsed with
a localized number parser.expression
- the string to parse.extractedLiteral
- the literal extracted from expression
identified
as a valid literal with the syntax of the parser.null
if expression
doesn't start with a valid literal. If the literal is a number,
an instance of Number
is returned, if the literal is a string
an instance of String
is returned.public char getQuoteCharacter()
0
by default.public java.text.NumberFormat getNumberFormat()
NumberFormat
.public boolean isValidIdentifier(java.lang.String identifier)
true
if identifier
is a correct name of function
or parameter. identifier
may contain letters, digits, or the character _.
Its first character can't be a digit.identifier
- the string to test.true
if identifier
is a correct identifier.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |