Class PropertyTagHandler


@Deprecated public class PropertyTagHandler extends PropertyTagHandlerBase.MapHandler
Deprecated.
Tag handler for "property" tags with a key and a value attribute.

See https://wiki.tocco.ch/wiki/index.php/Nice2-xml-reader

This handler can be used as generic handler, an example is the ext-props tag with the child tag type <property name="" value=""/>, so whenever you need such property tags under another element then return this handler in the parent tag, see AbstractComponentHandler.addExtProps() for how to initiate it.


This handler can handle nested properties that may occur as lists or maps. Example:

 <properties>
  <property name="k1" value="v1"/>
  <property name="k2" value="v2"/>
  <list name="k3">
     <value>123</value>
     <value>456</value>
     <map>
       <property name="k3.k1" value="v311"/>
       <property name="k3.k2" value="v312"/>
     </map>
     <list>
       <value>ert</value>
       <value>zui</value>
     </list>
  </list>
  <map name="k4">
    <property name="k4.k1" value="v41"/>
    <property name="k4.k2" value="v42"/>
    <list name="k4.k3">
      <value>vbn</value>
      <value>jkl</value>
    </list>
    <map name="k4.k4">
      <property name="k4k4.k1" value="v441"/>
      <property name="k4k4.k2" value="v442"/>
    </map>
  </map>
 </properties>
 

The <property> tag is only allowed within the <map> (resp. <properties>) tag, while the <value> tag is only allowed within the <list> tag. Any tag within <map> (resp. <properties>) must have the @name attribute specified, otherwise it cannot be added to the parent map!

The map will only contain values of type String, list of String or another map of this type.

  • Constructor Details

    • PropertyTagHandler

      public PropertyTagHandler()
      Deprecated.
      Creates this handler with an empty map to collect the properties. This map can be obtained using getMapping().
    • PropertyTagHandler

      public PropertyTagHandler(Map<String,Object> properties)
      Deprecated.
      Creates this handler that will collect any properties into the specified map.

      The values of this map are either, Strings, a list of Strings or another such map.

  • Method Details

    • getMapping

      public Map<String,Object> getMapping()
      Deprecated.
      Returns the mapping that this handler gathered from xml.