Class AnalysisEngineDescription_impl
- All Implemented Interfaces:
Serializable
,Cloneable
,AnalysisEngineDescription
,MetaDataObject
,ResourceCreationSpecifier
,ResourceSpecifier
,XMLizable
- Direct Known Subclasses:
TaeDescription_impl
AnalysisEngineDescription
. Note that this class contains two
attributes of class Map, which are not supported by the default XML input/output routines.
Therefore we override the
MetaDataObject_impl.writePropertyAsElement(PropertyXmlInfo, String)
and
MetaDataObject_impl.readPropertyValueFromXMLElement(PropertyXmlInfo, Element, XMLParser, XMLParser.ParsingOptions)
methods.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
MetaDataObject_impl.MetaDataAttr, MetaDataObject_impl.SerialContext, MetaDataObject_impl.Serializer
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
Name of the "delegateAnalysisEngineSpecifiers" XML Element.protected final String
Name of the "delegateAnalysisEngineSpecifiers" property.protected final String
Name of the "delegateAnalysisEngineSpecifiersWithImports" property.Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
Constructor Summary
ConstructorDescriptionCreates a new AnalysisEngineDescription_impl. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildFromXMLElement
(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) Overridden to set default operational properties if they are not specified in descriptor.protected boolean
capabilitiesContainSofa
(String aSofaName, boolean aOutput) protected void
checkForInvalidParameterOverrides
(ConfigurationParameter[] aParams, String aGroupName, ResourceManager aResourceManager) OverridesResourceCreationSpecifier_impl.checkForInvalidParameterOverrides(ConfigurationParameter[], String, ResourceManager)
to validate parameter overrides in an aggregate AE.clone()
Creates a clone of thisMetaDataObject
.void
Does full validation of thisResourceCreationSpecifier
.void
doFullValidation
(ResourceManager aResourceManager) Does full validation of thisResourceCreationSpecifier
.Override this method to include additional attributesgetAllComponentSpecifiers
(ResourceManager aResourceManager) For an aggregate AnalysisEngine only, gets the ResourceSpecifiers of all components in this aggregate.Retrieves the metadata that describes the AnalysisEngine.For a primitive AnalysisEngine only, retrieves the name of the annotator implementation.Gets the ResourceSpecifier of one a component of this aggregate, based on its key.For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifier
s that indicate which delegate AnalysisEngines comprise the aggregate.getDelegateAnalysisEngineSpecifiers
(ResourceManager aResourceManager) For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifier
s that indicate which delegate AnalysisEngines comprise the aggregate.Retrieves a Map whose keys are string identifiers and whose values are the eitherImport
orResourceSpecifier
objects.For an aggregate AnalysisEngine only, gets the declaration of which FlowController should be used by the AnalysisEngine.Gets the name of the AE framework implementation within which the Resource executes.protected XmlizationInfo
To be implemented by subclasses to return information describing how to represent this object in XML.protected static XmlizationInfo
Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.boolean
Retrieves whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).Deprecated.never called anymore - getAdditionalAttributes called insteadprotected void
readPropertyValueFromXMLElement
(PropertyXmlInfo aPropXmlInfo, Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) Overridden to handle XML import of the DelegateAnalysisEngineSpecifiers attribute.protected void
resolveDelegateAnalysisEngineImports
(Collection<String> aEnclosingAggregateAeUrls, ResourceManager aResourceManager, boolean aRecursive) Resolves imports of delegate Analysis Engines.protected void
resolveDelegateAnalysisEngineImports
(ResourceManager aResourceManager, boolean aRecursive) Resolves imports of delegate Analysis Engines.void
resolveImports
(Collection<String> aAlreadyImportedDelegateAeUrls, ResourceManager aResourceManager) Resolves all import declarations in this AnalysisEngineDescription.void
resolveImports
(ResourceManager aResourceManager) Resolves all import declarations in this AnalysisEngineDescription.void
setAnnotatorImplementationName
(String aImplementationName) For a primitive AnalysisEngine only, sets the name of the annotator implementation.void
setFlowControllerDeclaration
(FlowControllerDeclaration aFlowControllerDeclaration) For an aggregate AnalysisEngine only, sets the declaration of which FlowController should be used by the AnalysisEngine.void
setFrameworkImplementation
(String aFrameworkImplementation) Sets the name of the AE framework implementation within which theResourceCreationSpecifier
executes.void
setPrimitive
(boolean aPrimitive) Sets whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).void
setSofaMappings
(SofaMapping[] aSofaMappings) void
toXML
(OutputStream aOutputStream, boolean aPreserveDelegateAnalysisEngineImports) Writes this object's XML representation as a string in UTF-8 encoding.void
Writes this object's XML representation as a string.void
toXML
(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute, boolean aPreserveDelegateAnalysisEngineImports) Writes this object's XML representation by making calls on a SAXContentHandler
.void
validate
(ResourceManager aResourceManager) Determines if the AnalysisEngineDescription is valid.protected void
Validate SofA mappings and inputs/outputs for an aggregate AE.protected void
writePropertyAsElement
(PropertyXmlInfo aPropInfo, String aNamespace) Overridden to handle XML export of the DelegateAnalysisEngineSpecifiers attribute.Methods inherited from class org.apache.uima.resource.impl.ResourceCreationSpecifier_impl
checkForDuplicateParameterNames, getExternalResourceDependencies, getExternalResourceDependency, getImplementationName, getMetaData, getResourceManagerConfiguration, setExternalResourceDependencies, setImplementationName, setMetaData, setResourceManagerConfiguration, validate, validateConfigurationParameters
Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, equals, getAttributeClass, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readUnknownPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, valueIsNullOrEmptyArray, writeArrayPropertyAsElement, writeMapPropertyToXml
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, setAttributeValue, setSourceUrl
Methods inherited from interface org.apache.uima.resource.ResourceCreationSpecifier
getExternalResourceDependencies, getExternalResourceDependency, getImplementationName, getMetaData, getResourceManagerConfiguration, setExternalResourceDependencies, setImplementationName, setMetaData, setResourceManagerConfiguration, validate
-
Field Details
-
PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
Name of the "delegateAnalysisEngineSpecifiers" property. Change this if interface changes.- See Also:
-
PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS_WITH_IMPORTS
Name of the "delegateAnalysisEngineSpecifiersWithImports" property. Change this if interface changes.- See Also:
-
ELEM_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
Name of the "delegateAnalysisEngineSpecifiers" XML Element. Change this if schema changes.- See Also:
-
-
Constructor Details
-
AnalysisEngineDescription_impl
public AnalysisEngineDescription_impl()Creates a new AnalysisEngineDescription_impl. Initializes the MetaData, DelegateAnalysisEngineSpecifiers, and ExternalResourcesRequired attributes.
-
-
Method Details
-
getFrameworkImplementation
Description copied from interface:ResourceCreationSpecifier
Gets the name of the AE framework implementation within which the Resource executes. The framework name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME
..- Specified by:
getFrameworkImplementation
in interfaceAnalysisEngineDescription
- Specified by:
getFrameworkImplementation
in interfaceResourceCreationSpecifier
- Overrides:
getFrameworkImplementation
in classResourceCreationSpecifier_impl
- Returns:
- the framework implementation name
- See Also:
-
setFrameworkImplementation
Description copied from interface:ResourceCreationSpecifier
Sets the name of the AE framework implementation within which theResourceCreationSpecifier
executes. The framework name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME
..- Specified by:
setFrameworkImplementation
in interfaceAnalysisEngineDescription
- Specified by:
setFrameworkImplementation
in interfaceResourceCreationSpecifier
- Overrides:
setFrameworkImplementation
in classResourceCreationSpecifier_impl
- Parameters:
aFrameworkImplementation
- the framework implementation name- See Also:
-
isPrimitive
public boolean isPrimitive()Description copied from interface:AnalysisEngineDescription
Retrieves whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).Some of the methods on this class apply only to one type of AnalysisEngine:
AnalysisEngineDescription.getAnnotatorImplementationName()
- primitive AnalysisEngine only
AnalysisEngineDescription.getDelegateAnalysisEngineSpecifiers()
- aggregate AnalysisEngine only
AnalysisEngineDescription.getFlowControllerDeclaration()
- aggregate AnalysisEngine only
- Specified by:
isPrimitive
in interfaceAnalysisEngineDescription
- Returns:
- true if and only if the AnalysisEngine is primitive
- See Also:
-
setPrimitive
public void setPrimitive(boolean aPrimitive) Description copied from interface:AnalysisEngineDescription
Sets whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).- Specified by:
setPrimitive
in interfaceAnalysisEngineDescription
- Parameters:
aPrimitive
- true if and only if the AnalysisEngine is primitive- See Also:
-
getAnnotatorImplementationName
Description copied from interface:AnalysisEngineDescription
For a primitive AnalysisEngine only, retrieves the name of the annotator implementation. For Java annotators, this will be a fully qualified Java class name.- Specified by:
getAnnotatorImplementationName
in interfaceAnalysisEngineDescription
- Returns:
- the implementation name of the annotator. If the AnalysisEngine is aggregate, always
returns
null
. - See Also:
-
setAnnotatorImplementationName
Description copied from interface:AnalysisEngineDescription
For a primitive AnalysisEngine only, sets the name of the annotator implementation. For Java annotators, this must be a fully qualified Java class name.- Specified by:
setAnnotatorImplementationName
in interfaceAnalysisEngineDescription
- Parameters:
aImplementationName
- the implementation name of the annotator.- See Also:
-
getDelegateAnalysisEngineSpecifiers
public Map<String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers() throws InvalidXMLExceptionDescription copied from interface:AnalysisEngineDescription
For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifier
s that indicate which delegate AnalysisEngines comprise the aggregate. EachResourceSpecifier
can either:- completely describe how to build a AnalysisEngine instance
- describe how to locate a distributed AnalysisEngine service, for example a specific endpoint or a JNDI name
This method returns an unmodifiable Map whose keys are string identifiers and whose values are the
ResourceSpecifier
objects. The string identifiers in this Map are to refer to the delegate AnalysisEngines from elsewhere in thisAnalysisEngineDescription
. (For example in theFlowConstraints
description.)Note that the Map returned by this method will never contain
Import
objects -- they will always be resolved first. If you want to get access to the original Import objects, useAnalysisEngineDescription.getDelegateAnalysisEngineSpecifiersWithImports()
. Also use that method if you want to be able to make changes to the Map.- Specified by:
getDelegateAnalysisEngineSpecifiers
in interfaceAnalysisEngineDescription
- Returns:
- an unmodifiable Map with
String
keys andResourceSpecifier
values. - Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
getDelegateAnalysisEngineSpecifiers
public Map<String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException Description copied from interface:AnalysisEngineDescription
For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifier
s that indicate which delegate AnalysisEngines comprise the aggregate. EachResourceSpecifier
can either:- completely describe how to build a AnalysisEngine instance
- describe how to locate a distributed AnalysisEngine service, for example a specific endpoint or a JNDI name
This method returns an unmodifiable Map whose keys are string identifiers and whose values are the
ResourceSpecifier
objects. The string identifiers in this Map are to refer to the delegate AnalysisEngines from elsewhere in thisAnalysisEngineDescription
. (For example in theFlowConstraints
description.)Note that the Map returned by this method will never contain
Import
objects -- they will always be resolved first. If you want to get access to the original Import objects, useAnalysisEngineDescription.getDelegateAnalysisEngineSpecifiersWithImports()
. Also use that method if you want to be able to make changes to the Map.- Specified by:
getDelegateAnalysisEngineSpecifiers
in interfaceAnalysisEngineDescription
- Parameters:
aResourceManager
- the ResourceManager to use to get the datapath needed to resolve imports- Returns:
- an unmodifiable Map with
String
keys andResourceSpecifier
values. - Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
getDelegateAnalysisEngineSpecifiersWithImports
Description copied from interface:AnalysisEngineDescription
Retrieves a Map whose keys are string identifiers and whose values are the eitherImport
orResourceSpecifier
objects. These indicate the delegate AnalysisEngines that comprise the aggregate.This is a direct representation of what is in the XML syntax for the descriptor. That is, if the XML had an <import> element, the Map will contain an
Import
object. If you do not want to deal with imports, use theAnalysisEngineDescription.getDelegateAnalysisEngineSpecifiers()
method instead.- Specified by:
getDelegateAnalysisEngineSpecifiersWithImports
in interfaceAnalysisEngineDescription
- Returns:
- a Map with
String
keys andResourceSpecifier
orImport
objects as values. This Map may be modified to add or remove imports or specifiers. - See Also:
-
getFlowControllerDeclaration
Description copied from interface:AnalysisEngineDescription
For an aggregate AnalysisEngine only, gets the declaration of which FlowController should be used by the AnalysisEngine.- Specified by:
getFlowControllerDeclaration
in interfaceAnalysisEngineDescription
- Returns:
- an object containing either an import of a ResourceSpecifier or a ResourceSpecifier itself. This specifier will be used to create the FlowController.
-
setFlowControllerDeclaration
Description copied from interface:AnalysisEngineDescription
For an aggregate AnalysisEngine only, sets the declaration of which FlowController should be used by the AnalysisEngine.- Specified by:
setFlowControllerDeclaration
in interfaceAnalysisEngineDescription
- Parameters:
aFlowControllerDeclaration
- an object containing either an import of a ResourceSpecifier or a ResourceSpecifier itself. This specifier will be used to create the FlowController.
-
getAllComponentSpecifiers
public Map<String,ResourceSpecifier> getAllComponentSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException Description copied from interface:AnalysisEngineDescription
For an aggregate AnalysisEngine only, gets the ResourceSpecifiers of all components in this aggregate. This includes the FlowController as well as all of the component AnalysisEngines.This method returns an unmodifiable Map whose keys are string identifiers and whose values are the
ResourceSpecifier
objects. The string identifiers in this Map are to refer to the components from elsewhere in this aggregate descriptor, for example in configuration parameter overrides and resource bindings.Note that the Map returned by this method will never contain
Import
objects -- they will always be resolved first. If you want to get access to the original Import objects, useAnalysisEngineDescription.getDelegateAnalysisEngineSpecifiersWithImports()
andAnalysisEngineDescription.getFlowControllerDeclaration()
. Also use those methods if you want to make changes to be able to make changes to the Map.- Specified by:
getAllComponentSpecifiers
in interfaceAnalysisEngineDescription
- Parameters:
aResourceManager
- the ResourceManager from which to get the datapath needed to resolve imports. Pass null to use the default ResourceManager.- Returns:
- an unmodifiable Map with
String
keys andResourceSpecifier
values. - Throws:
InvalidXMLException
- if import resolution failed
-
getAnalysisEngineMetaData
Description copied from interface:AnalysisEngineDescription
Retrieves the metadata that describes the AnalysisEngine. This includes the AnalysisEngine's capabilties, the TypeSystem that is uses, the specified Flow information for an aggregate AnalysisEngine, and various informational attributes such as name, description, version, vendor, and copyright.- Specified by:
getAnalysisEngineMetaData
in interfaceAnalysisEngineDescription
- Returns:
- the
AnalysisEngineMetaData
object containing the AnalysisEngine's metadata. This object can be modified. - See Also:
-
getSofaMappings
- Specified by:
getSofaMappings
in interfaceAnalysisEngineDescription
-
setSofaMappings
- Specified by:
setSofaMappings
in interfaceAnalysisEngineDescription
-
doFullValidation
Description copied from interface:ResourceCreationSpecifier
Does full validation of thisResourceCreationSpecifier
. This essentially performs all operations necessary to instantiate a Resource except that it does not actually instantiate the implementation class. If appropriate, this method will also attempt to create a CAS based on the descriptor, in order to do full type system verification. If any operations fail, an exception will be thrown.- Specified by:
doFullValidation
in interfaceAnalysisEngineDescription
- Specified by:
doFullValidation
in interfaceResourceCreationSpecifier
- Overrides:
doFullValidation
in classResourceCreationSpecifier_impl
- Throws:
ResourceInitializationException
- if validation failed
-
doFullValidation
public void doFullValidation(ResourceManager aResourceManager) throws ResourceInitializationException Description copied from interface:ResourceCreationSpecifier
Does full validation of thisResourceCreationSpecifier
. This essentially performs all operations necessary to instantiate a Resource except that it does not actually instantiate the implementation class. If appropriate, this method will also attempt to create a CAS based on the descriptor, in order to do full type system verification. If any operations fail, an exception will be thrown.- Specified by:
doFullValidation
in interfaceAnalysisEngineDescription
- Specified by:
doFullValidation
in interfaceResourceCreationSpecifier
- Overrides:
doFullValidation
in classResourceCreationSpecifier_impl
- Parameters:
aResourceManager
- a ResourceManager instance to use to load annotator classes, external resource classes, and resolve imports by name.- Throws:
ResourceInitializationException
- if validation failed
-
validate
public void validate(ResourceManager aResourceManager) throws ResourceInitializationException, ResourceConfigurationException Determines if the AnalysisEngineDescription is valid. An exception is thrown if it is not valid. This should be called from this Analysis Engine's initialize method. Note this does not check configuration parameter settings - that must be done by an explicit call to validateConfigurationParameterSettings.- Specified by:
validate
in interfaceResourceCreationSpecifier
- Overrides:
validate
in classResourceCreationSpecifier_impl
- Parameters:
aResourceManager
- a ResourceManager instance to use to resolve imports by name.- Throws:
ResourceInitializationException
- ifaDesc
is invalidResourceConfigurationException
- if the configuration parameter settings inaDesc
are invalid
-
checkForInvalidParameterOverrides
protected void checkForInvalidParameterOverrides(ConfigurationParameter[] aParams, String aGroupName, ResourceManager aResourceManager) throws ResourceInitializationException OverridesResourceCreationSpecifier_impl.checkForInvalidParameterOverrides(ConfigurationParameter[], String, ResourceManager)
to validate parameter overrides in an aggregate AE. Also logs a warning for aggregate parameters with no declared overrides.- Overrides:
checkForInvalidParameterOverrides
in classResourceCreationSpecifier_impl
- Parameters:
aParams
- an array of ConfigurationParametersaGroupName
- name of groups in which these parameters are contained. Null if no groupaResourceManager
- a ResourceManager instance to use to resolve imports by name.- Throws:
ResourceInitializationException
- if there is an invalid parameter override declaration
-
getComponentSpecifier
Gets the ResourceSpecifier of one a component of this aggregate, based on its key. This may be the specifier of a component (i.e. delegate) AnalysisEngine, or it may be the specifier of the FlowController.- Specified by:
getComponentSpecifier
in interfaceAnalysisEngineDescription
- Parameters:
key
- the key of the component specifier to get- Returns:
- the specifier for the component, null if there is no component with the given key
- Throws:
ResourceInitializationException
- if there's a problem resolving imports
-
validateSofaMappings
Validate SofA mappings and inputs/outputs for an aggregate AE.- Throws:
ResourceInitializationException
- -
-
capabilitiesContainSofa
-
getAdditionalAttributes
Description copied from class:MetaDataObject_impl
Override this method to include additional attributes- Overrides:
getAdditionalAttributes
in classMetaDataObject_impl
- Returns:
- additional attributes
-
listAttributes
Deprecated.never called anymore - getAdditionalAttributes called insteadOverridden to add Delegate AE Specifiers to the result list. Default introspection implementation won't return it because it has no set method. We've also overridden the XML import/export methods, though, so that set methods are not required.- Specified by:
listAttributes
in interfaceMetaDataObject
- Overrides:
listAttributes
in classMetaDataObject_impl
- Returns:
- a List containing
NameClassPair
objects, each of which contains the name of a parameter and the Class of its value. For primitive types, the wrapper classes will be returned (e.g.java.lang.Integer
instead of int). - See Also:
-
toXML
public void toXML(OutputStream aOutputStream, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException, IOException Description copied from interface:AnalysisEngineDescription
Writes this object's XML representation as a string in UTF-8 encoding.- Specified by:
toXML
in interfaceAnalysisEngineDescription
- Parameters:
aOutputStream
- an OutputStream to which the XML string will be written, in UTF-8 encoding.aPreserveDelegateAnalysisEngineImports
- if true, XML serialization will always preserve <import> elements used to import delegate analysis engine specifiers into an aggregate. If false, the default import serialization behavior applies, which is to write <import> elements only in the case where they have not previously been resolved.- Throws:
SAXException
- if a SAX exception occursIOException
- if an I/O failure occurs
-
toXML
public void toXML(Writer aWriter, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException, IOException Description copied from interface:AnalysisEngineDescription
Writes this object's XML representation as a string. Note that if you want to write the XML to a file, it is highly recommended that you useXMLizable.toXML(OutputStream)
instead, as it ensures that output is written in UTF-8 encoding, which is the default encoding that should be used for XML files.- Specified by:
toXML
in interfaceAnalysisEngineDescription
- Parameters:
aWriter
- a Writer to which the XML string will be writtenaPreserveDelegateAnalysisEngineImports
- if true, XML serialization will always preserve <import> elements used to import delegate analysis engine specifiers into an aggregate. If false, the default import serialization behavior applies, which is to write <import> elements only in the case where they have not previously been resolved.- Throws:
SAXException
- if a SAX exception occursIOException
- if an I/O failure occurs
-
toXML
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException Description copied from interface:AnalysisEngineDescription
Writes this object's XML representation by making calls on a SAXContentHandler
.- Specified by:
toXML
in interfaceAnalysisEngineDescription
- Parameters:
aContentHandler
- the content handler to which this object will write events that describe its XML representation.aWriteDefaultNamespaceAttribute
- whether the namespace of this element should be written as the default namespace. This should be done only for the root element, and it defaults to false.aPreserveDelegateAnalysisEngineImports
- if true, XML serialization will always preserve <import> elements used to import delegate analysis engine specifiers into an aggregate. If false, the default import serialization behavior applies, which is to write <import> elements only in the case where they have not previously been resolved.- Throws:
SAXException
- if a SAX exception occurs
-
resolveImports
Description copied from interface:AnalysisEngineDescription
Resolves all import declarations in this AnalysisEngineDescription. For an aggregate, this is recursive, also resolving all imports in each delegate AnalysisEngine. Users do not typically need to call this method; it is called automatically whenUIMAFramework.produceAnalysisEngine(ResourceSpecifier)
is called.- Specified by:
resolveImports
in interfaceAnalysisEngineDescription
- Parameters:
aResourceManager
- the Resource Manager used to locate imports by name. For example, the path in which to locate these imported descriptors can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if an import target does not exist or is invalid
-
resolveImports
public void resolveImports(Collection<String> aAlreadyImportedDelegateAeUrls, ResourceManager aResourceManager) throws InvalidXMLException Description copied from interface:AnalysisEngineDescription
Resolves all import declarations in this AnalysisEngineDescription. For an aggregate, this is recursive, also resolving all imports in each delegate AnalysisEngine. Users do not typically need to call this method; it is called automatically whenUIMAFramework.produceAnalysisEngine(ResourceSpecifier)
is called.This version is used internally to resolve nested imports.
- Specified by:
resolveImports
in interfaceAnalysisEngineDescription
- Parameters:
aAlreadyImportedDelegateAeUrls
- URLs of already imported AE descriptors, so we don't import them again.aResourceManager
- the Resource Manager used to locate imports by name. For example, the path in which to locate these imported descriptors can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if an import target does not exist or is invalid
-
resolveDelegateAnalysisEngineImports
protected void resolveDelegateAnalysisEngineImports(ResourceManager aResourceManager, boolean aRecursive) throws InvalidXMLException Resolves imports of delegate Analysis Engines. This reads from the delegateAnalysisEngineSpecifiersWithImports map and populates the delegateAnalysisEngineSpecifiers map.- Parameters:
aResourceManager
- -aRecursive
- If true, this method will callresolveImports(Collection, ResourceManager)
on each delegate. If a cirular import is found, an exception will be thrown.- Throws:
InvalidXMLException
- -
-
resolveDelegateAnalysisEngineImports
protected void resolveDelegateAnalysisEngineImports(Collection<String> aEnclosingAggregateAeUrls, ResourceManager aResourceManager, boolean aRecursive) throws InvalidXMLException Resolves imports of delegate Analysis Engines. This reads from the delegateAnalysisEngineSpecifiersWithImports map and populates the delegateAnalysisEngineSpecifiers map.- Parameters:
aEnclosingAggregateAeUrls
- URLs of enclosing aggregate AEs. Used to detect circular imports.aResourceManager
- -aRecursive
- If true, this method will callresolveImports(Collection, ResourceManager)
on each delegate. If a circular import is found, an exception will be thrown.- Throws:
InvalidXMLException
- -
-
clone
Description copied from interface:MetaDataObject
Creates a clone of thisMetaDataObject
. This performs a "deep" copy by cloning all attribute values that are also MetaDataObjects.- Specified by:
clone
in interfaceMetaDataObject
- Overrides:
clone
in classMetaDataObject_impl
- Returns:
- a clone of this
MetaDataObject
- See Also:
-
writePropertyAsElement
protected void writePropertyAsElement(PropertyXmlInfo aPropInfo, String aNamespace) throws SAXException Overridden to handle XML export of the DelegateAnalysisEngineSpecifiers attribute. This attribute has a value of typeMap
, which is not handled by the default XML export logic.- Overrides:
writePropertyAsElement
in classMetaDataObject_impl
- Parameters:
aPropInfo
- -aNamespace
- -- Throws:
SAXException
- -- See Also:
-
readPropertyValueFromXMLElement
protected void readPropertyValueFromXMLElement(PropertyXmlInfo aPropXmlInfo, Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLException Overridden to handle XML import of the DelegateAnalysisEngineSpecifiers attribute. This attribute has a value of typeMap
, which is not handled by the default XML import logic.- Overrides:
readPropertyValueFromXMLElement
in classMetaDataObject_impl
- Parameters:
aPropXmlInfo
- information about the property to readaElement
- DOM element to read fromaParser
- parser to use to construct complex valuesaOptions
- option settings- Throws:
InvalidXMLException
- -- See Also:
-
buildFromXMLElement
public void buildFromXMLElement(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLException Overridden to set default operational properties if they are not specified in descriptor.- Specified by:
buildFromXMLElement
in interfaceXMLizable
- Overrides:
buildFromXMLElement
in classMetaDataObject_impl
- Parameters:
aElement
- -aParser
- -aOptions
- -- Throws:
InvalidXMLException
- -
-
getXmlizationInfo
Description copied from class:MetaDataObject_impl
To be implemented by subclasses to return information describing how to represent this object in XML.- Overrides:
getXmlizationInfo
in classResourceCreationSpecifier_impl
- Returns:
- information defining this object's XML representation
-
getXmlizationInfoForClass
Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.- Returns:
- XmlizationInfo, used by subclasses to set up their own XmlizationInfo
-