Class SchemaWriter


  • public class SchemaWriter
    extends java.lang.Object
    A class for serializing Schema models.
    Version:
    $Revision: 8687 $ $Date: 2006-04-05 13:16:42 -0600 (Wed, 05 Apr 2006) $
    Author:
    Keith Visco
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean enable
      Deprecated. 
    • Constructor Summary

      Constructors 
      Constructor Description
      SchemaWriter()
      A constructor to create an empty uninitialized SchemaWriter via XMLContext.
      SchemaWriter​(java.io.Writer writer)
      Creates a new SchemaWriter for the given Writer.
      SchemaWriter​(org.xml.sax.DocumentHandler handler)
      Creates a new SchemaWriter for the given DocumentHandler.
    • Field Detail

      • enable

        public static boolean enable
        Deprecated.
        This field is no longer used and only here for backward compatibility.
    • Constructor Detail

      • SchemaWriter

        public SchemaWriter​(java.io.Writer writer)
                     throws java.io.IOException
        Creates a new SchemaWriter for the given Writer.
        Parameters:
        writer - the Writer to serialize to
        Throws:
        java.io.IOException - in case taht wrapping the Writer fails
      • SchemaWriter

        public SchemaWriter​(org.xml.sax.DocumentHandler handler)
        Creates a new SchemaWriter for the given DocumentHandler.
        Parameters:
        handler - the DocumentHandler to send events to
      • SchemaWriter

        public SchemaWriter()
        A constructor to create an empty uninitialized SchemaWriter via XMLContext.
    • Method Detail

      • setDocumentHandler

        public void setDocumentHandler​(java.io.Writer writer)
                                throws java.io.IOException
        To set the DocumentHandler to a Writer - which is wrapped by a serializer.
        Parameters:
        writer - the Writer to use for output
        Throws:
        java.io.IOException - in case the Writer cannot be used for DocumentHandler
      • setDocumentHandler

        public void setDocumentHandler​(org.xml.sax.DocumentHandler documentHandler)
        To directly set a DocumentHandler.
        Parameters:
        documentHandler - set the DocumentHandler
      • write

        public void write​(Schema schema)
                   throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException