|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AnalysisEngineDescription
An AnalysisEngineDescription
contains all of the information needed to instantiate
and use an AnalysisEngine
.
The UIMAFramework.produceAnalysisEngine(ResourceSpecifier)
factory method
is used to create an AnalysisEngine instance from a AnalysisEngineDescription
.
This insulates applications from knowledge of the particular AnalysisEngine implementation being
used.
The AnalysisEngine Description contains the following information:
For a Primitive AnalysisEngine:
For an Aggregate AnalysisEngine:
For All AnalysisEngines:
Metadata
for this AnalysisEngine - this includes the
capabilities of this AnalysisEngine, the TypeSystem used by this AnalysisEngine, and other
parameters.
Method Summary | |
---|---|
void |
doFullValidation()
Does full validation of this Analysis Engine Description. |
void |
doFullValidation(ResourceManager aResourceManager)
Does full validation of this Analysis Engine Description. |
Map<String,ResourceSpecifier> |
getAllComponentSpecifiers(ResourceManager aResourceManager)
For an aggregate AnalysisEngine only, gets the ResourceSpecifiers of all components in this aggregate. |
AnalysisEngineMetaData |
getAnalysisEngineMetaData()
Retrieves the metadata that describes the AnalysisEngine. |
String |
getAnnotatorImplementationName()
For a primitive AnalysisEngine only, retrieves the name of the annotator implementation. |
ResourceSpecifier |
getComponentSpecifier(String key)
Gets the ResourceSpecifier of one a component of this aggregate, based on its key. |
Map<String,ResourceSpecifier> |
getDelegateAnalysisEngineSpecifiers()
For an aggregate AnalysisEngine only, retrieves a collection of ResourceSpecifier s
that indicate which delegate AnalysisEngines comprise the aggregate. |
Map<String,ResourceSpecifier> |
getDelegateAnalysisEngineSpecifiers(ResourceManager aResourceManager)
For an aggregate AnalysisEngine only, retrieves a collection of ResourceSpecifier s
that indicate which delegate AnalysisEngines comprise the aggregate. |
Map<String,MetaDataObject> |
getDelegateAnalysisEngineSpecifiersWithImports()
Retrieves a Map whose keys are string identifiers and whose values are the either Import or ResourceSpecifier objects. |
FlowControllerDeclaration |
getFlowControllerDeclaration()
For an aggregate AnalysisEngine only, gets the declaration of which FlowController should be used by the AnalysisEngine. |
String |
getFrameworkImplementation()
Gets the name of the framework implementation within which the AnalysisEngine executes. |
SofaMapping[] |
getSofaMappings()
Reserved for future use. |
boolean |
isPrimitive()
Retrieves whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines). |
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 framework implementation within which the AnalysisEngine 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)
Reserved for future use. |
void |
toXML(ContentHandler aContentHandler,
boolean aWriteDefaultNamespaceAttribute,
boolean aPreserveDelegateAnalysisEngineImports)
Writes this object's XML representation by making calls on a SAX ContentHandler . |
void |
toXML(OutputStream aOutputStream,
boolean aPreserveDelegateAnalysisEngineImports)
Writes this object's XML representation as a string in UTF-8 encoding. |
void |
toXML(Writer aWriter,
boolean aPreserveDelegateAnalysisEngineImports)
Writes this object's XML representation as a string. |
Methods inherited from interface org.apache.uima.resource.ResourceCreationSpecifier |
---|
getExternalResourceDependencies, getExternalResourceDependency, getImplementationName, getMetaData, getResourceManagerConfiguration, setExternalResourceDependencies, setImplementationName, setMetaData, setResourceManagerConfiguration, validate, validate |
Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject |
---|
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl |
Methods inherited from interface org.apache.uima.util.XMLizable |
---|
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML |
Method Detail |
---|
String getFrameworkImplementation()
Constants.JAVA_FRAMEWORK_NAME
.
getFrameworkImplementation
in interface ResourceCreationSpecifier
void setFrameworkImplementation(String aFrameworkImplementation)
Constants.JAVA_FRAMEWORK_NAME
.
setFrameworkImplementation
in interface ResourceCreationSpecifier
aFrameworkImplementation
- the framework implementation nameboolean isPrimitive()
Some of the methods on this class apply only to one type of AnalysisEngine:
getAnnotatorImplementationName()
- primitive AnalysisEngine only
getDelegateAnalysisEngineSpecifiers()
- aggregate AnalysisEngine only
#getFlowController()
- aggregate AnalysisEngine only
void setPrimitive(boolean aPrimitive)
aPrimitive
- true if and only if the AnalysisEngine is primitiveString getAnnotatorImplementationName()
null
.void setAnnotatorImplementationName(String aImplementationName)
aImplementationName
- the implementation name of the annotator.Map<String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers() throws InvalidXMLException
ResourceSpecifier
s
that indicate which delegate AnalysisEngines comprise the aggregate. Each
ResourceSpecifier
can either:
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 this AnalysisEngineDescription
.
(For example in the FlowConstraints
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, use
getDelegateAnalysisEngineSpecifiersWithImports()
. Also use that method if you want to
be able to make changes to the Map.
String
keys and ResourceSpecifier
values.
InvalidXMLException
- if import resolution failedMap<String,ResourceSpecifier> getDelegateAnalysisEngineSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException
ResourceSpecifier
s
that indicate which delegate AnalysisEngines comprise the aggregate. Each
ResourceSpecifier
can either:
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 this AnalysisEngineDescription
.
(For example in the FlowConstraints
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, use
getDelegateAnalysisEngineSpecifiersWithImports()
. Also use that method if you want to
be able to make changes to the Map.
aResourceManager
- the ResourceManager to use to get the datapath needed to resolve imports
String
keys and ResourceSpecifier
values.
InvalidXMLException
- if import resolution failedMap<String,MetaDataObject> getDelegateAnalysisEngineSpecifiersWithImports()
Import
or ResourceSpecifier
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 the getDelegateAnalysisEngineSpecifiers()
method instead.
String
keys and ResourceSpecifier
or
Import
objects as values. This Map may be
modified to add or remove imports or specifiers.FlowControllerDeclaration getFlowControllerDeclaration()
void setFlowControllerDeclaration(FlowControllerDeclaration aFlowControllerDeclaration)
aFlowControllerDeclaration
- an object containing either an import of a ResourceSpecifier or a ResourceSpecifier
itself. This specifier will be used to create the FlowController.Map<String,ResourceSpecifier> getAllComponentSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException
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, use
getDelegateAnalysisEngineSpecifiersWithImports()
and #getFlowController()
.
Also use those methods if you want to make changes to be able to make changes to the Map.
aResourceManager
- the ResourceManager from which to get the datapath needed to resolve imports. Pass
null to use the default ResourceManager.
String
keys and ResourceSpecifier
values.
InvalidXMLException
- if import resolution failedAnalysisEngineMetaData getAnalysisEngineMetaData()
AnalysisEngineMetaData
object containing the AnalysisEngine's
metadata. This object can be modified.SofaMapping[] getSofaMappings()
void setSofaMappings(SofaMapping[] aSofaMappings)
ResourceSpecifier getComponentSpecifier(String key) throws ResourceInitializationException
key
- the key of the component specifier to get
ResourceInitializationException
- if there's a problem resolving importsvoid doFullValidation() throws ResourceInitializationException
doFullValidation
in interface ResourceCreationSpecifier
ResourceInitializationException
- if validation failedvoid doFullValidation(ResourceManager aResourceManager) throws ResourceInitializationException
doFullValidation
in interface ResourceCreationSpecifier
aResourceManager
- a ResourceManager instance to use to load annotator classes, external resource
classes, and resolve imports by name.
ResourceInitializationException
- if validation failedvoid resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
UIMAFramework.produceAnalysisEngine(ResourceSpecifier)
is called.
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 the
ResourceManager.setDataPath(String)
method.
InvalidXMLException
- if an import target does not exist or is invalidvoid resolveImports(Collection<String> aAlreadyImportedDelegateAeUrls, ResourceManager aResourceManager) throws InvalidXMLException
UIMAFramework.produceAnalysisEngine(ResourceSpecifier)
is called.
This version is used internally to resolve nested imports.
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 the
ResourceManager.setDataPath(String)
method.
InvalidXMLException
- if an import target does not exist or is invalidvoid toXML(Writer aWriter, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException, IOException
XMLizable.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.
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.
IOException
- if an I/O failure occurs
SAXException
void toXML(OutputStream aOutputStream, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException, IOException
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.
IOException
- if an I/O failure occurs
SAXException
void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute, boolean aPreserveDelegateAnalysisEngineImports) throws SAXException
ContentHandler
.
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.
IOException
- if an I/O failure occurs
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |