Class JobXMLUtil


  • public class JobXMLUtil
    extends java.lang.Object
    Utility methods and data for use by Job XML XMAP de/serialization
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_PREFIX
      Prefix for map keys which will be converted to xml attributes
      static java.lang.String CDATA_SUFFIX
      Suffix for map key of string values, to output the content as CDATA section
      static java.lang.String DATAVALUE_SUFFIX
      Suffix for map key of map value, to output value map in "generic data" structure, allowing automatic reversal
      static java.lang.String PLURAL_REPL  
      static java.lang.String PLURAL_SUFFIX
      suffix for map keys of Collection values, to convert a collection to a plural/single* element set
      static java.lang.String TEXT_KEY
      map key for text value to output the value as element text, must be the only non-attribute map entry on output.
    • Constructor Summary

      Constructors 
      Constructor Description
      JobXMLUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addAttribute​(java.util.Map map, java.lang.String key, java.lang.Object val)
      Add entry to the map for the given key, converting the key into an attribute key identifier
      static java.lang.String asAttributeName​(java.lang.String key)
      Return the key as an attribute key identifier
      static java.lang.String asCDATAName​(java.lang.String key)
      Return the key name for use as a CDATA section
      static java.lang.String asDataValueKey​(java.lang.String key)
      Return the key name for use as generic data structure
      static void makeAttribute​(java.util.Map map, java.lang.String key)
      Replace the key in the map with the attribute key identifier, if the map entry exists and is not null
      static java.util.Map makePlural​(java.util.Map map, java.lang.String key)
      change the key for the map entry to the pluralized key form
      static java.lang.String pluralize​(java.lang.String key)
      Return the pluralized key form of the key
      static java.util.Map toAttrMap​(java.lang.String key, java.lang.Object val)
      Return a Map with an attribute key identifier created from the given key, and the given value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ATTR_PREFIX

        public static final java.lang.String ATTR_PREFIX
        Prefix for map keys which will be converted to xml attributes
        See Also:
        Constant Field Values
      • PLURAL_SUFFIX

        public static final java.lang.String PLURAL_SUFFIX
        suffix for map keys of Collection values, to convert a collection to a plural/single* element set
        See Also:
        Constant Field Values
      • CDATA_SUFFIX

        public static final java.lang.String CDATA_SUFFIX
        Suffix for map key of string values, to output the content as CDATA section
        See Also:
        Constant Field Values
      • DATAVALUE_SUFFIX

        public static final java.lang.String DATAVALUE_SUFFIX
        Suffix for map key of map value, to output value map in "generic data" structure, allowing automatic reversal
        See Also:
        Constant Field Values
      • TEXT_KEY

        public static final java.lang.String TEXT_KEY
        map key for text value to output the value as element text, must be the only non-attribute map entry on output.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JobXMLUtil

        public JobXMLUtil()
    • Method Detail

      • addAttribute

        public static void addAttribute​(java.util.Map map,
                                        java.lang.String key,
                                        java.lang.Object val)
        Add entry to the map for the given key, converting the key into an attribute key identifier
      • asAttributeName

        public static java.lang.String asAttributeName​(java.lang.String key)
        Return the key as an attribute key identifier
      • makeAttribute

        public static void makeAttribute​(java.util.Map map,
                                         java.lang.String key)
        Replace the key in the map with the attribute key identifier, if the map entry exists and is not null
      • toAttrMap

        public static java.util.Map toAttrMap​(java.lang.String key,
                                              java.lang.Object val)
        Return a Map with an attribute key identifier created from the given key, and the given value
      • pluralize

        public static java.lang.String pluralize​(java.lang.String key)
        Return the pluralized key form of the key
      • makePlural

        public static java.util.Map makePlural​(java.util.Map map,
                                               java.lang.String key)
        change the key for the map entry to the pluralized key form
      • asCDATAName

        public static java.lang.String asCDATAName​(java.lang.String key)
        Return the key name for use as a CDATA section
      • asDataValueKey

        public static java.lang.String asDataValueKey​(java.lang.String key)
        Return the key name for use as generic data structure