Class SimplePrecondition_impl
- java.lang.Object
-
- org.apache.uima.resource.metadata.impl.MetaDataObject_impl
-
- org.apache.uima.resource.metadata.impl.SimplePrecondition_impl
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,MetaDataObject
,Precondition
,SimplePrecondition
,XMLizable
- Direct Known Subclasses:
LanguagePrecondition_impl
,MimeTypePrecondition_impl
public class SimplePrecondition_impl extends MetaDataObject_impl implements SimplePrecondition
Reference implementation ofSimplePrecondition
.- 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 private java.lang.Object
mComparisonValue
Value to compare against the feature.private boolean
mDefault
private java.lang.String
mFeatureName
private java.lang.String
mFsIndexName
private FSMatchConstraint
mFsMatchConstraint
private java.lang.String
mPredicate
Predicate used to compare.(package private) static long
serialVersionUID
private static XmlizationInfo
XMLIZATION_INFO
-
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
Fields inherited from interface org.apache.uima.resource.metadata.SimplePrecondition
ELEMENT_OF, EQUAL, LANGUAGE_SUBSUMED, PRECONDITION_TYPE
-
-
Constructor Summary
Constructors Constructor Description SimplePrecondition_impl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(CAS aCAS)
Determines if this precondition is satisfied by a CAS.java.lang.Object
getComparisonValue()
Retrieves the literal value to which features' values will be compared.boolean
getDefault()
Retrieves the default value for this precondition.java.lang.String
getFeatureName()
Gets the name of the feature to be tested.java.lang.String
getFsIndexName()
Retrieves the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.FSMatchConstraint
getFsMatchConstraint()
Retrieves the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.java.lang.String
getPreconditionType()
Gets the type of this precondition.java.lang.String
getPredicate()
Retrieves the predicate used to compare the test value to the comparison value.protected XmlizationInfo
getXmlizationInfo()
To be implemented by subclasses to return information describing how to represent this object in XML.protected static boolean
isValidPredicateName(java.lang.Object aName)
Determines whether the given String is a valid name a predicate defined by this class.void
setComparisonValue(java.lang.Object aValue)
Sets the literal value to which features' values will be compared.void
setDefault(boolean aDefault)
Sets the default value for this precondition.void
setFeatureName(java.lang.String aFeatureName)
Sets the name of the feature to be tested.void
setFsIndexName(java.lang.String aIndexName)
Sets the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.void
setFsMatchConstraint(FSMatchConstraint aConstraint)
Sets the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.void
setPredicate(java.lang.String aPredicate)
Sets the predicate used to compare the test value to the comparison value.-
Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, buildFromXMLElement, clone, equals, getAdditionalAttributes, getAttributeClass, getAttributes, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getUnfilteredAttributes, getWrapperClass, getXMLAttributes, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, valueIsNullOrEmptyArray, writeArrayPropertyAsElement, writeMapPropertyToXml, writePropertyAsElement
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
mComparisonValue
private java.lang.Object mComparisonValue
Value to compare against the feature.
-
mPredicate
private java.lang.String mPredicate
Predicate used to compare.
-
mFsMatchConstraint
private FSMatchConstraint mFsMatchConstraint
-
mFsIndexName
private java.lang.String mFsIndexName
-
mFeatureName
private java.lang.String mFeatureName
-
mDefault
private boolean mDefault
-
XMLIZATION_INFO
private static final XmlizationInfo XMLIZATION_INFO
-
-
Method Detail
-
getPreconditionType
public java.lang.String getPreconditionType()
Description copied from interface:SimplePrecondition
Gets the type of this precondition. Each sub-interface ofPrecondition
has its own standard type identifier String. These identifier Strings are used instead of Java class names in order to ease portability of metadata to other languages.- Specified by:
getPreconditionType
in interfacePrecondition
- Specified by:
getPreconditionType
in interfaceSimplePrecondition
- Returns:
SimplePrecondition.PRECONDITION_TYPE
- See Also:
Precondition.getPreconditionType()
-
getDefault
public boolean getDefault()
Description copied from interface:SimplePrecondition
Retrieves the default value for this precondition. This is the value returned if there is no applicable test value in the CAS.- Specified by:
getDefault
in interfaceSimplePrecondition
- Returns:
- the default value
- See Also:
SimplePrecondition.getDefault()
-
getFeatureName
public java.lang.String getFeatureName()
Description copied from interface:SimplePrecondition
Gets the name of the feature to be tested.- Specified by:
getFeatureName
in interfaceSimplePrecondition
- Returns:
- the feature name,
null
if none - See Also:
SimplePrecondition.getFeatureName()
-
getFsIndexName
public java.lang.String getFsIndexName()
Description copied from interface:SimplePrecondition
Retrieves the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.- Specified by:
getFsIndexName
in interfaceSimplePrecondition
- Returns:
- the name of the FS index,
null
if the default annotation index should be used - See Also:
SimplePrecondition.getFsIndexName()
-
getFsMatchConstraint
public FSMatchConstraint getFsMatchConstraint()
Description copied from interface:SimplePrecondition
Retrieves the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.- Specified by:
getFsMatchConstraint
in interfaceSimplePrecondition
- Returns:
- the FS match constraint,
null
if none - See Also:
SimplePrecondition.getFsMatchConstraint()
-
setDefault
public void setDefault(boolean aDefault)
Description copied from interface:SimplePrecondition
Sets the default value for this precondition. This is the value returned if there is no applicable test value in the CAS.- Specified by:
setDefault
in interfaceSimplePrecondition
- Parameters:
aDefault
- the default value- See Also:
SimplePrecondition.setDefault(boolean)
-
setFeatureName
public void setFeatureName(java.lang.String aFeatureName)
Description copied from interface:SimplePrecondition
Sets the name of the feature to be tested.- Specified by:
setFeatureName
in interfaceSimplePrecondition
- Parameters:
aFeatureName
- the feature name,null
if none- See Also:
SimplePrecondition.setFeatureName(java.lang.String)
-
setFsIndexName
public void setFsIndexName(java.lang.String aIndexName)
Description copied from interface:SimplePrecondition
Sets the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.- Specified by:
setFsIndexName
in interfaceSimplePrecondition
- Parameters:
aIndexName
- the name of the FS index,null
if the default annotation index should be used- See Also:
SimplePrecondition.setFsIndexName(java.lang.String)
-
setFsMatchConstraint
public void setFsMatchConstraint(FSMatchConstraint aConstraint)
Description copied from interface:SimplePrecondition
Sets the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.- Specified by:
setFsMatchConstraint
in interfaceSimplePrecondition
- Parameters:
aConstraint
- the FS match constraint,null
if none- See Also:
SimplePrecondition.setFsMatchConstraint(org.apache.uima.cas.FSMatchConstraint)
-
evaluate
public boolean evaluate(CAS aCAS)
Description copied from interface:Precondition
Determines if this precondition is satisfied by a CAS.- Specified by:
evaluate
in interfacePrecondition
- Parameters:
aCAS
- the CAS against which to evaluate this precondition- Returns:
- true if and only if the CAS satisfies this precondition.
- See Also:
Precondition.evaluate(org.apache.uima.cas.CAS)
-
getComparisonValue
public java.lang.Object getComparisonValue()
Description copied from interface:SimplePrecondition
Retrieves the literal value to which features' values will be compared.- Specified by:
getComparisonValue
in interfaceSimplePrecondition
- Returns:
- the value, which must be a String, Integer, Float, Boolean or an array of one of those four types.
- See Also:
SimplePrecondition.getComparisonValue()
-
setComparisonValue
public void setComparisonValue(java.lang.Object aValue)
Description copied from interface:SimplePrecondition
Sets the literal value to which features' values will be compared.- Specified by:
setComparisonValue
in interfaceSimplePrecondition
- Parameters:
aValue
- the comparison value, which must be a String, Integer, Float, Boolean, or an array of one of those four types.- See Also:
SimplePrecondition.setComparisonValue(Object)
-
getPredicate
public java.lang.String getPredicate()
Description copied from interface:SimplePrecondition
Retrieves the predicate used to compare the test value to the comparison value.- Specified by:
getPredicate
in interfaceSimplePrecondition
- Returns:
- a String that identifies the predicate used. This will always match one of the constants defined on this interface.
- See Also:
SimplePrecondition.getPredicate()
-
setPredicate
public void setPredicate(java.lang.String aPredicate)
Description copied from interface:SimplePrecondition
Sets the predicate used to compare the test value to the comparison value.- Specified by:
setPredicate
in interfaceSimplePrecondition
- Parameters:
aPredicate
- a String that identifies the predicate used. This must match one of the constants defined on this interface.- See Also:
SimplePrecondition.setPredicate(String)
-
isValidPredicateName
protected static boolean isValidPredicateName(java.lang.Object aName)
Determines whether the given String is a valid name a predicate defined by this class. Valid predicate names are legal arguments to thesetPredicate(String)
method, and are defined by constants on theSimplePrecondition
interface.- Parameters:
aName
- an Object to test- Returns:
- true if and only if
aName
is aString
that is a valid predicate name.
-
getXmlizationInfo
protected XmlizationInfo getXmlizationInfo()
Description copied from class:MetaDataObject_impl
To be implemented by subclasses to return information describing how to represent this object in XML.- Specified by:
getXmlizationInfo
in classMetaDataObject_impl
- Returns:
- information defining this object's XML representation
-
-