public class BasicTextFunctionResolver extends java.lang.Object implements FunctionResolver
TextEngine
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE
Name for a function that gets one string parameter and returns it
with a lower case first letter.
|
static java.lang.String |
LOWERCASE
Name for a function that gets one string parameter and returns it
with all letters changed to lower case.
|
static java.lang.String |
LOWERCASE_FIRST_LETTER
Name for a function that gets one string parameter and returns it
with a lower case first letter.
|
static java.lang.String |
UPPERCASE
Name for a function that gets one string parameter and returns it
with all letters changed to upper case.
|
static java.lang.String |
UPPERCASE_FIRST_LETTER
Name for a function that gets one string parameter and returns it
with a capitalized first letter.
|
Constructor and Description |
---|
BasicTextFunctionResolver() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkParameterCount(java.lang.String funcName,
java.util.List<java.lang.String> parameter,
int count) |
java.lang.Object |
executeFunction(java.lang.String functionName,
java.util.List<java.lang.String> parameter)
Returns the value for the function with the given name.
|
protected java.lang.String |
funcDate(java.util.List<java.lang.String> parameter) |
protected java.lang.String |
funcLowercase(java.util.List<java.lang.String> parameter) |
protected java.lang.String |
funcLowercaseFirstLetter(java.util.List<java.lang.String> parameter) |
protected java.lang.String |
funcUppercase(java.util.List<java.lang.String> parameter) |
protected java.lang.String |
funcUppercaseFirstLetter(java.util.List<java.lang.String> parameter) |
boolean |
isKnownFunction(java.lang.String functionName)
Returns if the function with the given name can be resolved by the receiver.
|
protected java.lang.String |
upperLowerFirstLetter(java.util.List<java.lang.String> parameter,
boolean upper) |
public static final java.lang.String UPPERCASE_FIRST_LETTER
public static final java.lang.String LOWERCASE_FIRST_LETTER
public static final java.lang.String UPPERCASE
public static final java.lang.String LOWERCASE
public static final java.lang.String DATE
public java.lang.Object executeFunction(java.lang.String functionName, java.util.List<java.lang.String> parameter) throws UnknownFunctionException, InvalidParameterException
executeFunction
in interface FunctionResolver
functionName
- The case sensitive name of the function.parameter
- A collection of parameters for the function.UnknownFunctionException
- The receiver is not knowing the function.InvalidParameterException
public boolean isKnownFunction(java.lang.String functionName)
isKnownFunction
in interface FunctionResolver
functionName
- The case sensitive name of the function.protected java.lang.String upperLowerFirstLetter(java.util.List<java.lang.String> parameter, boolean upper) throws InvalidParameterException
InvalidParameterException
protected java.lang.String funcUppercaseFirstLetter(java.util.List<java.lang.String> parameter) throws InvalidParameterException
InvalidParameterException
protected java.lang.String funcLowercaseFirstLetter(java.util.List<java.lang.String> parameter) throws InvalidParameterException
InvalidParameterException
protected java.lang.String funcUppercase(java.util.List<java.lang.String> parameter) throws InvalidParameterException
InvalidParameterException
protected java.lang.String funcLowercase(java.util.List<java.lang.String> parameter) throws InvalidParameterException
InvalidParameterException
protected java.lang.String funcDate(java.util.List<java.lang.String> parameter) throws InvalidParameterException
InvalidParameterException
protected void checkParameterCount(java.lang.String funcName, java.util.List<java.lang.String> parameter, int count) throws InvalidParameterException
InvalidParameterException