Interface IXmlParsingContext

    • Method Detail

      • readModelInstanceValue

        @Nullable
        <T> T readModelInstanceValue​(@NonNull
                                     IBoundNamedModelInstance targetInstance,
                                     @NonNull
                                     Object parentObject,
                                     @NonNull
                                     StartElement start)
                              throws XMLStreamException,
                                     IOException
        Read the XML data associated with the targetInstance and apply it to the provided parentObject.
        Type Parameters:
        T - the resulting object type
        Parameters:
        targetInstance - the instance to parse data for
        parentObject - the Java object that data parsed by this method will be stored in
        start - the XML element start and attribute data previously parsed
        Returns:
        the Java object read, or null if no data was read
        Throws:
        IOException - if an error occurred while parsing the input
        XMLStreamException - if an error occurred while parsing XML events
      • readDefinitionValue

        @NonNull
        <T> T readDefinitionValue​(@NonNull
                                  IClassBinding targetDefinition,
                                  @Nullable
                                  Object parentObject,
                                  @NonNull
                                  StartElement start)
                           throws IOException,
                                  XMLStreamException
        Reads a XML element storing the associated data in a Java class instance, returning the resulting instance.

        When called the next XMLEvent of the XMLStreamReader2 is expected to be a XMLStreamConstants.START_ELEMENT that is the XML element associated with the Java class.

        After returning the next XMLEvent of the XMLStreamReader2 is expected to be a the next event after the XMLStreamConstants.END_ELEMENT for the XML XMLStreamConstants.START_ELEMENT element associated with the Java class.

        Type Parameters:
        T - the resulting object type
        Parameters:
        targetDefinition - the Module definition that describes the syntax of the data to read
        parentObject - the Java object parent of the target object, which can be null if there is no parent
        start - the XML element start and attribute data previously parsed
        Returns:
        the Java object containing the data parsed by this method
        Throws:
        IOException - if an error occurred while parsing the input
        XMLStreamException - if an error occurred while parsing XML events