Class AnalysisEngineDescription_impl
- java.lang.Object
-
- org.apache.uima.resource.metadata.impl.MetaDataObject_impl
-
- org.apache.uima.resource.impl.ResourceCreationSpecifier_impl
-
- org.apache.uima.analysis_engine.impl.AnalysisEngineDescription_impl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,AnalysisEngineDescription,MetaDataObject,ResourceCreationSpecifier,ResourceSpecifier,XMLizable
- Direct Known Subclasses:
TaeDescription_impl
public class AnalysisEngineDescription_impl extends ResourceCreationSpecifier_impl implements AnalysisEngineDescription
Reference implementation ofAnalysisEngineDescription. Note that this class contains two attributes of class Map, which are not supported by the default XML input/output routines. Therefore we override theMetaDataObject_impl.writePropertyAsElement(PropertyXmlInfo, String)andMetaDataObject_impl.readPropertyValueFromXMLElement(PropertyXmlInfo, Element, XMLParser, XMLParser.ParsingOptions)methods.- See Also:
- Serialized Form
-
-
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
Fields Modifier and Type Field Description protected java.lang.StringELEM_DELEGATE_ANALYSIS_ENGINE_SPECIFIERSName of the "delegateAnalysisEngineSpecifiers" XML Element.private static java.lang.reflect.MethodgetterForAEwImportsprivate java.util.Map<java.lang.String,ResourceSpecifier>mDelegateAnalysisEngineSpecifiersprivate java.util.Map<java.lang.String,MetaDataObject>mDelegateAnalysisEngineSpecifiersWithImportsprivate FlowControllerDeclarationmFlowControllerDeclarationprivate java.lang.StringmFrameworkImplementationprivate booleanmPrimitiveprivate java.util.Map<java.lang.String,Import>mProcessedImportsprivate SofaMapping[]mSofaMappingsprotected java.lang.StringPROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERSName of the "delegateAnalysisEngineSpecifiers" property.protected java.lang.StringPROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS_WITH_IMPORTSName of the "delegateAnalysisEngineSpecifiersWithImports" property.(package private) static longserialVersionUIDprivate static XmlizationInfoXMLIZATION_INFO-
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
-
Constructor Summary
Constructors Constructor Description AnalysisEngineDescription_impl()Creates a new AnalysisEngineDescription_impl.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbuildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)Overridden to set default operational properties if they are not specified in descriptor.protected booleancapabilitiesContainSofa(java.lang.String aSofaName, boolean aOutput)protected voidcheckForInvalidParameterOverrides(ConfigurationParameter[] aParams, java.lang.String aGroupName, ResourceManager aResourceManager)OverridesResourceCreationSpecifier_impl.checkForInvalidParameterOverrides(ConfigurationParameter[], String, ResourceManager)to validate parameter overrides in an aggregate AE.java.lang.Objectclone()Creates a clone of thisMetaDataObject.private booleandeclaresSofa(AnalysisEngineDescription aDesc, java.lang.String aSofaName)voiddoFullValidation()Does full validation of thisResourceCreationSpecifier.voiddoFullValidation(ResourceManager aResourceManager)Does full validation of thisResourceCreationSpecifier.java.util.List<MetaDataObject_impl.MetaDataAttr>getAdditionalAttributes()Override this method to include additional attributesjava.util.Map<java.lang.String,ResourceSpecifier>getAllComponentSpecifiers(ResourceManager aResourceManager)For an aggregate AnalysisEngine only, gets the ResourceSpecifiers of all components in this aggregate.AnalysisEngineMetaDatagetAnalysisEngineMetaData()Retrieves the metadata that describes the AnalysisEngine.java.lang.StringgetAnnotatorImplementationName()For a primitive AnalysisEngine only, retrieves the name of the annotator implementation.ResourceSpecifiergetComponentSpecifier(java.lang.String key)Gets the ResourceSpecifier of one a component of this aggregate, based on its key.java.util.Map<java.lang.String,ResourceSpecifier>getDelegateAnalysisEngineSpecifiers()For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifiers that indicate which delegate AnalysisEngines comprise the aggregate.java.util.Map<java.lang.String,ResourceSpecifier>getDelegateAnalysisEngineSpecifiers(ResourceManager aResourceManager)For an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifiers that indicate which delegate AnalysisEngines comprise the aggregate.java.util.Map<java.lang.String,MetaDataObject>getDelegateAnalysisEngineSpecifiersWithImports()Retrieves a Map whose keys are string identifiers and whose values are the eitherImportorResourceSpecifierobjects.FlowControllerDeclarationgetFlowControllerDeclaration()For an aggregate AnalysisEngine only, gets the declaration of which FlowController should be used by the AnalysisEngine.java.lang.StringgetFrameworkImplementation()Gets the name of the AE framework implementation within which the Resource executes.SofaMapping[]getSofaMappings()protected XmlizationInfogetXmlizationInfo()To be implemented by subclasses to return information describing how to represent this object in XML.protected static XmlizationInfogetXmlizationInfoForClass()Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.booleanisPrimitive()Retrieves whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).java.util.List<NameClassPair>listAttributes()Deprecated.never called anymore - getAdditionalAttributes called insteadprotected voidreadPropertyValueFromXMLElement(PropertyXmlInfo aPropXmlInfo, org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)Overridden to handle XML import of the DelegateAnalysisEngineSpecifiers attribute.protected voidresolveDelegateAnalysisEngineImports(java.util.Collection<java.lang.String> aEnclosingAggregateAeUrls, ResourceManager aResourceManager, boolean aRecursive)Resolves imports of delegate Analysis Engines.protected voidresolveDelegateAnalysisEngineImports(ResourceManager aResourceManager, boolean aRecursive)Resolves imports of delegate Analysis Engines.voidresolveImports(java.util.Collection<java.lang.String> aAlreadyImportedDelegateAeUrls, ResourceManager aResourceManager)Resolves all import declarations in this AnalysisEngineDescription.voidresolveImports(ResourceManager aResourceManager)Resolves all import declarations in this AnalysisEngineDescription.voidsetAnnotatorImplementationName(java.lang.String aImplementationName)For a primitive AnalysisEngine only, sets the name of the annotator implementation.voidsetFlowControllerDeclaration(FlowControllerDeclaration aFlowControllerDeclaration)For an aggregate AnalysisEngine only, sets the declaration of which FlowController should be used by the AnalysisEngine.voidsetFrameworkImplementation(java.lang.String aFrameworkImplementation)Sets the name of the AE framework implementation within which theResourceCreationSpecifierexecutes.voidsetPrimitive(boolean aPrimitive)Sets whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).voidsetSofaMappings(SofaMapping[] aSofaMappings)voidtoXML(java.io.OutputStream aOutputStream, boolean aPreserveDelegateAnalysisEngineImports)Writes this object's XML representation as a string in UTF-8 encoding.voidtoXML(java.io.Writer aWriter, boolean aPreserveDelegateAnalysisEngineImports)Writes this object's XML representation as a string.voidtoXML(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute, boolean aPreserveDelegateAnalysisEngineImports)Writes this object's XML representation by making calls on a SAXContentHandler.voidvalidate(ResourceManager aResourceManager)Determines if the AnalysisEngineDescription is valid.protected voidvalidateSofaMappings()Validate SofA mappings and inputs/outputs for an aggregate AE.protected voidwritePropertyAsElement(PropertyXmlInfo aPropInfo, java.lang.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 Detail
-
getterForAEwImports
private static final java.lang.reflect.Method getterForAEwImports
-
PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
protected final java.lang.String PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
Name of the "delegateAnalysisEngineSpecifiers" property. Change this if interface changes.- See Also:
- Constant Field Values
-
PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS_WITH_IMPORTS
protected final java.lang.String PROP_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS_WITH_IMPORTS
Name of the "delegateAnalysisEngineSpecifiersWithImports" property. Change this if interface changes.- See Also:
- Constant Field Values
-
ELEM_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
protected final java.lang.String ELEM_DELEGATE_ANALYSIS_ENGINE_SPECIFIERS
Name of the "delegateAnalysisEngineSpecifiers" XML Element. Change this if schema changes.- See Also:
- Constant Field Values
-
mFrameworkImplementation
private java.lang.String mFrameworkImplementation
-
mPrimitive
private boolean mPrimitive
-
mFlowControllerDeclaration
private FlowControllerDeclaration mFlowControllerDeclaration
-
mDelegateAnalysisEngineSpecifiers
private java.util.Map<java.lang.String,ResourceSpecifier> mDelegateAnalysisEngineSpecifiers
-
mDelegateAnalysisEngineSpecifiersWithImports
private java.util.Map<java.lang.String,MetaDataObject> mDelegateAnalysisEngineSpecifiersWithImports
-
mProcessedImports
private java.util.Map<java.lang.String,Import> mProcessedImports
-
mSofaMappings
private SofaMapping[] mSofaMappings
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
XMLIZATION_INFO
private static final XmlizationInfo XMLIZATION_INFO
-
-
Method Detail
-
getFrameworkImplementation
public java.lang.String getFrameworkImplementation()
Description copied from interface:ResourceCreationSpecifierGets 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:
getFrameworkImplementationin interfaceAnalysisEngineDescription- Specified by:
getFrameworkImplementationin interfaceResourceCreationSpecifier- Overrides:
getFrameworkImplementationin classResourceCreationSpecifier_impl- Returns:
- the framework implementation name
- See Also:
AnalysisEngineDescription.getFrameworkImplementation()
-
setFrameworkImplementation
public void setFrameworkImplementation(java.lang.String aFrameworkImplementation)
Description copied from interface:ResourceCreationSpecifierSets the name of the AE framework implementation within which theResourceCreationSpecifierexecutes. The framework name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME..- Specified by:
setFrameworkImplementationin interfaceAnalysisEngineDescription- Specified by:
setFrameworkImplementationin interfaceResourceCreationSpecifier- Overrides:
setFrameworkImplementationin classResourceCreationSpecifier_impl- Parameters:
aFrameworkImplementation- the framework implementation name- See Also:
AnalysisEngineDescription.setFrameworkImplementation(java.lang.String)
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:AnalysisEngineDescriptionRetrieves 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:
isPrimitivein interfaceAnalysisEngineDescription- Returns:
- true if and only if the AnalysisEngine is primitive
- See Also:
AnalysisEngineDescription.isPrimitive()
-
setPrimitive
public void setPrimitive(boolean aPrimitive)
Description copied from interface:AnalysisEngineDescriptionSets whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).- Specified by:
setPrimitivein interfaceAnalysisEngineDescription- Parameters:
aPrimitive- true if and only if the AnalysisEngine is primitive- See Also:
AnalysisEngineDescription.setPrimitive(boolean)
-
getAnnotatorImplementationName
public java.lang.String getAnnotatorImplementationName()
Description copied from interface:AnalysisEngineDescriptionFor 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:
getAnnotatorImplementationNamein interfaceAnalysisEngineDescription- Returns:
- the implementation name of the annotator. If the AnalysisEngine is aggregate, always
returns
null. - See Also:
AnalysisEngineDescription.getAnnotatorImplementationName()
-
setAnnotatorImplementationName
public void setAnnotatorImplementationName(java.lang.String aImplementationName)
Description copied from interface:AnalysisEngineDescriptionFor 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:
setAnnotatorImplementationNamein interfaceAnalysisEngineDescription- Parameters:
aImplementationName- the implementation name of the annotator.- See Also:
AnalysisEngineDescription.setAnnotatorImplementationName(String)
-
getDelegateAnalysisEngineSpecifiers
public java.util.Map<java.lang.String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers() throws InvalidXMLException
Description copied from interface:AnalysisEngineDescriptionFor an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifiers that indicate which delegate AnalysisEngines comprise the aggregate. EachResourceSpecifiercan 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
ResourceSpecifierobjects. The string identifiers in this Map are to refer to the delegate AnalysisEngines from elsewhere in thisAnalysisEngineDescription. (For example in theFlowConstraintsdescription.)Note that the Map returned by this method will never contain
Importobjects -- 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:
getDelegateAnalysisEngineSpecifiersin interfaceAnalysisEngineDescription- Returns:
- an unmodifiable Map with
Stringkeys andResourceSpecifiervalues. - Throws:
InvalidXMLException- if import resolution failed- See Also:
AnalysisEngineDescription.getDelegateAnalysisEngineSpecifiers()
-
getDelegateAnalysisEngineSpecifiers
public java.util.Map<java.lang.String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException
Description copied from interface:AnalysisEngineDescriptionFor an aggregate AnalysisEngine only, retrieves a collection ofResourceSpecifiers that indicate which delegate AnalysisEngines comprise the aggregate. EachResourceSpecifiercan 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
ResourceSpecifierobjects. The string identifiers in this Map are to refer to the delegate AnalysisEngines from elsewhere in thisAnalysisEngineDescription. (For example in theFlowConstraintsdescription.)Note that the Map returned by this method will never contain
Importobjects -- 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:
getDelegateAnalysisEngineSpecifiersin interfaceAnalysisEngineDescription- Parameters:
aResourceManager- the ResourceManager to use to get the datapath needed to resolve imports- Returns:
- an unmodifiable Map with
Stringkeys andResourceSpecifiervalues. - Throws:
InvalidXMLException- if import resolution failed- See Also:
AnalysisEngineDescription.getDelegateAnalysisEngineSpecifiers()
-
getDelegateAnalysisEngineSpecifiersWithImports
public java.util.Map<java.lang.String,MetaDataObject> getDelegateAnalysisEngineSpecifiersWithImports()
Description copied from interface:AnalysisEngineDescriptionRetrieves a Map whose keys are string identifiers and whose values are the eitherImportorResourceSpecifierobjects. 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
Importobject. If you do not want to deal with imports, use theAnalysisEngineDescription.getDelegateAnalysisEngineSpecifiers()method instead.- Specified by:
getDelegateAnalysisEngineSpecifiersWithImportsin interfaceAnalysisEngineDescription- Returns:
- a Map with
Stringkeys andResourceSpecifierorImportobjects as values. This Map may be modified to add or remove imports or specifiers. - See Also:
AnalysisEngineDescription.getDelegateAnalysisEngineSpecifiersWithImports()
-
getFlowControllerDeclaration
public FlowControllerDeclaration getFlowControllerDeclaration()
Description copied from interface:AnalysisEngineDescriptionFor an aggregate AnalysisEngine only, gets the declaration of which FlowController should be used by the AnalysisEngine.- Specified by:
getFlowControllerDeclarationin 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
public void setFlowControllerDeclaration(FlowControllerDeclaration aFlowControllerDeclaration)
Description copied from interface:AnalysisEngineDescriptionFor an aggregate AnalysisEngine only, sets the declaration of which FlowController should be used by the AnalysisEngine.- Specified by:
setFlowControllerDeclarationin 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 java.util.Map<java.lang.String,ResourceSpecifier> getAllComponentSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException
Description copied from interface:AnalysisEngineDescriptionFor 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
ResourceSpecifierobjects. 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
Importobjects -- 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:
getAllComponentSpecifiersin 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
Stringkeys andResourceSpecifiervalues. - Throws:
InvalidXMLException- if import resolution failed
-
getAnalysisEngineMetaData
public AnalysisEngineMetaData getAnalysisEngineMetaData()
Description copied from interface:AnalysisEngineDescriptionRetrieves 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:
getAnalysisEngineMetaDatain interfaceAnalysisEngineDescription- Returns:
- the
AnalysisEngineMetaDataobject containing the AnalysisEngine's metadata. This object can be modified. - See Also:
AnalysisEngineDescription.getAnalysisEngineMetaData()
-
getSofaMappings
public SofaMapping[] getSofaMappings()
- Specified by:
getSofaMappingsin interfaceAnalysisEngineDescription
-
setSofaMappings
public void setSofaMappings(SofaMapping[] aSofaMappings)
- Specified by:
setSofaMappingsin interfaceAnalysisEngineDescription
-
doFullValidation
public void doFullValidation() throws ResourceInitializationExceptionDescription copied from interface:ResourceCreationSpecifierDoes 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:
doFullValidationin interfaceAnalysisEngineDescription- Specified by:
doFullValidationin interfaceResourceCreationSpecifier- Overrides:
doFullValidationin classResourceCreationSpecifier_impl- Throws:
ResourceInitializationException- if validation failed
-
doFullValidation
public void doFullValidation(ResourceManager aResourceManager) throws ResourceInitializationException
Description copied from interface:ResourceCreationSpecifierDoes 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:
doFullValidationin interfaceAnalysisEngineDescription- Specified by:
doFullValidationin interfaceResourceCreationSpecifier- Overrides:
doFullValidationin 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:
validatein interfaceResourceCreationSpecifier- Overrides:
validatein classResourceCreationSpecifier_impl- Parameters:
aResourceManager- a ResourceManager instance to use to resolve imports by name.- Throws:
ResourceInitializationException- ifaDescis invalidResourceConfigurationException- if the configuration parameter settings inaDescare invalid
-
checkForInvalidParameterOverrides
protected void checkForInvalidParameterOverrides(ConfigurationParameter[] aParams, java.lang.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:
checkForInvalidParameterOverridesin 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
public ResourceSpecifier getComponentSpecifier(java.lang.String key) throws ResourceInitializationException
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:
getComponentSpecifierin 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
protected void validateSofaMappings() throws ResourceInitializationExceptionValidate SofA mappings and inputs/outputs for an aggregate AE.- Throws:
ResourceInitializationException- -
-
declaresSofa
private boolean declaresSofa(AnalysisEngineDescription aDesc, java.lang.String aSofaName)
-
capabilitiesContainSofa
protected boolean capabilitiesContainSofa(java.lang.String aSofaName, boolean aOutput)
-
getAdditionalAttributes
public java.util.List<MetaDataObject_impl.MetaDataAttr> getAdditionalAttributes()
Description copied from class:MetaDataObject_implOverride this method to include additional attributes- Overrides:
getAdditionalAttributesin classMetaDataObject_impl- Returns:
- additional attributes
-
listAttributes
@Deprecated public java.util.List<NameClassPair> 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:
listAttributesin interfaceMetaDataObject- Overrides:
listAttributesin classMetaDataObject_impl- Returns:
- a List containing
NameClassPairobjects, 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.Integerinstead of int). - See Also:
MetaDataObject.listAttributes()
-
toXML
public void toXML(java.io.OutputStream aOutputStream, boolean aPreserveDelegateAnalysisEngineImports) throws org.xml.sax.SAXException, java.io.IOExceptionDescription copied from interface:AnalysisEngineDescriptionWrites this object's XML representation as a string in UTF-8 encoding.- Specified by:
toXMLin 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:
org.xml.sax.SAXException- if a SAX exception occursjava.io.IOException- if an I/O failure occurs
-
toXML
public void toXML(java.io.Writer aWriter, boolean aPreserveDelegateAnalysisEngineImports) throws org.xml.sax.SAXException, java.io.IOExceptionDescription copied from interface:AnalysisEngineDescriptionWrites 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:
toXMLin 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:
org.xml.sax.SAXException- if a SAX exception occursjava.io.IOException- if an I/O failure occurs
-
toXML
public void toXML(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute, boolean aPreserveDelegateAnalysisEngineImports) throws org.xml.sax.SAXExceptionDescription copied from interface:AnalysisEngineDescriptionWrites this object's XML representation by making calls on a SAXContentHandler.- Specified by:
toXMLin 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:
org.xml.sax.SAXException- if a SAX exception occurs
-
resolveImports
public void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
Description copied from interface:AnalysisEngineDescriptionResolves 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:
resolveImportsin 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(java.util.Collection<java.lang.String> aAlreadyImportedDelegateAeUrls, ResourceManager aResourceManager) throws InvalidXMLExceptionDescription copied from interface:AnalysisEngineDescriptionResolves 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:
resolveImportsin 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(java.util.Collection<java.lang.String> aEnclosingAggregateAeUrls, ResourceManager aResourceManager, boolean aRecursive) throws InvalidXMLExceptionResolves 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
public java.lang.Object clone()
Description copied from interface:MetaDataObjectCreates a clone of thisMetaDataObject. This performs a "deep" copy by cloning all attribute values that are also MetaDataObjects.- Specified by:
clonein interfaceMetaDataObject- Overrides:
clonein classMetaDataObject_impl- Returns:
- a clone of this
MetaDataObject - See Also:
multi-core: could be cloning while another thread is modifying?
-
writePropertyAsElement
protected void writePropertyAsElement(PropertyXmlInfo aPropInfo, java.lang.String aNamespace) throws org.xml.sax.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:
writePropertyAsElementin classMetaDataObject_impl- Parameters:
aPropInfo- -aNamespace- -- Throws:
org.xml.sax.SAXException- -- See Also:
MetaDataObject_impl.writePropertyAsElement(PropertyXmlInfo, String)
-
readPropertyValueFromXMLElement
protected void readPropertyValueFromXMLElement(PropertyXmlInfo aPropXmlInfo, org.w3c.dom.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:
readPropertyValueFromXMLElementin 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:
MetaDataObject_impl.readPropertyValueFromXMLElement(PropertyXmlInfo, Element, XMLParser, XMLParser.ParsingOptions)
-
buildFromXMLElement
public void buildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLExceptionOverridden to set default operational properties if they are not specified in descriptor.- Specified by:
buildFromXMLElementin interfaceXMLizable- Overrides:
buildFromXMLElementin classMetaDataObject_impl- Parameters:
aElement- -aParser- -aOptions- -- Throws:
InvalidXMLException- -
-
getXmlizationInfo
protected XmlizationInfo getXmlizationInfo()
Description copied from class:MetaDataObject_implTo be implemented by subclasses to return information describing how to represent this object in XML.- Overrides:
getXmlizationInfoin classResourceCreationSpecifier_impl- Returns:
- information defining this object's XML representation
-
getXmlizationInfoForClass
protected static XmlizationInfo 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
-
-