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> TreadDefinitionValue(IClassBinding targetDefinition, Object parentObject, StartElement start)Reads a XML element storing the associated data in a Java class instance, returning the resulting instance.<T> TreadModelInstanceValue(IBoundNamedModelInstance targetInstance, Object parentObject, StartElement start)Read the XML data associated with thetargetInstanceand 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 thetargetInstanceand 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
nullif 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
XMLEventof theXMLStreamReader2is expected to be aXMLStreamConstants.START_ELEMENTthat is the XML element associated with the Java class.After returning the next
XMLEventof theXMLStreamReader2is expected to be a the next event after theXMLStreamConstants.END_ELEMENTfor the XMLXMLStreamConstants.START_ELEMENTelement 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 benullif 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
-
-