Package de.hybris.bootstrap.xml
Class SimpleValueTagListener
java.lang.Object
de.hybris.bootstrap.xml.DefaultTagListener
de.hybris.bootstrap.xml.SimpleValueTagListener
- All Implemented Interfaces:
TagListener
- Direct Known Subclasses:
BooleanValueTagListener,ClassValueTagListener,DateTagListener,DoubleValueTagListener,IntegerValueTagListener,StringValueTagListener
Base class for simple value tags. This class translates either the character content or the content of a specified
value attriute. The returned value is either the translated value or a map which maps the content of a specified
mapping attribute to the translated value.
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleValueTagListener(TagListener parent, String tagName) SimpleValueTagListener(TagListener parent, String tagName, String valueAttribute, String mappingAttribute) -
Method Summary
Modifier and TypeMethodDescriptionSuperclass method overridden to get characters from value attribute if such is specified.The tag name which this listener is bound to.abstract ObjectgetValue()Translation method.booleanisMapped()processEndElement(ObjectProcessor processor) To be overridden.Methods inherited from class de.hybris.bootstrap.xml.DefaultTagListener
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, startElement
-
Field Details
-
UNSPECIFIED_TYPE
- See Also:
-
-
Constructor Details
-
SimpleValueTagListener
- Parameters:
parent- the parent tag listenertagName- the tag name which this listener is bound to
-
SimpleValueTagListener
public SimpleValueTagListener(TagListener parent, String tagName, String valueAttribute, String mappingAttribute) - Parameters:
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)
-
-
Method Details
-
getTagName
The tag name which this listener is bound to. -
isMapped
public boolean isMapped()- Returns:
trueif a mapping attribute was specified
-
getValue
Translation method. Must be implemented by subclasses.- Throws:
ParseAbortException
-
getCharacters
Superclass method overridden to get characters from value attribute if such is specified.- Overrides:
getCharactersin classDefaultTagListener
-
processEndElement
Description copied from class:DefaultTagListenerTo be overridden.- Specified by:
processEndElementin classDefaultTagListener- Returns:
- Object
- Throws:
ParseAbortException
-