org.ow2.weblab.core.annotator
Class AbstractAnnotator

java.lang.Object
  extended by org.ow2.weblab.core.annotator.AbstractAnnotator
Direct Known Subclasses:
BaseAnnotator

public abstract class AbstractAnnotator
extends java.lang.Object


Nested Class Summary
static class AbstractAnnotator.Operator
           
 
Field Summary
protected  PieceOfKnowledge annotation
          The Pok on which we will write and read statements
protected  boolean isInnerAnnotatorStarted
          State of the inner Annotator
protected  java.net.URI originalURI
          The original URI from the constructor (either subject or Resource's uri)
protected  Resource resource
          The WebLab Resource that will be annotated.
protected  java.net.URI subjectURI
          The suject URI that will be used when writing/reading a statement.
 
Constructor Summary
protected AbstractAnnotator(Resource resource)
          Creates an annotator on the Resource.
protected AbstractAnnotator(java.net.URI subject, PieceOfKnowledge pok)
          Creates an annotator for an URI.
 
Method Summary
<T> Value<T>
applyOperator(AbstractAnnotator.Operator operator, java.lang.String rdfsPrefix, java.net.URI rdfsUri, java.lang.String property, java.lang.Class<T> clazz, T val)
           
 void endInnerAnnotator()
          End a inner annotator, the subject will be reseted to the first one (retrieved when the Annotator has been constructed).
 void endSpecifyLanguage()
          End the support for specific language
 boolean isAppendMode()
          Return the writing mode of the annotator: if the annotator is in append mode, it will add annotations else the annotator will override existing annotations
protected  void retrieveAnnotation()
           
 void setAppendMode(boolean append)
          Set the writing mode of the annotator
 void startInnerAnnotatorOn(java.net.URI subject)
          Start a inner annotator on a different subject.
 void startSpecifyLanguage(java.lang.String language)
          Start to support a specific language defined annotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotation

protected PieceOfKnowledge annotation
The Pok on which we will write and read statements


resource

protected Resource resource
The WebLab Resource that will be annotated. It can be null since we can annotate subject which are just URI

See Also:
AbstractAnnotator(URI, PieceOfKnowledge)

subjectURI

protected java.net.URI subjectURI
The suject URI that will be used when writing/reading a statement.


isInnerAnnotatorStarted

protected boolean isInnerAnnotatorStarted
State of the inner Annotator


originalURI

protected java.net.URI originalURI
The original URI from the constructor (either subject or Resource's uri)

Constructor Detail

AbstractAnnotator

protected AbstractAnnotator(Resource resource)
Creates an annotator on the Resource. It allows to write and read statement (subject, property, object) about this resource on this resource.

Parameters:
resource - the resource to wrap.

AbstractAnnotator

protected AbstractAnnotator(java.net.URI subject,
                            PieceOfKnowledge pok)
Creates an annotator for an URI. It allows to write and read about the subject in this PoK

Parameters:
subject - the subject of interest
pok - the PieceOfKnowledge on which we manage information about the subject
Method Detail

startInnerAnnotatorOn

public void startInnerAnnotatorOn(java.net.URI subject)
Start a inner annotator on a different subject. It allows to use an annotator to read/write stament about on other subject. If an inner annotator is already started, it will be automatically closed

Parameters:
subject -

endInnerAnnotator

public void endInnerAnnotator()
End a inner annotator, the subject will be reseted to the first one (retrieved when the Annotator has been constructed).


isAppendMode

public boolean isAppendMode()
Return the writing mode of the annotator: if the annotator is in append mode, it will add annotations else the annotator will override existing annotations

Returns:
true if the annotator will add annotations or false if the annotator will override existing annotations

setAppendMode

public void setAppendMode(boolean append)
Set the writing mode of the annotator

Parameters:
append - true if the annotator will add annotations or false if the annotator will override existing annotations

startSpecifyLanguage

public void startSpecifyLanguage(java.lang.String language)
Start to support a specific language defined annotation

Parameters:
language -

endSpecifyLanguage

public void endSpecifyLanguage()
End the support for specific language


retrieveAnnotation

protected void retrieveAnnotation()

applyOperator

public <T> Value<T> applyOperator(AbstractAnnotator.Operator operator,
                                  java.lang.String rdfsPrefix,
                                  java.net.URI rdfsUri,
                                  java.lang.String property,
                                  java.lang.Class<T> clazz,
                                  T val)


Copyright © 2004-2010. All Rights Reserved.