Class AbstractConverter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.thoughtworks.xstream.mapper.Mapper mapper
      The mapper
      static java.lang.String NULL
      Element name for "null" elements
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, int value)
      Add an integer attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, int[] value)
      Add a int[] attribute to the current node as a string of comma separated integers.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, int[] value, int count)
      Add a int[] attribute to the current node as a string of comma separated integers.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, long value)
      Add a long attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.Boolean value)
      Add the string representation of a value as an attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.Class<?> value)
      Add an Enum Attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.Integer value)
      Add the string representation of a value as an attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.Object value)
      Add the string representation of a value as an attribute to the current node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.String value)
      Add a String Attribute to the current Node (handling nulls).
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.lang.String[] value)
      Add a String[] attribute to the current node as a string of comma separated strings.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.util.Date value)
      Add a Date Attribute to the current Node.
      static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, java.lang.String attribute, java.util.Locale value)
      Add a Locale Attribute to the current Node.
      static java.lang.String getAlias​(java.lang.Class<?> type, com.thoughtworks.xstream.mapper.Mapper mapper)
      Get the serialized alias for type.
      static java.lang.String getAlias​(java.lang.Object value, com.thoughtworks.xstream.mapper.Mapper mapper)
      Get the serialized alias for value's class.
      static boolean getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, boolean defaultValue)
      Get a boolean attribute.
      static double getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, double defaultValue)
      Get a double attribute.
      static float getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, float defaultValue)
      Get a floating point attribute.
      static int getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, int defaultValue)
      Get an int attribute.
      static int[] getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, int[] defaultValue)
      Get an integer array, represented as a comma separated string of integers.
      static long getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, long defaultValue)
      Get a long attribute.
      static java.lang.Boolean getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.Boolean defaultValue)
      Get a boolean attribute.
      static java.lang.Class<?> getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.Class<?> defaultValue)
      Get an attribute that defines a class.
      static java.lang.String getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.Enum<?> defaultValue)
      Get a Enum attribute as a string (which can be passed to enums valueOf or fromExternal).
      static java.lang.Integer getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.Integer defaultValue)
      Get an Integer attribute.
      static java.lang.String getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.String defaultValue)
      Get a String attribute.
      static java.lang.String[] getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.lang.String[] defaultValue)
      Get a string array, represented as a comma separated array of strings.
      static java.util.Date getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.util.Date defaultValue)
      Add a Date Attribute to the current Node.
      static java.util.Locale getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, java.lang.String attribute, java.util.Locale defaultValue)
      Get a Locale Attribute from the current node.
      static java.lang.Class<?> getClass​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.mapper.Mapper mapper)
      Lookup the class to for the current node.
      static java.lang.Class<?> getClass​(com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.String alias)
      Lookup the class for an alias.
      static java.lang.String getClassName​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
      Get the class name (or alias) for the current node.
      static <T> void marshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.String name, T[] array)
      Marshals an array of objects of type T with its size as an attribute.
      static <T> void marshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.String name, T[] array, int start, int count)
      Marshals an array of objects of type T with its size as an attribute.
      static <T> void marshalArray2D​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.String parentName, java.lang.String childName, T[][] array, int start, int count)
      Marshal a 2D Array of type T.
      static void marshalIntArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String name, int[] array)
      Marshals an int array with its size as an attribute and the elements as comma delimited strings.
      static void marshalIntArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String name, int[] array, int start, int count)
      Marshals an int array with its size as an attribute and the elements as comma delimited strings.
      static <T> void marshalList​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.String name, java.util.List<T> list)
      Marshals a list of objects of type T with its size as an attribute.
      void marshalNode​(java.lang.Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
      Marshal an object.
      static void marshalNode​(java.lang.Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper)
      Marshal an object.
      void marshalProperties​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String node, java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iter)
      Marshal a map of properties.
      void marshalProperties​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String node, java.util.Map<java.lang.String,​java.lang.Object> properties)  
      static java.util.List<java.lang.String> readList​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
      Reads a list
      static <T> T readSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, java.lang.Object current, java.lang.Class<T> clazz)
      Reads a sub-object
      java.lang.Throwable readThrowable​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, java.lang.Object current)
      Returns a throwable that was written with writeThrowable.
      void setMapper​(com.thoughtworks.xstream.mapper.Mapper m)  
      static <T> T[] unmarshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.Class<T> type)
      Unmarshals an array of object type T that has been marshaled by marshalArray(HierarchicalStreamWriter, MarshallingContext, Mapper, String, Object[])
      static <T> T[][] unmarshalArray2D​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.Class<T> type, T[][] array)
      static int[] unmarshalIntArray​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
      static <T> java.util.List<T> unmarshalList​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.Class<T> type)
      Unmarshals a list of object type T that has been marshaled by marshalList(HierarchicalStreamWriter, MarshallingContext, Mapper, String, List)
      static <T> T unmarshalNode​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.Class<T> type)
      Use convertAnother to unmarshal an object properly.
      <T> T unmarshalNode​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, java.lang.Class<T> type)
      Use convertAnother to unmarshal an object properly.
      static <T> T unmarshalNode​(java.lang.Object current, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, com.thoughtworks.xstream.mapper.Mapper mapper, java.lang.Class<T> type)
      Use convertAnother to unmarshal an object properly.
      <T> T unmarshalNode​(java.lang.Object current, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, java.lang.Class<T> type)
      Use convertAnother to unmarshal an object properly.
      void unmarshalProperties​(java.util.Map<java.lang.String,​java.lang.Object> properties, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
      Unmarshal a map of properties.
      void unmarshalProperty​(java.util.Map<java.lang.String,​java.lang.Object> properties, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
      Unmarshals a single property from reader, placing is name/value in properties
      java.lang.String unmarshalPropertyName​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader)  
      java.lang.Object unmarshalPropertyValue​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)  
      static void writeSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.Object value)
      Writes a sub-object
      void writeSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String name, java.lang.Object value)
      Writes a sub-object.
      void writeThrowable​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, java.lang.String name, java.lang.Throwable value)
      Writes a throwable with element name name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.thoughtworks.xstream.converters.Converter

        marshal, unmarshal
      • Methods inherited from interface com.thoughtworks.xstream.converters.ConverterMatcher

        canConvert
    • Field Detail

      • NULL

        public static final java.lang.String NULL
        Element name for "null" elements
        See Also:
        Constant Field Values
      • mapper

        protected com.thoughtworks.xstream.mapper.Mapper mapper
        The mapper
    • Constructor Detail

      • AbstractConverter

        public AbstractConverter()
    • Method Detail

      • setMapper

        public void setMapper​(com.thoughtworks.xstream.mapper.Mapper m)
      • marshalProperties

        public void marshalProperties​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                      com.thoughtworks.xstream.converters.MarshallingContext context,
                                      java.lang.String node,
                                      java.util.Map<java.lang.String,​java.lang.Object> properties)
      • marshalProperties

        public void marshalProperties​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                      com.thoughtworks.xstream.converters.MarshallingContext context,
                                      java.lang.String node,
                                      java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iter)
        Marshal a map of properties.

        NOTE: the containing "node" is not marshalled with this method, you should do so yourself.

      • unmarshalProperties

        public void unmarshalProperties​(java.util.Map<java.lang.String,​java.lang.Object> properties,
                                        com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                        com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Unmarshal a map of properties.
      • unmarshalPropertyName

        public java.lang.String unmarshalPropertyName​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
      • unmarshalPropertyValue

        public java.lang.Object unmarshalPropertyValue​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                       com.thoughtworks.xstream.converters.UnmarshallingContext context)
      • unmarshalProperty

        public void unmarshalProperty​(java.util.Map<java.lang.String,​java.lang.Object> properties,
                                      com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                      com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Unmarshals a single property from reader, placing is name/value in properties
      • marshalNode

        public static void marshalNode​(java.lang.Object value,
                                       com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                       com.thoughtworks.xstream.converters.MarshallingContext context,
                                       com.thoughtworks.xstream.mapper.Mapper mapper)
        Marshal an object.
      • marshalNode

        public void marshalNode​(java.lang.Object value,
                                com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                com.thoughtworks.xstream.converters.MarshallingContext context)
        Marshal an object.
      • unmarshalNode

        public <T> T unmarshalNode​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                   com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                   java.lang.Class<T> type)
        Use convertAnother to unmarshal an object properly.
      • unmarshalNode

        public <T> T unmarshalNode​(java.lang.Object current,
                                   com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                   com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                   java.lang.Class<T> type)
        Use convertAnother to unmarshal an object properly.
      • unmarshalNode

        public static <T> T unmarshalNode​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                          com.thoughtworks.xstream.mapper.Mapper mapper,
                                          java.lang.Class<T> type)
        Use convertAnother to unmarshal an object properly.
      • unmarshalNode

        public static <T> T unmarshalNode​(java.lang.Object current,
                                          com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                          com.thoughtworks.xstream.mapper.Mapper mapper,
                                          java.lang.Class<T> type)
        Use convertAnother to unmarshal an object properly.
      • marshalIntArray

        public static void marshalIntArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                           com.thoughtworks.xstream.converters.MarshallingContext context,
                                           java.lang.String name,
                                           int[] array)
        Marshals an int array with its size as an attribute and the elements as comma delimited strings.
      • marshalIntArray

        public static void marshalIntArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                           com.thoughtworks.xstream.converters.MarshallingContext context,
                                           java.lang.String name,
                                           int[] array,
                                           int start,
                                           int count)
        Marshals an int array with its size as an attribute and the elements as comma delimited strings.
      • marshalArray

        public static <T> void marshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                            com.thoughtworks.xstream.converters.MarshallingContext context,
                                            com.thoughtworks.xstream.mapper.Mapper mapper,
                                            java.lang.String name,
                                            T[] array)
        Marshals an array of objects of type T with its size as an attribute.
      • marshalArray

        public static <T> void marshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                            com.thoughtworks.xstream.converters.MarshallingContext context,
                                            com.thoughtworks.xstream.mapper.Mapper mapper,
                                            java.lang.String name,
                                            T[] array,
                                            int start,
                                            int count)
        Marshals an array of objects of type T with its size as an attribute.
      • unmarshalArray

        public static <T> T[] unmarshalArray​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                             com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                             com.thoughtworks.xstream.mapper.Mapper mapper,
                                             java.lang.Class<T> type)
        Unmarshals an array of object type T that has been marshaled by marshalArray(HierarchicalStreamWriter, MarshallingContext, Mapper, String, Object[])
        Returns:
        the object array
      • marshalArray2D

        public static <T> void marshalArray2D​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                              com.thoughtworks.xstream.converters.MarshallingContext context,
                                              com.thoughtworks.xstream.mapper.Mapper mapper,
                                              java.lang.String parentName,
                                              java.lang.String childName,
                                              T[][] array,
                                              int start,
                                              int count)
        Marshal a 2D Array of type T.
      • marshalList

        public static <T> void marshalList​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                           com.thoughtworks.xstream.converters.MarshallingContext context,
                                           com.thoughtworks.xstream.mapper.Mapper mapper,
                                           java.lang.String name,
                                           java.util.List<T> list)
        Marshals a list of objects of type T with its size as an attribute.
      • unmarshalList

        public static <T> java.util.List<T> unmarshalList​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                          com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                                          com.thoughtworks.xstream.mapper.Mapper mapper,
                                                          java.lang.Class<T> type)
        Unmarshals a list of object type T that has been marshaled by marshalList(HierarchicalStreamWriter, MarshallingContext, Mapper, String, List)
      • writeThrowable

        public void writeThrowable​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                   com.thoughtworks.xstream.converters.MarshallingContext context,
                                   java.lang.String name,
                                   java.lang.Throwable value)
        Writes a throwable with element name name. The class of the throwable is written as an attribute.
      • readThrowable

        public java.lang.Throwable readThrowable​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                 com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                                 java.lang.Object current)
        Returns a throwable that was written with writeThrowable.
      • writeSubObject

        public void writeSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                   com.thoughtworks.xstream.converters.MarshallingContext context,
                                   java.lang.String name,
                                   java.lang.Object value)
        Writes a sub-object.
      • writeSubObject

        public static void writeSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                          com.thoughtworks.xstream.converters.MarshallingContext context,
                                          java.lang.Object value)
        Writes a sub-object
      • readSubObject

        public static <T> T readSubObject​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          com.thoughtworks.xstream.converters.UnmarshallingContext context,
                                          java.lang.Object current,
                                          java.lang.Class<T> clazz)
        Reads a sub-object
      • readList

        public static java.util.List<java.lang.String> readList​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                                com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Reads a list
      • getAlias

        public static java.lang.String getAlias​(java.lang.Object value,
                                                com.thoughtworks.xstream.mapper.Mapper mapper)
        Get the serialized alias for value's class.
      • getAlias

        public static java.lang.String getAlias​(java.lang.Class<?> type,
                                                com.thoughtworks.xstream.mapper.Mapper mapper)
        Get the serialized alias for type.
      • getClass

        public static java.lang.Class<?> getClass​(com.thoughtworks.xstream.mapper.Mapper mapper,
                                                  java.lang.String alias)
        Lookup the class for an alias.
      • getClass

        public static java.lang.Class<?> getClass​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                  com.thoughtworks.xstream.mapper.Mapper mapper)
        Lookup the class to for the current node.
      • getClassName

        public static java.lang.String getClassName​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
        Get the class name (or alias) for the current node.
      • getAttribute

        public static java.lang.String getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                    java.lang.String attribute,
                                                    java.lang.String defaultValue)
        Get a String attribute.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.Object value)
        Add the string representation of a value as an attribute to the current node.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.Boolean value)
        Add the string representation of a value as an attribute to the current node.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.Integer value)
        Add the string representation of a value as an attribute to the current node.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.String value)
        Add a String Attribute to the current Node (handling nulls).
      • getAttribute

        public static java.lang.String getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                    java.lang.String attribute,
                                                    java.lang.Enum<?> defaultValue)
        Get a Enum attribute as a string (which can be passed to enums valueOf or fromExternal).
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.Class<?> value)
        Add an Enum Attribute to the current node.
      • getAttribute

        public static java.lang.Class<?> getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                      java.lang.String attribute,
                                                      java.lang.Class<?> defaultValue)
        Get an attribute that defines a class.
      • getAttribute

        public static boolean getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                           java.lang.String attribute,
                                           boolean defaultValue)
        Get a boolean attribute.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        long value)
        Add a long attribute to the current node.
      • getAttribute

        public static long getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                        java.lang.String attribute,
                                        long defaultValue)
        Get a long attribute.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        int value)
        Add an integer attribute to the current node.
      • getAttribute

        public static int getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                       java.lang.String attribute,
                                       int defaultValue)
        Get an int attribute.
      • getAttribute

        public static java.lang.Integer getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                     java.lang.String attribute,
                                                     java.lang.Integer defaultValue)
        Get an Integer attribute.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        int[] value)
        Add a int[] attribute to the current node as a string of comma separated integers.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        int[] value,
                                        int count)
        Add a int[] attribute to the current node as a string of comma separated integers.
      • getAttribute

        public static int[] getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                         java.lang.String attribute,
                                         int[] defaultValue)
        Get an integer array, represented as a comma separated string of integers.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.lang.String[] value)
        Add a String[] attribute to the current node as a string of comma separated strings.
      • getAttribute

        public static java.lang.String[] getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                      java.lang.String attribute,
                                                      java.lang.String[] defaultValue)
        Get a string array, represented as a comma separated array of strings.
      • getAttribute

        public static java.lang.Boolean getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                     java.lang.String attribute,
                                                     java.lang.Boolean defaultValue)
        Get a boolean attribute.
      • getAttribute

        public static float getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                         java.lang.String attribute,
                                         float defaultValue)
        Get a floating point attribute.
      • getAttribute

        public static double getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          java.lang.String attribute,
                                          double defaultValue)
        Get a double attribute.
      • getAttribute

        public static java.util.Date getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                  java.lang.String attribute,
                                                  java.util.Date defaultValue)
        Add a Date Attribute to the current Node.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.util.Date value)
        Add a Date Attribute to the current Node.
      • getAttribute

        public static java.util.Locale getAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                                    java.lang.String attribute,
                                                    java.util.Locale defaultValue)
        Get a Locale Attribute from the current node.
      • addAttribute

        public static void addAttribute​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                        java.lang.String attribute,
                                        java.util.Locale value)
        Add a Locale Attribute to the current Node.