Interface MetaDataObject
- All Superinterfaces:
Cloneable,Serializable,XMLizable
- All Known Subinterfaces:
AllowedValue,AnalysisEngineDescription,AnalysisEngineMetaData,Capability,CapabilityLanguageFlow,CasConsumerDescription,CasInitializerDescription,CasProcessorDeploymentParam,CasProcessorErrorHandling,CasProcessorErrorRateThreshold,CasProcessorExecArg,CasProcessorExecutable,CasProcessorFilter,CasProcessorMaxRestarts,CasProcessorRunInSeperateProcess,CasProcessorRuntimeEnvParam,CasProcessorTimeout,CollectionReaderDescription,ConfigurableDataResourceSpecifier,ConfigurationGroup,ConfigurationParameter,ConfigurationParameterDeclarations,ConfigurationParameterSettings,CpeCasProcessor,CpeCasProcessors,CpeCheckpoint,CpeCollectionReader,CpeCollectionReaderCasInitializer,CpeCollectionReaderIterator,CpeComponentDescriptor,CpeConfiguration,CpeDescription,CpeInclude,CpeIntegratedCasProcessor,CpeLocalCasProcessor,CpeRemoteCasProcessor,CpeResourceManagerConfiguration,CpeSofaMapping,CpeSofaMappings,CustomResourceSpecifier,ExternalResourceBinding,ExternalResourceDependency,ExternalResourceDescription,FeatureDescription,FileLanguageResourceSpecifier,FileResourceSpecifier,FixedFlow,FlowConstraints,FlowControllerDeclaration,FlowControllerDescription,FsIndexCollection,FsIndexDescription,FsIndexKeyDescription,Import,JMSMessagingSpecifier,LanguagePrecondition,MailMessagingSpecifier,MessagingSpecifier,MimeTypePrecondition,MQMessagingSpecifier,NameValuePair,OutputQueue,Parameter,PearSpecifier,Precondition,ProcessingResourceMetaData,ResourceCreationSpecifier,ResourceManagerConfiguration,ResourceMetaData,ResourceServiceSpecifier,ResourceSpecifier,ResourceSpecifierList,SimplePrecondition,SofaMapping,TaeDescription,TypeDescription,TypeOrFeature,TypePriorities,TypePriorityList,TypeSystemDescription,URISpecifier
- All Known Implementing Classes:
AllowedValue_impl,AnalysisEngineDescription_impl,AnalysisEngineMetaData_impl,Attribute_impl,Capability_impl,CapabilityLanguageFlow_impl,CasConsumerDescription_impl,CasInitializerDescription_impl,CollectionReaderDescription_impl,ConfigurableDataResourceSpecifier_impl,ConfigurationGroup_impl,ConfigurationParameter_impl,ConfigurationParameterDeclarations_impl,ConfigurationParameterSettings_impl,CustomResourceSpecifier_impl,ExternalResourceBinding_impl,ExternalResourceDependency_impl,ExternalResourceDescription_impl,FeatureDescription_impl,FileLanguageResourceSpecifier_impl,FileResourceSpecifier_impl,Filter_impl,FixedFlow_impl,FlowControllerDeclaration_impl,FlowControllerDescription_impl,FsIndexCollection_impl,FsIndexDescription_impl,FsIndexKeyDescription_impl,Import_impl,IndexBuildItem_impl,IndexBuildSpecification_impl,IndexRule_impl,LanguagePrecondition_impl,Mapping_impl,MetaDataObject_impl,MimeTypePrecondition_impl,NameValuePair_impl,OperationalProperties_impl,Parameter_impl,PearSpecifier_impl,ProcessingResourceMetaData_impl,ResourceCreationSpecifier_impl,ResourceManagerConfiguration_impl,ResourceMetaData_impl,ResultSpecification_impl,SimplePrecondition_impl,SofaMapping_impl,Style_impl,TaeDescription_impl,TypeDescription_impl,TypeOrFeature_impl,TypePriorities_impl,TypePriorityList_impl,TypeSystemDescription_impl,URISpecifier_impl
Resource.
A list of all attributes on a MetaDataObject can be obtained by calling its
listAttributes() method. The values of attributes can be get and set by using the
getAttributeValue(String) and setAttributeValue(String,Object) methods. The
value of an attribute may be any Object, including another MetaDataObject.
MetaDataObjects are not required to allow modification of their attributes' values.
An application should check the isModifiable() method to determine if attribute values
can be modified. Calling setAttributeValue(String,Object) on an unmodifiable object will
result in a UIMA_UnsupportedOperationException.
-
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a clone of thisMetaDataObject.booleanDetermines if this object is equal to another.getAttributeValue(String aName) Retrieves the value of an attribute of thisMetaDataObject.Gets the URL from which this object was parsed.If the sourceURL of this object is non-null, returns its string representation.booleanReturns whether thisMetaDataObjectallows the values of its attributes to be modified.Deprecated.- use getAttributes() instead, don't override it, use getAdditionalAttributes to specify additional onesvoidsetAttributeValue(String aName, Object aValue) Sets the value of an attribute of thisMetaDataObject.voidsetSourceUrl(URL aUrl) Sets the URL from which this object was parsed.Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
Method Details
-
listAttributes
Deprecated.- use getAttributes() instead, don't override it, use getAdditionalAttributes to specify additional onesRetrieves all attributes on thisMetaDataObject.- 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).
-
getAttributeValue
Retrieves the value of an attribute of thisMetaDataObject.- Parameters:
aName- the name of the parameter to get- Returns:
- the value of the parameter named
aName. Returnsnullif there is no attribute with that name.
-
isModifiable
boolean isModifiable()Returns whether thisMetaDataObjectallows the values of its attributes to be modified.- Returns:
- true if and only if this object's attributes may be modified.
-
setAttributeValue
Sets the value of an attribute of thisMetaDataObject. Applications should first check theisModifiable()method; callingsetAttributeValue(String, Object)on an unmodifiableMetaDataObjectwill result in an exception.- Parameters:
aName- the name of the parameter to setaValue- the value to assign to the parameter- Throws:
UIMA_UnsupportedOperationException- if thisMetaDataObjectis not modifiable.UIMA_IllegalArgumentException- if the given value is not appropriate for the given attribute.
-
clone
Object clone()Creates a clone of thisMetaDataObject. This performs a "deep" copy by cloning all attribute values that are also MetaDataObjects.- Returns:
- a clone of this
MetaDataObject
-
equals
Determines if this object is equal to another. Two MetaDataObjects are equal if they share the same attributes and the same values for those attributes. -
getSourceUrl
URL getSourceUrl()Gets the URL from which this object was parsed. When this object is parsed from an XML file, this is set by the parser to the URL of the source file XML file. If the object has been created by some other method, the source URL will not be known, and this method will return null.This setting is used to resolve imports and is also included in exception messages to indicate the source of the problem.
- Returns:
- the source URL from which this object was parsed
-
getSourceUrlString
String getSourceUrlString()If the sourceURL of this object is non-null, returns its string representation. If it is null, returns "<unknown>". Useful for error messages.- Returns:
- the source URL as a string, or "<unknown>"
-
setSourceUrl
Sets the URL from which this object was parsed. Typically only the XML parser sets this. This recursively sets the source URL of all descendants of this object.- Parameters:
aUrl- the location of the XML file from which this object was parsed
-