|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.textx.TextEngine
public class TextEngine
Instances of this class are able to replace all variables by their values in a given text
| Constructor Summary | |
|---|---|
TextEngine(VariableResolver varResolver)
Initializes the new created instance with the given objects for resolving variable and function names to values. |
|
TextEngine(VariableResolver varResolver,
FunctionResolver funcResolver)
Initializes the new created instance with the given objects for resolving variable and function names to values. |
|
| Method Summary | |
|---|---|
void |
allowMissingPlaceholders()
Allows placeholders that cannot be resolved by the variable resolver. |
java.lang.String |
completeText(java.lang.String text)
Returns the given text, after replaceing all placeholders with according text. |
void |
forbidMissingPlaceholders()
Forbids placeholders that cannot be resolved by the variable resolver. |
FunctionResolver |
getFunctionResolver()
Returns the function resolver |
java.lang.String |
getSpecialNameCharacters()
Returns all extra charcters, that are allowed in placeholder names. |
java.lang.Character |
getVarEndDelimiter()
Returns the delimiter that marks the end of a variable |
VariableResolver |
getVariableResolver()
Returns the variable resolver |
java.lang.Character |
getVarStartDelimiter()
Returns the delimiter that marks the start of a variable |
java.lang.Character |
getVarStartPrefix()
Returns the character that is specified as prefix of the placeholder delimiter or null, if none is used. |
void |
setFunctionResolver(FunctionResolver fr)
Sets the function resolver |
void |
setIndentation(int indentSize)
Sets the number of spaces a text must be indented. |
void |
setSpecialNameCharacters(java.lang.String newValue)
Sets all extra charcters, that are allowed in placeholder names. |
void |
setVarEndDelimiter(char newValue)
Sets the character that indicates the end of a placeholder or directive to the specified value. |
void |
setVarEndDelimiter(java.lang.Character newValue)
Sets the delimiter that marks the end of a variable |
void |
setVariableResolver(VariableResolver vr)
Sets the variable resolver |
void |
setVarStartDelimiter(char newValue)
Sets the character that indicates the start of a placeholder or directive to the specified value. |
void |
setVarStartDelimiter(java.lang.Character newValue)
Sets the delimiter that marks the start of a variable |
void |
setVarStartPrefix(java.lang.Character prefix)
Sets the character that is is used as prefix of the placeholder start delimiter. |
void |
useDollarCurlyBrackets()
Sets the delimiters to ${} Placeholders then must look like ${varName}. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextEngine(VariableResolver varResolver)
varResolver - The object that provides values for variablessetVariableResolver( VariableResolver )
public TextEngine(VariableResolver varResolver,
FunctionResolver funcResolver)
varResolver - The object that provides values for variablesfuncResolver - The object that provides values for function callssetVariableResolver( VariableResolver ),
setFunctionResolver( FunctionResolver )| Method Detail |
|---|
public VariableResolver getVariableResolver()
public void setVariableResolver(VariableResolver vr)
public FunctionResolver getFunctionResolver()
public void setFunctionResolver(FunctionResolver fr)
public java.lang.Character getVarStartPrefix()
public void setVarStartPrefix(java.lang.Character prefix)
prefix - The prefix character of null to use none.public java.lang.Character getVarStartDelimiter()
public void setVarStartDelimiter(java.lang.Character newValue)
public java.lang.Character getVarEndDelimiter()
public void setVarEndDelimiter(java.lang.Character newValue)
public java.lang.String getSpecialNameCharacters()
public void setSpecialNameCharacters(java.lang.String newValue)
public java.lang.String completeText(java.lang.String text)
throws TextReplacementException
text - The input text containing placeholders.
TextReplacementExceptionpublic void setIndentation(int indentSize)
indentSize - the number of indentation spaces ( 0 means no indentation )public void setVarStartDelimiter(char newValue)
public void setVarEndDelimiter(char newValue)
public void useDollarCurlyBrackets()
Placeholders then must look like ${varName}.
public void allowMissingPlaceholders()
public void forbidMissingPlaceholders()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||