org.apache.uima.annotator.regex.impl
Class Annotation_impl

java.lang.Object
  extended by org.apache.uima.annotator.regex.impl.Annotation_impl
All Implemented Interfaces:
Annotation

public class Annotation_impl
extends java.lang.Object
implements Annotation

Implementation of an RegEx Annotation definition


Constructor Summary
Annotation_impl(java.lang.String annotId, java.lang.String annotType, Position begin, Position end, java.lang.String validationClass)
           
 
Method Summary
 void addFeature(Feature aFeature)
          Adds the given feature to this annotation.
 org.apache.uima.cas.Type getAnnotationType()
          Get the annotation type of this annotation.
 Position getBegin()
          Get the annotation begin position of this annotation.
 Position getEnd()
          Get the annotation end position of this annotation.
 Feature[] getFeatures()
          Returns the feature array for this annotation
 java.lang.String getId()
          Get the annotation identifier.
 boolean hasValidator()
          Returns true if for the current annotation an validator is available.
 void initialize()
          initialize the Regex Annotation object with all the annotation features
 java.lang.String toString()
           
 void typeInit(org.apache.uima.cas.TypeSystem ts)
           
 boolean validate(java.lang.String coveredText, java.lang.String ruleID)
          Validate the covered Text of the annotation and checks if the annotation is valid or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Annotation_impl

public Annotation_impl(java.lang.String annotId,
                       java.lang.String annotType,
                       Position begin,
                       Position end,
                       java.lang.String validationClass)
Parameters:
annotId -
annotType -
begin -
end -
Method Detail

getAnnotationType

public org.apache.uima.cas.Type getAnnotationType()
Description copied from interface: Annotation
Get the annotation type of this annotation.

Specified by:
getAnnotationType in interface Annotation
Returns:
returns the annotation type of this annotation

getBegin

public Position getBegin()
Description copied from interface: Annotation
Get the annotation begin position of this annotation.

Specified by:
getBegin in interface Annotation
Returns:
returns the annotation begin position.

getEnd

public Position getEnd()
Description copied from interface: Annotation
Get the annotation end position of this annotation.

Specified by:
getEnd in interface Annotation
Returns:
returns the annotation end position.

getId

public java.lang.String getId()
Description copied from interface: Annotation
Get the annotation identifier.

Specified by:
getId in interface Annotation
Returns:
returns the annotation identifier

addFeature

public void addFeature(Feature aFeature)
Description copied from interface: Annotation
Adds the given feature to this annotation.

Specified by:
addFeature in interface Annotation
Parameters:
aFeature - The feature to be added.

getFeatures

public Feature[] getFeatures()
Description copied from interface: Annotation
Returns the feature array for this annotation

Specified by:
getFeatures in interface Annotation
Returns:
returns the feature array for this annotation

validate

public boolean validate(java.lang.String coveredText,
                        java.lang.String ruleID)
                 throws java.lang.Exception
Description copied from interface: Annotation
Validate the covered Text of the annotation and checks if the annotation is valid or not.

Specified by:
validate in interface Annotation
Parameters:
coveredText - covered text of the annotation that should be created
ruleID - ruleID (if specified) of the rule that created the match
Returns:
true if the annotation is valid or if not validation was specified. If the annotation is invalid, false is returned.
Throws:
java.lang.Exception

hasValidator

public boolean hasValidator()
Description copied from interface: Annotation
Returns true if for the current annotation an validator is available.

Specified by:
hasValidator in interface Annotation
Returns:
Returns true if an validator is available.

typeInit

public void typeInit(org.apache.uima.cas.TypeSystem ts)
              throws org.apache.uima.resource.ResourceInitializationException
Parameters:
ts -
Throws:
org.apache.uima.resource.ResourceInitializationException

initialize

public void initialize()
                throws RegexAnnotatorConfigException
initialize the Regex Annotation object with all the annotation features

Throws:
RegexAnnotatorConfigException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.