Class PropertyLookupParser
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.util.PropertyLookupParser
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeanPropertyLookupParser
,ConfigurationPropertyLookupParser
,MessageFormatSupport.MessageCompiler
,SQLParameterLookupParser
public abstract class PropertyLookupParser extends Object implements Serializable
The property lookup parser is used to resolve embedded references to properties within strings. The default format of the property specification is:${property-name}
where 'property-name is the name of the property. If this construct is found within the text, it is replaced with the value returned from a call to "lookupVariable".- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ESCAPE_MODE_ALL
static int
ESCAPE_MODE_NONE
static int
ESCAPE_MODE_STRICT
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertyLookupParser()
Initializes the parser to the default format of "${..}".
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description char
getClosingBraceChar()
Returns the currently defined closed-brace char.char
getEscapeChar()
Returns the escape char.int
getEscapeMode()
char
getMarkerChar()
Returns initial property marker char.char
getOpeningBraceChar()
Returns the currently defined opening-brace char.protected void
handleVariableLookup(StringBuilder result, DataRow parameters, String columnName)
protected abstract String
lookupVariable(String property)
Looks up the property with the given name.protected char
postProcessCharacter(char c)
void
setClosingBraceChar(char closingBraceChar)
Defines the closing brace character.void
setEscapeChar(char escapeChar)
Defines the escape char.void
setEscapeMode(int escapeMode)
void
setMarkerChar(char markerChar)
Defines initial property marker char.void
setOpeningBraceChar(char openingBraceChar)
Defines the opening brace character.String
translateAndLookup(String value)
Translates the given string and resolves the embedded property references.String
translateAndLookup(String value, DataRow parameters)
Translates the given string and resolves the embedded property references.
-
-
-
Field Detail
-
ESCAPE_MODE_NONE
public static final int ESCAPE_MODE_NONE
- See Also:
- Constant Field Values
-
ESCAPE_MODE_ALL
public static final int ESCAPE_MODE_ALL
- See Also:
- Constant Field Values
-
ESCAPE_MODE_STRICT
public static final int ESCAPE_MODE_STRICT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEscapeMode
public int getEscapeMode()
-
setEscapeMode
public void setEscapeMode(int escapeMode)
-
getClosingBraceChar
public char getClosingBraceChar()
Returns the currently defined closed-brace char.- Returns:
- the closed-brace char.
-
setClosingBraceChar
public void setClosingBraceChar(char closingBraceChar)
Defines the closing brace character.- Parameters:
closingBraceChar
- the closed-brace character.
-
getEscapeChar
public char getEscapeChar()
Returns the escape char.- Returns:
- the escape char.
-
setEscapeChar
public void setEscapeChar(char escapeChar)
Defines the escape char.- Parameters:
escapeChar
- the escape char
-
getOpeningBraceChar
public char getOpeningBraceChar()
Returns the currently defined opening-brace char.- Returns:
- the opening-brace char.
-
setOpeningBraceChar
public void setOpeningBraceChar(char openingBraceChar)
Defines the opening brace character.- Parameters:
openingBraceChar
- the opening-brace character.
-
getMarkerChar
public char getMarkerChar()
Returns initial property marker char.- Returns:
- the initial property marker character.
-
setMarkerChar
public void setMarkerChar(char markerChar)
Defines initial property marker char.- Parameters:
markerChar
- the initial property marker character.
-
translateAndLookup
public String translateAndLookup(String value)
Translates the given string and resolves the embedded property references.- Parameters:
value
- the raw value,- Returns:
- the fully translated string.
-
translateAndLookup
public String translateAndLookup(String value, DataRow parameters)
Translates the given string and resolves the embedded property references.- Parameters:
value
- the raw value,- Returns:
- the fully translated string.
-
postProcessCharacter
protected char postProcessCharacter(char c)
-
handleVariableLookup
protected void handleVariableLookup(StringBuilder result, DataRow parameters, String columnName)
-
-