Class PropertyListSerialization

java.lang.Object
net.sf.antcontrib.cpptasks.apple.PropertyListSerialization

public final class PropertyListSerialization extends Object
Static class that provides methods to serialize a Map to a Cocoa XML Property List. Does not currently support date or data elements.
  • Constructor Details

    • PropertyListSerialization

      private PropertyListSerialization()
      Private constructor.
  • Method Details

    • serialize

      public static void serialize(Map propertyList, List comments, File file) throws IOException, SAXException, TransformerConfigurationException
      Serializes a property list into a Cocoa XML Property List document.
      Parameters:
      propertyList - property list.
      comments - comments to insert into document.
      file - destination.
      Throws:
      SAXException - if exception during serialization.
      TransformerConfigurationException - if exception creating serializer.
      IOException
    • serializeMap

      private static void serializeMap(Map map, ContentHandler handler) throws SAXException
      Serialize a map as a dict element.
      Parameters:
      map - map to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeList

      private static void serializeList(List list, ContentHandler handler) throws SAXException
      Serialize a list as an array element.
      Parameters:
      list - list to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeElement

      private static void serializeElement(String tag, String content, ContentHandler handler) throws SAXException
      Creates an element with the specified tag name and character content.
      Parameters:
      tag - tag name.
      content - character content.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeInteger

      private static void serializeInteger(Number integer, ContentHandler handler) throws SAXException
      Serialize a Number as an integer element.
      Parameters:
      integer - number to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeReal

      private static void serializeReal(Number real, ContentHandler handler) throws SAXException
      Serialize a Number as a real element.
      Parameters:
      real - number to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeBoolean

      private static void serializeBoolean(Boolean val, ContentHandler handler) throws SAXException
      Serialize a Boolean as a true or false element.
      Parameters:
      val - boolean to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeString

      private static void serializeString(String val, ContentHandler handler) throws SAXException
      Serialize a string as a string element.
      Parameters:
      val - string to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.
    • serializeObject

      private static void serializeObject(Object obj, ContentHandler handler) throws SAXException
      Serialize an object using the best available element.
      Parameters:
      obj - object to serialize.
      handler - destination of serialization events.
      Throws:
      SAXException - if exception during serialization.