|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.templateMerge.InformationToken
Generic class for creating the ability to allow a developer to define a token and how to get the data to replace the values in that token. These are very specific to the application at hand.
MergeTemplate
,
Serialized FormConstructor Summary | |
InformationToken(java.lang.String tok,
InformationRetrieval ir,
java.lang.String desc)
There are 3 mandatory elements of a token. |
Method Summary | |
java.lang.String |
compareData(java.lang.String message,
int[] skip)
Allow the user to require data to be of a certain type. |
protected int |
endIndex(java.lang.String init,
int start,
int open)
Find the matching end to the open. |
boolean |
equals(java.lang.Object obj)
Equality check: check for "nullness", then for class types, then for token and description strings. |
java.lang.String |
getDescription()
A user friendly description |
InformationRetrieval |
getInfoReader()
A special object that will be able to extract data from a specific object. |
java.lang.String |
getTokenString()
A token that will be replaced with the data from the InfoReader |
java.lang.String |
insertData(java.lang.String data,
java.lang.String message)
Replace the tokens in the message with the value of data. |
java.lang.String |
insertField(java.lang.Object ci,
java.lang.String message)
Using the provided object, get the necessary data that we will insert into the generated code. |
java.lang.String |
insertField(java.lang.Object ci,
java.lang.String message,
java.lang.String defaultData)
Using the provided object, get the necessary data that we will insert into the generated code. |
boolean |
isCollection()
A collection will create multiple versions of a template. |
boolean |
isIterator()
An interator is similar to a data element, except that it can be multiple data elements seperated via a ','. |
boolean |
isTree()
A tree will create multiple versions of a template, just like a collection, but elements in the collection will be used to merge subtemplates (as opposed to one object used to merge all subtemplates). |
protected java.lang.String |
optEnd()
No need to include the token in the 'end' since optional tags MUST have both a begin and an end. |
protected java.lang.String |
optStart()
Some tokens merely specify that the text between two tags is optional. |
java.lang.String |
removeOptionalTags(java.lang.String message,
java.lang.String comparisonValue)
We can add tags to a template definition that indicate optional data. |
java.lang.String |
removeOptionalText(java.lang.String message,
java.lang.String compare)
Remove the text that has been tagged in the template definition as optional. |
void |
setCollection(boolean aValue)
|
void |
setDescription(java.lang.String desc)
|
void |
setInfoReader(InformationRetrieval ir)
|
void |
setIterator(boolean aValue)
|
void |
setTokenString(java.lang.String st)
|
void |
setTree(boolean aValue)
|
java.lang.String |
toString()
The token value + the description. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InformationToken(java.lang.String tok, InformationRetrieval ir, java.lang.String desc)
Method Detail |
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getDescription()
public InformationRetrieval getInfoReader()
public java.lang.String getTokenString()
public java.lang.String compareData(java.lang.String message, int[] skip)
public java.lang.String insertData(java.lang.String data, java.lang.String message)
data
- The data with which to replace all instances of 'tokenstring'.message
- The template for which we are insterting data.
public java.lang.String insertField(java.lang.Object ci, java.lang.String message)
insertData(java.lang.String, java.lang.String)
public java.lang.String insertField(java.lang.Object ci, java.lang.String message, java.lang.String defaultData)
defaultData
- Will be the string used if the parameter value is null.insertData(java.lang.String, java.lang.String)
public boolean isCollection()
public boolean isIterator()
public boolean isTree()
protected java.lang.String optEnd()
protected java.lang.String optStart()
public java.lang.String removeOptionalTags(java.lang.String message, java.lang.String comparisonValue)
public java.lang.String removeOptionalText(java.lang.String message, java.lang.String compare)
compare
- An additional parameter to the optional tag.message
- The original template.
protected int endIndex(java.lang.String init, int start, int open)
public void setCollection(boolean aValue)
public void setDescription(java.lang.String desc)
public void setInfoReader(InformationRetrieval ir)
public void setIterator(boolean aValue)
public void setTokenString(java.lang.String st)
public void setTree(boolean aValue)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |