Class ScrittoreJs

java.lang.Object
it.ovunque.serializza.xstream.ScrittoreJs
All Implemented Interfaces:
com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter, com.thoughtworks.xstream.io.HierarchicalStreamWriter, JsStreamWriter

public class ScrittoreJs extends Object implements JsStreamWriter
  • Constructor Details

    • ScrittoreJs

      public ScrittoreJs(Writer out)
      Parameters:
      out -
  • Method Details

    • collezioniConQuadre

      public static void collezioniConQuadre(boolean conQuadre)
    • addAttribute

      public void addAttribute(String nome, String valore)
      Specified by:
      addAttribute in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.addAttribute(java.lang.String, java.lang.String)
    • close

      public void close()
      Description copied from interface: com.thoughtworks.xstream.io.HierarchicalStreamWriter
      Close the writer, if necessary.
      Specified by:
      close in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.close()
    • flush

      public void flush()
      Description copied from interface: com.thoughtworks.xstream.io.HierarchicalStreamWriter
      Flush the writer, if necessary.
      Specified by:
      flush in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.flush()
    • startNode

      public void startNode(String nome, Class classe)
      Specified by:
      startNode in interface com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter
    • startNode

      public void startNode(String nome)
      Specified by:
      startNode in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.startNode(java.lang.String)
    • setValue

      public void setValue(String testo)
      Description copied from interface: com.thoughtworks.xstream.io.HierarchicalStreamWriter
      Write the value (text content) of the current node.
      Specified by:
      setValue in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.setValue(java.lang.String)
    • endNode

      public void endNode()
      Specified by:
      endNode in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.endNode()
    • underlyingWriter

      public com.thoughtworks.xstream.io.HierarchicalStreamWriter underlyingWriter()
      Description copied from interface: com.thoughtworks.xstream.io.HierarchicalStreamWriter
      Return the underlying HierarchicalStreamWriter implementation.

      If a Converter needs to access methods of a specific HierarchicalStreamWriter implementation that are not defined in the HierarchicalStreamWriter interface, it should call this method before casting. This is because the writer passed to the Converter is often wrapped/decorated by another implementation to provide additional functionality (such as XPath tracking).

      For example:

      MySpecificWriter mySpecificWriter = (MySpecificWriter)writer; // INCORRECT!
       mySpecificWriter.doSomethingSpecific();
      MySpecificWriter mySpecificWriter = (MySpecificWriter)writer.underlyingWriter();  // CORRECT!
       mySpecificWriter.doSomethingSpecific();

      Implementations of HierarchicalStreamWriter should return 'this', unless they are a decorator, in which case they should delegate to whatever they are wrapping.

      Specified by:
      underlyingWriter in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
      See Also:
      • HierarchicalStreamWriter.underlyingWriter()
    • getResultAsMap

      public Map<String,?> getResultAsMap()
      Specified by:
      getResultAsMap in interface JsStreamWriter