public abstract class SimpleValueTagListener extends DefaultTagListener
Some examples:
<foo> value </foo>
... would translate into plain 'value', no value attribute
or mapping attribute must be defined
<foo bar="value"/>
... would translate into 'value' if 'bar' is specified value attribute
<foo key="k1" bar="value"/>
... would translate into { 'k1'=>'value'} if 'bar' is specified value attribute
and 'key' the specified mapping attribute
| Modifier and Type | Field and Description |
|---|---|
static String |
UNSPECIFIED_TYPE |
| Constructor and Description |
|---|
SimpleValueTagListener(TagListener parent,
String tagName) |
SimpleValueTagListener(TagListener parent,
String tagName,
String valueAttribute,
String mappingAttribute) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCharacters()
Superclass method overridden to get characters from value attribute if such is specified.
|
String |
getTagName()
The tag name which this listener is bound to.
|
abstract Object |
getValue()
Translation method.
|
boolean |
isMapped() |
Object |
processEndElement(ObjectProcessor processor)
To be overridden.
|
addResult, addSubTagListener, addSubTagValue, characters, clearValues, createSubTagListeners, endElement, getAttribute, getEndLineNumber, getParent, getParents, getPartentTags, getResult, getStartLineNumber, getSubListenerMap, getSubTagDoubleValue, getSubTagIntValue, getSubTagListener, getSubTagValue, getSubTagValueCollection, getSubTagValueMap, isRoot, processError, processStartElement, readAttributes, setEndLineNumber, setStartLineNumber, startElementpublic static final String UNSPECIFIED_TYPE
public SimpleValueTagListener(TagListener parent, String tagName)
parent - the parent tag listenertagName - the tag name which this listener is bound topublic SimpleValueTagListener(TagListener parent, String tagName, String valueAttribute, String mappingAttribute)
parent - the parent tag listenertagName - the tag name this listener is bound tovalueAttribute - the xml attribute which contains the value to translate (optional)mappingAttribute - the xml attribute name which contains the key for the translated value (optional)public String getTagName()
public boolean isMapped()
true if a mapping attribute was specifiedpublic abstract Object getValue() throws ParseAbortException
ParseAbortExceptionpublic String getCharacters()
getCharacters in class DefaultTagListenerpublic Object processEndElement(ObjectProcessor processor) throws ParseAbortException
DefaultTagListenerprocessEndElement in class DefaultTagListenerParseAbortExceptionCopyright © 2017 SAP SE. All Rights Reserved.