Package org.apache.uima.resource.impl
Class ResourceCreationSpecifier_impl
java.lang.Object
org.apache.uima.resource.metadata.impl.MetaDataObject_impl
org.apache.uima.resource.impl.ResourceCreationSpecifier_impl
- All Implemented Interfaces:
- Serializable,- Cloneable,- MetaDataObject,- ResourceCreationSpecifier,- ResourceSpecifier,- XMLizable
- Direct Known Subclasses:
- AnalysisEngineDescription_impl,- CasConsumerDescription_impl,- CasInitializerDescription_impl,- CollectionReaderDescription_impl,- FlowControllerDescription_impl
public class ResourceCreationSpecifier_impl
extends MetaDataObject_impl
implements ResourceCreationSpecifier
Reference implementation of 
ResourceCreationSpecifier.- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_implMetaDataObject_impl.MetaDataAttr, MetaDataObject_impl.SerialContext, MetaDataObject_impl.Serializer
- 
Field SummaryFields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_implserialContext
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidChecks for duplicate parameter names and throws an exception if any are found.protected voidcheckForInvalidParameterOverrides(ConfigurationParameter[] aParams, String aGroupName, ResourceManager aResourceManager) Checks parameter overrides and throws a ResourceInitializationException if they are invalid.voidDoes full validation of thisResourceCreationSpecifier.voiddoFullValidation(ResourceManager aResourceManager) Does full validation of thisResourceCreationSpecifier.Retrieves descriptions of thisResourceCreationSpecifier's dependencies on external resources.Gets the external resource dependency with the given key.Gets the name of the AE framework implementation within which the Resource executes.Retrieves the name of thisResourceCreationSpecifier's implementation.Retrieves theResourceMetaDatato assign to the newly constructedResourceCreationSpecifier.Retrieves the Resource Manager configuration, which declares the resources that satisfy the dependencies defined byResourceCreationSpecifier.getExternalResourceDependencies().protected XmlizationInfoTo be implemented by subclasses to return information describing how to represent this object in XML.voidsetExternalResourceDependencies(ExternalResourceDependency... aDependencies) Sets the descriptions of thisResourceCreationSpecifier's dependencies on external resources.voidsetFrameworkImplementation(String aFrameworkImplementation) Sets the name of the AE framework implementation within which theResourceCreationSpecifierexecutes.voidsetImplementationName(String aImplementationName) Sets the name of thisResourceCreationSpecifier's implementation.voidsetMetaData(ResourceMetaData aMetaData) Sets the MetaData for thisResourceCreationSpecifier_impl.voidsetResourceManagerConfiguration(ResourceManagerConfiguration aResourceManagerConfiguration) Sets the Resource Manager configuration, which declares the resources that satisfy the dependencies defined byResourceCreationSpecifier.getExternalResourceDependencies().final voidvalidate()Determines if the AnalysisEngineDescription is valid.voidvalidate(ResourceManager aResourceManager) Checks that thisResourceCreationSpecifieris valid.protected voidvalidateConfigurationParameters(ResourceManager aResourceManager) Validates configuration parameters within this Resource, and throws an exception if they are not valid.Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_implbuildFromXMLElement, buildFromXMLElement, clone, equals, getAdditionalAttributes, getAttributeClass, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, valueIsNullOrEmptyArray, writeArrayPropertyAsElement, writeMapPropertyToXml, writePropertyAsElementMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.uima.resource.metadata.MetaDataObjectclone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrlMethods inherited from interface org.apache.uima.util.XMLizablebuildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
- 
Constructor Details- 
ResourceCreationSpecifier_implpublic ResourceCreationSpecifier_impl()
 
- 
- 
Method Details- 
getFrameworkImplementationDescription 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 interface- ResourceCreationSpecifier
- Returns:
- the framework implementation name
- See Also:
 
- 
setFrameworkImplementationDescription 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 interface- ResourceCreationSpecifier
- Parameters:
- aFrameworkImplementation- the framework implementation name
- See Also:
 
- 
getImplementationNameDescription copied from interface:ResourceCreationSpecifierRetrieves the name of thisResourceCreationSpecifier's implementation. This must be a fully qualified Java class name.- Specified by:
- getImplementationNamein interface- ResourceCreationSpecifier
- Returns:
- the implementation name of the CasConsumer
- See Also:
 
- 
setImplementationNameDescription copied from interface:ResourceCreationSpecifierSets the name of thisResourceCreationSpecifier's implementation. This must be a fully qualified Java class name.- Specified by:
- setImplementationNamein interface- ResourceCreationSpecifier
- Parameters:
- aImplementationName- the implementation name of the CasConsumer
- See Also:
 
- 
getMetaDataDescription copied from interface:ResourceCreationSpecifierRetrieves theResourceMetaDatato assign to the newly constructedResourceCreationSpecifier.- Specified by:
- getMetaDatain interface- ResourceCreationSpecifier
- Returns:
- the metadata for the new resource. This will always be modifiable.
- See Also:
 
- 
setMetaDataSets the MetaData for thisResourceCreationSpecifier_impl. Users should not do this, so this method is not published through theResourceCreationSpecifierinterface.- Specified by:
- setMetaDatain interface- ResourceCreationSpecifier
- Parameters:
- aMetaData- metadata to assign
 
- 
getExternalResourceDependenciesDescription copied from interface:ResourceCreationSpecifierRetrieves descriptions of thisResourceCreationSpecifier's dependencies on external resources. Each required external resource is assigned a String identifier. This is the identifier that thisResourceCreationSpecifiercan use to locate the Resource (using theUimaContext.getResourceObject(String)method).- Specified by:
- getExternalResourceDependenciesin interface- ResourceCreationSpecifier
- Returns:
- an array of ExternalResourceDependencyobjects that describe this AnalysisEngine's resource dependencies.
- See Also:
 
- 
setExternalResourceDependenciesDescription copied from interface:ResourceCreationSpecifierSets the descriptions of thisResourceCreationSpecifier's dependencies on external resources.- Specified by:
- setExternalResourceDependenciesin interface- ResourceCreationSpecifier
- Parameters:
- aDependencies- an array of- ExternalResourceDependencyobjects that describe this- ResourceCreationSpecifier's resource dependencies.
- See Also:
 
- 
getExternalResourceDependencyDescription copied from interface:ResourceCreationSpecifierGets the external resource dependency with the given key.- Specified by:
- getExternalResourceDependencyin interface- ResourceCreationSpecifier
- Parameters:
- aKey- the key of the external resource dependency to get
- Returns:
- the resource dependency with the specified key, nullif none.
- See Also:
 
- 
getResourceManagerConfigurationDescription copied from interface:ResourceCreationSpecifierRetrieves the Resource Manager configuration, which declares the resources that satisfy the dependencies defined byResourceCreationSpecifier.getExternalResourceDependencies().- Specified by:
- getResourceManagerConfigurationin interface- ResourceCreationSpecifier
- Returns:
- the Resource Manager configuration that describes how external resource dependencies are bound to actual resources.
 
- 
setResourceManagerConfigurationpublic void setResourceManagerConfiguration(ResourceManagerConfiguration aResourceManagerConfiguration) Description copied from interface:ResourceCreationSpecifierSets the Resource Manager configuration, which declares the resources that satisfy the dependencies defined byResourceCreationSpecifier.getExternalResourceDependencies().- Specified by:
- setResourceManagerConfigurationin interface- ResourceCreationSpecifier
- Parameters:
- aResourceManagerConfiguration- the Resource Manager configuration that describes how external resource dependencies are bound to actual resources.
 
- 
doFullValidationDescription 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 interface- ResourceCreationSpecifier
- Throws:
- ResourceInitializationException- if validation failed
 
- 
doFullValidationpublic 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 interface- ResourceCreationSpecifier
- Parameters:
- aResourceManager- a ResourceManager instance to use to load annotator classes, external resource classes, and resolve imports by name.
- Throws:
- ResourceInitializationException- if validation failed
 
- 
validateDetermines 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 interface- ResourceCreationSpecifier
- Throws:
- ResourceInitializationException- if- aDescis invalid
- ResourceConfigurationException- if the configuration parameter settings in- aDescare invalid
 
- 
validatepublic void validate(ResourceManager aResourceManager) throws ResourceInitializationException, ResourceConfigurationException Description copied from interface:ResourceCreationSpecifierChecks that thisResourceCreationSpecifieris valid. An exception is thrown if it is not valid. This only does fairly lightweight checking. To do a more complete but more expensive check, useResourceCreationSpecifier.doFullValidation().- Specified by:
- validatein interface- ResourceCreationSpecifier
- Parameters:
- aResourceManager- a ResourceManager instance to use to resolve imports by name.
- Throws:
- ResourceInitializationException- if- aDescis invalid
- ResourceConfigurationException- if the configuration parameter settings in- aDescare invalid
 
- 
validateConfigurationParametersprotected void validateConfigurationParameters(ResourceManager aResourceManager) throws ResourceInitializationException Validates configuration parameters within this Resource, and throws an exception if they are not valid.This method checks to make sure that there are no duplicate configuration group names or duplicate parameter names within groups. For aggregates, it also checks that parameter overrides are valid, and logs a warning for parameters with no overrides. (For primitives, there should be no overrides.) - Parameters:
- aResourceManager- used to resolve import by name. This is necessary to validate configuration parameter overrides.
- Throws:
- ResourceInitializationException- if the configuration parameters are invalid
 
- 
checkForDuplicateParameterNamesprotected void checkForDuplicateParameterNames(ConfigurationParameter[] aParams) throws ResourceInitializationException Checks for duplicate parameter names and throws an exception if any are found.- Parameters:
- aParams- an array of ConfigurationParameters
- Throws:
- ResourceInitializationException- if there is a duplicate parameter name in the arrays
 
- 
checkForInvalidParameterOverridesprotected void checkForInvalidParameterOverrides(ConfigurationParameter[] aParams, String aGroupName, ResourceManager aResourceManager) throws ResourceInitializationException Checks parameter overrides and throws a ResourceInitializationException if they are invalid. Note that since overrides are invalid in primitive components, this default implementation throws an exception for ANY parameter override it finds. AnalysisEngineDescription_impl overrides this method to correctly handle parameter overrides in aggregates.- Parameters:
- aParams- an array of ConfigurationParameters
- aGroupName- name of groups in which these parameters are contained. Null if no group
- aResourceManager- used to resolve imports by name.
- Throws:
- ResourceInitializationException- if there is an invalid parameter override declaration
 
- 
getXmlizationInfoDescription copied from class:MetaDataObject_implTo be implemented by subclasses to return information describing how to represent this object in XML.- Specified by:
- getXmlizationInfoin class- MetaDataObject_impl
- Returns:
- information defining this object's XML representation
 
 
-