Class MetaschemaXmlWriter

    • Constructor Detail

      • MetaschemaXmlWriter

        public MetaschemaXmlWriter​(@NonNull
                                   org.codehaus.stax2.XMLStreamWriter2 writer)
        Construct a new Module-aware JSON writer.
        Parameters:
        writer - the XML stream writer to write with
        See Also:
        DefaultJsonProblemHandler
    • Method Detail

      • getWriter

        public org.codehaus.stax2.XMLStreamWriter2 getWriter()
        Description copied from interface: IWritingContext
        Get the writer associated with the writing context.
        Specified by:
        getWriter in interface IWritingContext<org.codehaus.stax2.XMLStreamWriter2>
        Returns:
        the writer
      • writeDefinitionValue

        public void writeDefinitionValue​(@NonNull
                                         IClassBinding targetDefinition,
                                         @NonNull
                                         Object targetObject,
                                         @NonNull
                                         QName parentName)
                                  throws IOException
        Description copied from interface: IXmlWritingContext
        Write the data described by the provided targetDefinition as an XML element.
        Specified by:
        writeDefinitionValue in interface IXmlWritingContext
        Parameters:
        targetDefinition - the bound Module definition describing the structure of the XML data to write
        targetObject - the Java object data to write
        parentName - the qualified name of the XML element to write
        Throws:
        IOException - if an error occurred while writing the XML
      • writeFlagInstance

        protected void writeFlagInstance​(@NonNull
                                         IBoundFlagInstance targetInstance,
                                         @NonNull
                                         Object parentObject)
                                  throws IOException
        Write the data described by the provided targetInstance as an XML attribute.
        Parameters:
        targetInstance - the model instance that describes the syntax of the data to write
        parentObject - the Java object that data written by this method is stored in
        Throws:
        IOException - if an error occurred while writing the XML
      • writeModelInstanceValues

        protected boolean writeModelInstanceValues​(@NonNull
                                                   IBoundNamedModelInstance targetInstance,
                                                   @NonNull
                                                   Object parentObject,
                                                   @NonNull
                                                   QName parentName)
                                            throws IOException
        Write the data described by the provided targetInstance as an XML element.
        Parameters:
        targetInstance - the model instance that describes the syntax of the data to write
        parentObject - the Java object that data written by this method is stored in
        parentName - the qualified name of the XML data's parent element
        Returns:
        true id the value was written or false otherwise
        Throws:
        IOException - if an error occurred while writing the XML
      • writeInstanceValue

        public void writeInstanceValue​(@NonNull
                                       IBoundNamedModelInstance targetInstance,
                                       @NonNull
                                       Object targetObject,
                                       @NonNull
                                       QName parentName)
                                throws IOException
        Description copied from interface: IXmlWritingContext
        Write the data described by the provided targetDefinition as an XML element.
        Specified by:
        writeInstanceValue in interface IXmlWritingContext
        Parameters:
        targetInstance - the model instance that describes the syntax of the data to write
        targetObject - the Java object data to write
        parentName - the qualified name of the XML element to write
        Throws:
        IOException - if an error occurred while writing the XML