|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.formatters.RegExprFieldFormatter
Uses a regular expression processor to format field(s) of an IResult.
Can be configured with more than one input pattern, the first pattern that matches the result field value will
be used to reformat the field.
Formatter sets value of "fieldName" to output of regular expression processing using "inPattern" and "outPattern".
<Formatter
fieldID="fieldName"
formatterClass="com.raritantechnologies.searchApp.formatters.RegExprFieldFormatter"
inPattern="(*)\\s\\d\\d:\\d\\d:\\d\\d$"
outPattern="$1" />
Can also have one or more patterns - the first pattern that matches the field value will be used to
reformat the field:
<Formatter
fieldID="fieldName"
formatterClass="com.raritantechnologies.searchApp.formatters.RegExprFieldFormatter" >
<!-- one or more Pattern elements: -->
<Pattern inPattern="[ Input RegExpr pattern ]"
outPattern="[ output Reg Expr pattern ]"
checkPattern="[ matching pattern ]" >
<!-- optional StringFilter to apply to output of Regular Expression processing -->
<StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
<!-- configuration parameters of IStringFilter -->
</StringFilter>
</Pattern>
<!-- another Pattern element etc... -->
</Formatter>
| Field Summary |
| Fields inherited from interface com.raritantechnologies.searchApp.IFieldFormatter |
TEMPLATE |
| Constructor Summary | |
RegExprFieldFormatter()
|
|
RegExprFieldFormatter(java.lang.String fieldName,
java.lang.String inPattern,
java.lang.String outPattern)
|
|
| Method Summary | |
java.lang.String |
formatField(java.lang.String fieldVal)
returns formatted string by using Regular Expression transformation on the first matching pattern. |
java.lang.String |
formatField(java.lang.String sessionID,
java.lang.String fieldVal)
Reformats a field value. |
void |
formatResultField(IResult res)
Formats a result field "in place". |
void |
formatResultField(java.lang.String sessionID,
IResult res)
Formats a result field "in place", incorporating session context. |
java.lang.String |
getConfigurationXML()
|
java.lang.String |
getConfigurationXML(java.lang.String configurationTemplate)
|
java.lang.String |
getFieldName()
Returns the name of the result field that this formatter can reformat. |
void |
initialize(org.w3c.dom.Element initElem)
Initializes the formatter from configuration XML element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RegExprFieldFormatter()
public RegExprFieldFormatter(java.lang.String fieldName,
java.lang.String inPattern,
java.lang.String outPattern)
| Method Detail |
public java.lang.String getFieldName()
IFieldFormatter
getFieldName in interface IFieldFormatterpublic void formatResultField(IResult res)
IFieldFormatter
formatResultField in interface IFieldFormatterres - The result object that is to be formatted.
public void formatResultField(java.lang.String sessionID,
IResult res)
IFieldFormatter
formatResultField in interface IFieldFormattersessionID - The session key needed to lookup any session content stored
in the session data cache.res - The result object that is to be formatted.public java.lang.String formatField(java.lang.String fieldVal)
formatField in interface IFieldFormatterfieldVal - The field value to be reformatted.
public java.lang.String formatField(java.lang.String sessionID,
java.lang.String fieldVal)
IFieldFormatter
formatField in interface IFieldFormattersessionID - The session key needed to lookup any session content stored
in the session data cache.fieldVal - The field value to be reformatted.
public void initialize(org.w3c.dom.Element initElem)
IFieldFormatter
initialize in interface IFieldFormatterpublic java.lang.String getConfigurationXML()
getConfigurationXML in interface IFieldFormatterpublic java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
getConfigurationXML in interface IFieldFormatter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||