Class SimpleValueTagListener

  • All Implemented Interfaces:
    TagListener
    Direct Known Subclasses:
    BooleanValueTagListener, ClassValueTagListener, DateTagListener, DoubleValueTagListener, IntegerValueTagListener, StringValueTagListener

    public abstract class SimpleValueTagListener
    extends DefaultTagListener
    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 Detail

      • UNSPECIFIED_TYPE

        public static final java.lang.String UNSPECIFIED_TYPE
        See Also:
        Constant Field Values
    • Constructor Detail

      • SimpleValueTagListener

        public SimpleValueTagListener​(TagListener parent,
                                      java.lang.String tagName)
        Parameters:
        parent - the parent tag listener
        tagName - the tag name which this listener is bound to
      • SimpleValueTagListener

        public SimpleValueTagListener​(TagListener parent,
                                      java.lang.String tagName,
                                      java.lang.String valueAttribute,
                                      java.lang.String mappingAttribute)
        Parameters:
        parent - the parent tag listener
        tagName - the tag name this listener is bound to
        valueAttribute - the xml attribute which contains the value to translate (optional)
        mappingAttribute - the xml attribute name which contains the key for the translated value (optional)