GATE
Version 3.1-2270

gate.jape
Class RightHandSide

java.lang.Object
  extended by gate.jape.RightHandSide
All Implemented Interfaces:
JapeConstants, Serializable

public class RightHandSide
extends Object
implements JapeConstants, Serializable

The RHS of a CPSL rule. The action part. Contains an inner class created from the code in the grammar RHS.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gate.jape.JapeConstants
ALL_STYLE, APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING
 
Constructor Summary
RightHandSide(String transducerName, String ruleName, LeftHandSide lhs)
          Construction from the transducer name, rule name and the LHS.
 
Method Summary
 void addBlock(String anonymousBlock)
          Add an anonymous block to the action class
 void addBlock(String name, String namedBlock)
          Add a named block to the action class
static void cleanUp()
          Remove class files created for actions.
 void createActionClass()
          Create the action class and an instance of it.
 String getActionClassName()
           
 String getActionClassString()
          Returns the string for the java code
 String getPhaseName()
           
 String getRuleName()
           
 void instantiateActionClass()
          Create an instance of the action class.
static void setActionClassNumber(int n)
          Allow setting of the initial action class number.
 void setPhaseName(String phaseName)
           
 void setRuleName(String ruleName)
           
 String shortDesc()
          Create a string representation of the object.
 String toString()
          Create a string representation of the object.
 String toString(String pad)
          Create a string representation of the object.
 void transduce(Document doc, Map bindings, AnnotationSet inputAS, AnnotationSet outputAS, Ontology ontology)
          Makes changes to the document, using LHS bindings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RightHandSide

public RightHandSide(String transducerName,
                     String ruleName,
                     LeftHandSide lhs)
Construction from the transducer name, rule name and the LHS.

Method Detail

setActionClassNumber

public static void setActionClassNumber(int n)
Allow setting of the initial action class number. Used for ensuring class name uniqueness when running more than one transducer. The long-term solution is to have separate class loaders for each transducer.


getActionClassString

public String getActionClassString()
Returns the string for the java code


getActionClassName

public String getActionClassName()

addBlock

public void addBlock(String anonymousBlock)
Add an anonymous block to the action class


addBlock

public void addBlock(String name,
                     String namedBlock)
Add a named block to the action class


createActionClass

public void createActionClass()
                       throws JapeException
Create the action class and an instance of it.

Throws:
JapeException

instantiateActionClass

public void instantiateActionClass()
                            throws JapeException
Create an instance of the action class.

Throws:
JapeException

cleanUp

public static void cleanUp()
Remove class files created for actions.


transduce

public void transduce(Document doc,
                      Map bindings,
                      AnnotationSet inputAS,
                      AnnotationSet outputAS,
                      Ontology ontology)
               throws JapeException
Makes changes to the document, using LHS bindings.

Throws:
JapeException

toString

public String toString()
Create a string representation of the object.

Overrides:
toString in class Object

toString

public String toString(String pad)
Create a string representation of the object.


shortDesc

public String shortDesc()
Create a string representation of the object.


setPhaseName

public void setPhaseName(String phaseName)

getPhaseName

public String getPhaseName()

setRuleName

public void setRuleName(String ruleName)

getRuleName

public String getRuleName()

GATE
Version 3.1-2270