Class ProjectConverter

  • All Implemented Interfaces:
    com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher

    public class ProjectConverter
    extends java.lang.Object
    implements com.thoughtworks.xstream.converters.Converter
    Converter for Project within VIL or VTL files.
    Author:
    Sass
    • Constructor Summary

      Constructors 
      Constructor Description
      ProjectConverter()
      Creates a singleton type converter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canConvert​(java.lang.Class cls)
      Determines whether this converter instance handles the given class.
      void marshal​(java.lang.Object object, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
      Marshals a given object to the given writer in the specified marshaling context.
      java.lang.Object unmarshal​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
      Unmarshals the current object to be read from the given reader in the specified unmarshaling context.
      • Methods inherited from class java.lang.Object

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

      • ProjectConverter

        public ProjectConverter()
        Creates a singleton type converter.
    • Method Detail

      • canConvert

        public boolean canConvert​(java.lang.Class cls)
        Determines whether this converter instance handles the given class.
        Specified by:
        canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
        Parameters:
        cls - the class to be tested
        Returns:
        true if this instance handles class (this is only the case if it is a Project class), false else
      • marshal

        public void marshal​(java.lang.Object object,
                            com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                            com.thoughtworks.xstream.converters.MarshallingContext context)
        Marshals a given object to the given writer in the specified marshaling context. This method translates a Project type singleton to a name.
        Specified by:
        marshal in interface com.thoughtworks.xstream.converters.Converter
        Parameters:
        object - the object to be marshaled
        writer - the output stream writer
        context - the marshaling context
      • unmarshal

        public java.lang.Object unmarshal​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Unmarshals the current object to be read from the given reader in the specified unmarshaling context. This method translates the name back to the singleton instance.
        Specified by:
        unmarshal in interface com.thoughtworks.xstream.converters.Converter
        Parameters:
        reader - the input stream writer
        context - the marshaling context
        Returns:
        the unmarshaled object