Package org.apache.uima.util.impl
Class XMLParser_impl
- java.lang.Object
-
- org.apache.uima.util.impl.XMLParser_impl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
XMLParser_impl.ParseErrorHandler
Error handler for XML parsing.-
Nested classes/interfaces inherited from interface org.apache.uima.util.XMLParser
XMLParser.ParsingOptions
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Class<XMLParser_impl>
CLASS_NAME
current classprotected static XMLParser.ParsingOptions
DEFAULT_PARSING_OPTIONS
private static java.lang.String
LOG_RESOURCE_BUNDLE
resource bundle for log messagesprotected java.util.Map<java.lang.String,java.lang.Class<? extends XMLizable>>
mElementToClassMap
Map from XML element names to Class objects.protected boolean
mSchemaValidationEnabled
Whether schema validation is enabled.private static java.net.URL
SCHEMA_URL
The URL to the Resource Specifier XML Schema file-
Fields inherited from interface org.apache.uima.util.XMLParser
RESOURCE_SPECIFIER_NAMESPACE, RESOURCE_SPECIFIER_SCHEMA_NAME
-
-
Constructor Summary
Constructors Constructor Description XMLParser_impl()
Creates a new XMLParser_impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMapping(java.lang.String aElementName, java.lang.String aClassName)
Configures this XMLParser by registering a mapping between the name of an XML element and the Class of object to be built from elements with that name.XMLizable
buildObject(org.w3c.dom.Element aElement)
Builds an object from its XML DOM representation.XMLizable
buildObject(org.w3c.dom.Element aElement, XMLParser.ParsingOptions aOptions)
Builds an object from its XML DOM representation.java.lang.Object
buildObjectOrPrimitive(org.w3c.dom.Element aElement, XMLParser.ParsingOptions aOptions)
Builds an object from its XML DOM representation.private void
callBuildFromXMLElement(org.w3c.dom.Element aElement, XMLizable object, XMLParser.ParsingOptions aOptions)
void
enableSchemaValidation(boolean aEnable)
Enables or disables XML schema validation.SaxDeserializer
newSaxDeserializer()
Creates a newSaxDeserializer
object, which implements the SAXContentHandler
interface and can be used to deserialize anXMLizable
object from the events sent from a SAX parser.SaxDeserializer
newSaxDeserializer(XMLParser.ParsingOptions aOptions)
Creates a newSaxDeserializer
.XMLizable
parse(XMLInputSource aInput)
Parses an XML input stream and produces an object.XMLizable
parse(XMLInputSource aInput, java.lang.String aNamespaceForSchema, java.net.URL aSchemaUrl)
Parses an XML input stream and produces an object.XMLizable
parse(XMLInputSource aInput, java.lang.String aNamespaceForSchema, java.net.URL aSchemaUrl, XMLParser.ParsingOptions aOptions)
Parses an XML input stream and produces an object.XMLizable
parse(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses an XML input stream and produces an object.AnalysisEngineDescription
parseAnalysisEngineDescription(XMLInputSource aInput)
Parses a AnalysisEngineDescription from an XML input stream.AnalysisEngineDescription
parseAnalysisEngineDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a AnalysisEngineDescription from an XML input stream.CasConsumerDescription
parseCasConsumerDescription(XMLInputSource aInput)
Parses a CasConsumerDescription from an XML input stream.CasConsumerDescription
parseCasConsumerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a CasConsumerDescription from an XML input stream.CasInitializerDescription
parseCasInitializerDescription(XMLInputSource aInput)
Deprecated.CasInitializerDescription
parseCasInitializerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Deprecated.CollectionReaderDescription
parseCollectionReaderDescription(XMLInputSource aInput)
Parses a CollectionReaderDescription from an XML input stream.CollectionReaderDescription
parseCollectionReaderDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a CollectionReaderDescription from an XML input stream.CpeDescription
parseCpeDescription(XMLInputSource aInput)
Parses a CpeDescription from an XML input stream.CustomResourceSpecifier
parseCustomResourceSpecifier(XMLInputSource aInput)
Parses a CustomResourceSpecifier from an XML input stream.CustomResourceSpecifier
parseCustomResourceSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a CustomResourceSpecifier from an XML input stream.FlowControllerDescription
parseFlowControllerDescription(XMLInputSource aInput)
Parses a FlowControllerDescription from an XML input stream.FlowControllerDescription
parseFlowControllerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a FlowControllerDescription from an XML input stream.FsIndexCollection
parseFsIndexCollection(XMLInputSource aInput)
Parses a FsIndexCollection from an XML input stream.FsIndexCollection
parseFsIndexCollection(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a FsIndexCollection from an XML input stream.IndexBuildSpecification
parseIndexBuildSpecification(XMLInputSource aInput)
Parses an IndexBuildSpecification from an XML input stream.IndexBuildSpecification
parseIndexBuildSpecification(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses an IndexBuildSpecification from an XML input stream.PearSpecifier
parsePearSpecifier(XMLInputSource aInput)
Parses a PearSpecifier from an XML input stream.PearSpecifier
parsePearSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a PearSpecifier from an XML input stream.ResourceManagerConfiguration
parseResourceManagerConfiguration(XMLInputSource aInput)
Parses a ResourceManagerConfiguration from an XML input stream.ResourceManagerConfiguration
parseResourceManagerConfiguration(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a ResourceManagerConfiguration from an XML input stream.ResourceMetaData
parseResourceMetaData(XMLInputSource aInput)
Parses a ResourceMetaData object from an XML input stream.ResourceMetaData
parseResourceMetaData(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a ResourceMetaData object from an XML input stream.ResourceSpecifier
parseResourceSpecifier(XMLInputSource aInput)
Parses a ResourceSpecifier from an XML input stream.ResourceSpecifier
parseResourceSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a ResourceSpecifier from an XML input stream.ResultSpecification
parseResultSpecification(XMLInputSource aInput)
Parses a ResultSpecification from an XML input stream.ResultSpecification
parseResultSpecification(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a ResultSpecification from an XML input stream.TaeDescription
parseTaeDescription(XMLInputSource aInput)
Deprecated.since v2.0TaeDescription
parseTaeDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Deprecated.since v2.0TypePriorities
parseTypePriorities(XMLInputSource aInput)
Parses a TypePriorities declaration from an XML input stream.TypePriorities
parseTypePriorities(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a TypePriorities declaration from an XML input stream.TypeSystemDescription
parseTypeSystemDescription(XMLInputSource aInput)
Parses a TypeSystemDescription from an XML input stream.TypeSystemDescription
parseTypeSystemDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a TypeSystemDescription from an XML input stream.URISpecifier
parseURISpecifier(XMLInputSource aInput)
Parses a URISpecifier from an XML input stream.URISpecifier
parseURISpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions)
Parses a URISpecifier from an XML input stream.
-
-
-
Field Detail
-
LOG_RESOURCE_BUNDLE
private static final java.lang.String LOG_RESOURCE_BUNDLE
resource bundle for log messages- See Also:
- Constant Field Values
-
CLASS_NAME
private static final java.lang.Class<XMLParser_impl> CLASS_NAME
current class
-
SCHEMA_URL
private static final java.net.URL SCHEMA_URL
The URL to the Resource Specifier XML Schema file
-
mElementToClassMap
protected java.util.Map<java.lang.String,java.lang.Class<? extends XMLizable>> mElementToClassMap
Map from XML element names to Class objects.
-
mSchemaValidationEnabled
protected boolean mSchemaValidationEnabled
Whether schema validation is enabled.
-
DEFAULT_PARSING_OPTIONS
protected static final XMLParser.ParsingOptions DEFAULT_PARSING_OPTIONS
-
-
Method Detail
-
enableSchemaValidation
public void enableSchemaValidation(boolean aEnable)
Description copied from interface:XMLParser
Enables or disables XML schema validation.- Specified by:
enableSchemaValidation
in interfaceXMLParser
- Parameters:
aEnable
- true to enable validation, false to disable validation- See Also:
XMLParser.enableSchemaValidation(boolean)
-
parse
public XMLizable parse(XMLInputSource aInput, java.lang.String aNamespaceForSchema, java.net.URL aSchemaUrl, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Parses an XML input stream and produces an object.- Specified by:
parse
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaNamespaceForSchema
- XML namespace for elements to be validated against XML schema. If null, no schema will be used.aSchemaUrl
- URL to XML schema that will be used to validate the XML document. If null, no schema will be used.aOptions
- option settings- Returns:
- an
XMLizable
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid object
-
parse
public XMLizable parse(XMLInputSource aInput, java.lang.String aNamespaceForSchema, java.net.URL aSchemaUrl) throws InvalidXMLException
Parses an XML input stream and produces an object.- Specified by:
parse
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaNamespaceForSchema
- XML namespace for elements to be validated against XML schema. If null, no schema will be used.aSchemaUrl
- URL to XML schema that will be used to validate the XML document. If null, no schema will be used.- Returns:
- an
XMLizable
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid object
-
parse
public XMLizable parse(XMLInputSource aInput) throws InvalidXMLException
Parses an XML input stream and produces an object. No schema validation will be done.- Specified by:
parse
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- an
XMLizable
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid object
-
parse
public XMLizable parse(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses an XML input stream and produces an object. No schema validation will be done.- Specified by:
parse
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- an
XMLizable
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid object
-
buildObject
public XMLizable buildObject(org.w3c.dom.Element aElement) throws InvalidXMLException
Builds an object from its XML DOM representation.- Specified by:
buildObject
in interfaceXMLParser
- Parameters:
aElement
- a DOM Element- Returns:
- an
XMLizable
object constructed from the DOM element - Throws:
InvalidXMLException
- if the XML element does not specify a valid object
-
buildObject
public XMLizable buildObject(org.w3c.dom.Element aElement, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Builds an object from its XML DOM representation.- Specified by:
buildObject
in interfaceXMLParser
- Parameters:
aElement
- a DOM ElementaOptions
- option settings- Returns:
- an
XMLizable
object constructed from the DOM element - Throws:
InvalidXMLException
- if the XML element does not specify a valid object
-
callBuildFromXMLElement
private void callBuildFromXMLElement(org.w3c.dom.Element aElement, XMLizable object, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
- Throws:
InvalidXMLException
-
buildObjectOrPrimitive
public java.lang.Object buildObjectOrPrimitive(org.w3c.dom.Element aElement, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Builds an object from its XML DOM representation. This method is not typically called by applications. It may be called from within aXMLizable.buildFromXMLElement(Element, XMLParser)
method to construct sub-objects.This method is similar to
XMLParser.buildObject(Element, XMLParser.ParsingOptions)
but can also parse primitive-typed objects wrapped as XML elements, such as<integer>42</integer
.- Specified by:
buildObjectOrPrimitive
in interfaceXMLParser
- Parameters:
aElement
- a DOM ElementaOptions
- option settings- Returns:
- an object constructed from the DOM element. This can be either an instance of
XMLizable
,String
, or one of the primitive type wrapper objects (e.g.Integer
,Float
,Boolean
). - Throws:
InvalidXMLException
- if the XML element does not specify a valid object
-
parseResourceSpecifier
public ResourceSpecifier parseResourceSpecifier(XMLInputSource aInput) throws InvalidXMLException
Parses a ResourceSpecifier from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseResourceSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
ResourceSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceSpecifier
-
parseResourceSpecifier
public ResourceSpecifier parseResourceSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Parses a ResourceSpecifier from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseResourceSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
ResourceSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceSpecifier
-
parseResourceMetaData
public ResourceMetaData parseResourceMetaData(XMLInputSource aInput) throws InvalidXMLException
Parses a ResourceMetaData object from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseResourceMetaData
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
ResourceMetaData
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceSpecifier
-
parseResourceMetaData
public ResourceMetaData parseResourceMetaData(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Parses a ResourceMetaData object from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseResourceMetaData
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
ResourceMetaData
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceSpecifier
-
parseURISpecifier
public URISpecifier parseURISpecifier(XMLInputSource aInput) throws InvalidXMLException
Parses a URISpecifier from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseURISpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
URISpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid URISpecifier
-
parseURISpecifier
public URISpecifier parseURISpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Parses a URISpecifier from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseURISpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
URISpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid URISpecifier
-
parseAnalysisEngineDescription
public AnalysisEngineDescription parseAnalysisEngineDescription(XMLInputSource aInput) throws InvalidXMLException
Parses a AnalysisEngineDescription from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseAnalysisEngineDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
AnalysisEngineDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid AnalysisEngineDescription
-
parseAnalysisEngineDescription
public AnalysisEngineDescription parseAnalysisEngineDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Parses a AnalysisEngineDescription from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseAnalysisEngineDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
AnalysisEngineDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid AnalysisEngineDescription
-
parseTaeDescription
@Deprecated public TaeDescription parseTaeDescription(XMLInputSource aInput) throws InvalidXMLException
Deprecated.since v2.0Parses a TaeDescription from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseTaeDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
TaeDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TaeDescription
-
parseTaeDescription
@Deprecated public TaeDescription parseTaeDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Deprecated.since v2.0Parses a TaeDescription from an XML input stream. XML schema validation will be done against theXMLParser.RESOURCE_SPECIFIER_SCHEMA_NAME
if it can be found in the classpath.- Specified by:
parseTaeDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
TaeDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TaeDescription
-
parseResultSpecification
public ResultSpecification parseResultSpecification(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a ResultSpecification from an XML input stream.- Specified by:
parseResultSpecification
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
ResultSpecification
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResultSpecification- See Also:
XMLParser.parseResultSpecification(org.apache.uima.util.XMLInputSource)
-
parseResultSpecification
public ResultSpecification parseResultSpecification(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a ResultSpecification from an XML input stream.- Specified by:
parseResultSpecification
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
ResultSpecification
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResultSpecification- See Also:
XMLParser.parseResultSpecification(org.apache.uima.util.XMLInputSource)
-
parseCasConsumerDescription
public CasConsumerDescription parseCasConsumerDescription(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CasConsumerDescription from an XML input stream.- Specified by:
parseCasConsumerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
CasConsumerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CasConsumerDescription- See Also:
XMLParser.parseCasConsumerDescription(org.apache.uima.util.XMLInputSource)
-
parseCasConsumerDescription
public CasConsumerDescription parseCasConsumerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CasConsumerDescription from an XML input stream.- Specified by:
parseCasConsumerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
CasConsumerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CasConsumerDescription- See Also:
XMLParser.parseCasConsumerDescription(org.apache.uima.util.XMLInputSource)
-
parseCasInitializerDescription
@Deprecated public CasInitializerDescription parseCasInitializerDescription(XMLInputSource aInput) throws InvalidXMLException
Deprecated.Description copied from interface:XMLParser
Parses a CasInitializerDescription from an XML input stream.- Specified by:
parseCasInitializerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
CasInitializerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CasInitializerDescription
-
parseCasInitializerDescription
@Deprecated public CasInitializerDescription parseCasInitializerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Deprecated.Description copied from interface:XMLParser
Parses a CasInitializerDescription from an XML input stream.- Specified by:
parseCasInitializerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
CasInitializerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CasInitializerDescription
-
parseCollectionReaderDescription
public CollectionReaderDescription parseCollectionReaderDescription(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CollectionReaderDescription from an XML input stream.- Specified by:
parseCollectionReaderDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
CollectionReaderDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CollectionReaderDescription
-
parseCollectionReaderDescription
public CollectionReaderDescription parseCollectionReaderDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CollectionReaderDescription from an XML input stream.- Specified by:
parseCollectionReaderDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
CollectionReaderDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CollectionReaderDescription
-
parseCpeDescription
public CpeDescription parseCpeDescription(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CpeDescription from an XML input stream.NOTE: the option settings
XMLParser.ParsingOptions
are not currently available for parsing CpeDescriptions, because they use a different parsing mechanism than the other specifier types.- Specified by:
parseCpeDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
cpeDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid IndexingSpecification
-
parseTypePriorities
public TypePriorities parseTypePriorities(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a TypePriorities declaration from an XML input stream.- Specified by:
parseTypePriorities
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
TypePriorities
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TypePriorities
-
parseTypePriorities
public TypePriorities parseTypePriorities(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a TypePriorities declaration from an XML input stream.- Specified by:
parseTypePriorities
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
TypePriorities
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TypePriorities
-
parseTypeSystemDescription
public TypeSystemDescription parseTypeSystemDescription(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a TypeSystemDescription from an XML input stream.- Specified by:
parseTypeSystemDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
TypeSystemDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TypeSystemDescription
-
parseTypeSystemDescription
public TypeSystemDescription parseTypeSystemDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a TypeSystemDescription from an XML input stream.- Specified by:
parseTypeSystemDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
TypeSystemDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid TypeSystemDescription
-
parseFsIndexCollection
public FsIndexCollection parseFsIndexCollection(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a FsIndexCollection from an XML input stream.- Specified by:
parseFsIndexCollection
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
FsIndexCollection
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid FsIndexCollection
-
parseFsIndexCollection
public FsIndexCollection parseFsIndexCollection(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a FsIndexCollection from an XML input stream.- Specified by:
parseFsIndexCollection
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
FsIndexCollection
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid FsIndexCollection
-
parseResourceManagerConfiguration
public ResourceManagerConfiguration parseResourceManagerConfiguration(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a ResourceManagerConfiguration from an XML input stream.- Specified by:
parseResourceManagerConfiguration
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
ResourceManagerConfiguration
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceManagerConfiguration
-
parseResourceManagerConfiguration
public ResourceManagerConfiguration parseResourceManagerConfiguration(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a ResourceManagerConfiguration from an XML input stream.- Specified by:
parseResourceManagerConfiguration
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
ResourceManagerConfiguration
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid ResourceManagerConfiguration
-
parseFlowControllerDescription
public FlowControllerDescription parseFlowControllerDescription(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a FlowControllerDescription from an XML input stream.- Specified by:
parseFlowControllerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
FlowControllerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid FlowControllerDescription
-
parseFlowControllerDescription
public FlowControllerDescription parseFlowControllerDescription(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a FlowControllerDescription from an XML input stream.- Specified by:
parseFlowControllerDescription
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
FlowControllerDescription
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid FlowControllerDescription
-
parseCustomResourceSpecifier
public CustomResourceSpecifier parseCustomResourceSpecifier(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CustomResourceSpecifier from an XML input stream.- Specified by:
parseCustomResourceSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
CustomResourceSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CustomResourceSpecifier
-
parseCustomResourceSpecifier
public CustomResourceSpecifier parseCustomResourceSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a CustomResourceSpecifier from an XML input stream.- Specified by:
parseCustomResourceSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
CustomResourceSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid CustomResourceSpecifier
-
parsePearSpecifier
public PearSpecifier parsePearSpecifier(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a PearSpecifier from an XML input stream.- Specified by:
parsePearSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- a
PearSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid PearSpecifier
-
parsePearSpecifier
public PearSpecifier parsePearSpecifier(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses a PearSpecifier from an XML input stream.- Specified by:
parsePearSpecifier
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- a
PearSpecifier
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid PearSpecifier
-
parseIndexBuildSpecification
public IndexBuildSpecification parseIndexBuildSpecification(XMLInputSource aInput) throws InvalidXMLException
Description copied from interface:XMLParser
Parses an IndexBuildSpecification from an XML input stream.- Specified by:
parseIndexBuildSpecification
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML document- Returns:
- an
IndexBuildSpecification
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid IndexBuildSpecification
-
parseIndexBuildSpecification
public IndexBuildSpecification parseIndexBuildSpecification(XMLInputSource aInput, XMLParser.ParsingOptions aOptions) throws InvalidXMLException
Description copied from interface:XMLParser
Parses an IndexBuildSpecification from an XML input stream.- Specified by:
parseIndexBuildSpecification
in interfaceXMLParser
- Parameters:
aInput
- the input source from which to read the XML documentaOptions
- option settings- Returns:
- an
IndexBuildSpecification
object constructed from the XML document - Throws:
InvalidXMLException
- if the input XML is not valid or does not specify a valid IndexBuildSpecification
-
addMapping
public void addMapping(java.lang.String aElementName, java.lang.String aClassName) throws java.lang.ClassNotFoundException
Configures this XMLParser by registering a mapping between the name of an XML element and the Class of object to be built from elements with that name. Ignores entries with no name, i.e. are not configured via XML- Specified by:
addMapping
in interfaceXMLParser
- Parameters:
aElementName
- the name of an XML elementaClassName
- the name of a Class of object to be built. This class must implementXMLizable
and have a zero-argument constructor.- Throws:
java.lang.ClassNotFoundException
- if the class named byaClassName
could not be foundUIMA_IllegalArgumentException
- if the class named byaClassName
does not implementXMLIzable
. @
-
newSaxDeserializer
public SaxDeserializer newSaxDeserializer()
Description copied from interface:XMLParser
Creates a newSaxDeserializer
object, which implements the SAXContentHandler
interface and can be used to deserialize anXMLizable
object from the events sent from a SAX parser. This can be used if the application already has a SAX parser that generates these events. In most cases, it is easier to use one of theparse
methods on this interface.The SAX deserializer returned my this method will expand XIncludes but will not do schema validation.
- Specified by:
newSaxDeserializer
in interfaceXMLParser
- Returns:
- an object that implements
ContentHandler
and can be used to deserialize anXMLizable
object from SAX events. - See Also:
XMLParser.newSaxDeserializer()
-
newSaxDeserializer
public SaxDeserializer newSaxDeserializer(XMLParser.ParsingOptions aOptions)
Description copied from interface:XMLParser
Creates a newSaxDeserializer
.- Specified by:
newSaxDeserializer
in interfaceXMLParser
- Parameters:
aOptions
- option settings- Returns:
- an object that implements
ContentHandler
and can be used to deserialize anXMLizable
object from SAX events. - See Also:
XMLParser.newSaxDeserializer(org.apache.uima.util.XMLParser.ParsingOptions)
-
-