|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.formatters.DelimitedStringResultParser
Converts a patterned string (such as an HTTP Get Request) into
an IResult object.
Can be used as an IResultParser to convert a delimited string into an IResult or as an
IFieldFormatter to expand a delimited string field into multiple field/value
pairs within an existing IResult.
IResultParser configuration:
XML Configuration Template:
<ResultParser class="com.raritantechnologies.searchApp.formatters.DelimitedStringResultParser"
fieldDelimiter="[ delimiter separating fields. e.g. '&' in HTTP ]"
valueDelimiter="[ delimiter separating field from value: e.g. '=' in HTTP ]" >
<!-- Optional IStringFilter that modifies the delimited string prior to parsing -->
<StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
</StringFilter>
</ResultParser>
IFieldFormatter configuration:
XML Configuration Template:
<FieldFormatter class="com.raritantechnologies.searchApp.formatters.DelimitedStringResultParser"
fieldDelimiter="[ delimiter separating fields. e.g. '&' in HTTP ]"
valueDelimiter="[ delimiter separating field from value: e.g. '=' in HTTP ]"
fieldID="[ result field that contains the delimited string to be parsed ]" >
<!-- Optional IStringFilter that modifies the delimited string prior to parsing -->
<StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
</StringFilter>
</FieldFormatter>
| Field Summary |
| Fields inherited from interface com.raritantechnologies.searchApp.IResultParser |
TEMPLATE |
| Fields inherited from interface com.raritantechnologies.searchApp.IFieldFormatter |
TEMPLATE |
| Constructor Summary | |
DelimitedStringResultParser()
|
|
| Method Summary | |
java.lang.String |
formatField(java.lang.String fieldVal)
Reformats a field value. |
java.lang.String |
formatField(java.lang.String sessionID,
java.lang.String fieldVal)
Reformats a field value. |
void |
formatResultField(IResult result)
Formats a result field "in place". |
void |
formatResultField(java.lang.String sessionID,
IResult result)
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 elem)
Initializes the formatter from configuration XML element. |
IResult |
parse(java.lang.String dataString)
Create an IResult object from the formatted data string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DelimitedStringResultParser()
| Method Detail |
public IResult parse(java.lang.String dataString)
IResultParserIResult object from the formatted data string.
parse in interface IResultParserpublic void initialize(org.w3c.dom.Element elem)
IFieldFormatter
initialize in interface IConfigurable
public void formatResultField(java.lang.String sessionID,
IResult result)
IFieldFormatter
formatResultField in interface IFieldFormattersessionID - The session key needed to lookup any session content stored
in the session data cache.result - The result object that is to be formatted.public void formatResultField(IResult result)
IFieldFormatter
formatResultField in interface IFieldFormatterresult - The result object that is to be formatted.public java.lang.String getFieldName()
IFieldFormatter
getFieldName in interface IFieldFormatter
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 java.lang.String formatField(java.lang.String fieldVal)
IFieldFormatter
formatField in interface IFieldFormatterfieldVal - The field value to be reformatted.
public 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 | |||||||||