Interface IXmlParsingContext
-
- All Superinterfaces:
IParsingContext<org.codehaus.stax2.XMLEventReader2,IXmlProblemHandler>
- All Known Implementing Classes:
MetaschemaXmlReader
public interface IXmlParsingContext extends IParsingContext<org.codehaus.stax2.XMLEventReader2,IXmlProblemHandler>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
readDefinitionValue(IClassBinding targetDefinition, Object parentObject, StartElement start)
Reads a XML element storing the associated data in a Java class instance, returning the resulting instance.<T> T
readModelInstanceValue(IBoundNamedModelInstance targetInstance, Object parentObject, StartElement start)
Read the XML data associated with thetargetInstance
and apply it to the providedparentObject
.-
Methods inherited from interface gov.nist.secauto.metaschema.databind.io.IParsingContext
getProblemHandler, getReader
-
-
-
-
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 thetargetInstance
and apply it to the providedparentObject
.- Type Parameters:
T
- the resulting object type- Parameters:
targetInstance
- the instance to parse data forparentObject
- the Java object that data parsed by this method will be stored instart
- 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 inputXMLStreamException
- 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 theXMLStreamReader2
is expected to be aXMLStreamConstants.START_ELEMENT
that is the XML element associated with the Java class.After returning the next
XMLEvent
of theXMLStreamReader2
is expected to be a the next event after theXMLStreamConstants.END_ELEMENT
for the XMLXMLStreamConstants.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 readparentObject
- the Java object parent of the target object, which can benull
if there is no parentstart
- 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 inputXMLStreamException
- if an error occurred while parsing XML events
-
-