|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Generator
The text generator that process text patterns and generates text.
See txt(String)
for the description of patterns.
Field Summary | |
---|---|
static String |
DEFAULT_NAME
|
Method Summary | |
---|---|
Function |
getFunction(String name)
Returns function by name. |
Object |
getVariable(String name)
Returns variable by name. |
Function |
setFunction(String name,
Function func)
Registers function for the usage in patterns. |
Object |
setVariable(String name,
Object var)
Registers variable for the usage in patterns. |
void |
txt(String str)
Processes text pattern and generates text. |
void |
txtAsIs(String str)
Print string as is, don't treat it as pattern. |
Field Detail |
---|
static final String DEFAULT_NAME
Method Detail |
---|
Function setFunction(String name, Function func)
name
- The name of function.
Must be valid identifier
or empty string.func
- The implementation of function.
null
.Function getFunction(String name)
name
- The name of function.
null
.Object setVariable(String name, Object var)
name
- The name of variable.
Must be valid identifier
or empty string.var
- The value of variable.
null
.Object getVariable(String name)
name
- The name of variable.
null
.void txt(String str)
pattern ::= "${" ( <func:ID> ":" )? ( "." )? path "}" ;
path ::= attribute ( "." attribute )* ;
attribute ::= <attr_name:ID> ( "[" index "]" )? ;
index ::= <index_var:ID> | number ;
number ::= ( "-" )? ( <digit> )+ ;
The parameter of pattern is processed in the following way:
var
is specified use it as an attributed object
otherwise use the current variable.path
func
is specified use it
otherwise use the default function.
Run the function at the attribute value.
str
- The specified pattern.
UndefinedFunctionException
- If function name is undefined.
com.unitesk.atp.beanutils.PropertyException
- When problem with attribute path occurs.getFunction(String)
,
getVariable(String)
void txtAsIs(String str)
str
- The string to pass as is.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |