gov.nist.nlpir.irf.conversion
Class ConversionRule

java.lang.Object
  |
  +--gov.nist.nlpir.irf.conversion.ConversionRule

public class ConversionRule
extends java.lang.Object

The class models a rule for use in converting tagged data into Document objects

Version:
$Revision: 1.1 $
Author:
This software was produced by NIST, an agency of the U.S. government, and by statute is not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification and maintenance.

Field Summary
 int action
          A code indicating what conversion action is to be taken when this rule is applied
static int CONVERT
          Possible action code - convert data associated with this tag
static int NONE
          Possible action code - ignore data associated with this tag
static int START_DOCUMENT
          Possible action code - create a new document
 java.lang.String tag
          The tag whose presence in the raw data triggers the application of this rule
 java.lang.reflect.Field targetField
          An instance of a field to be created by this rule
 java.lang.Class targetFieldClass
          An instance of the class for a field to be created by this rule
 
Constructor Summary
ConversionRule()
          Creates an empty conversion rule
ConversionRule(java.lang.String tag, int action, java.lang.String targetFieldName, java.lang.String targetFieldClassName, java.lang.String targetDocClassName)
          Creates a conversion rule based on the specified parameters
 
Method Summary
 java.lang.String getTag()
          Returns the tag for this rule
 java.lang.String toString()
          Returns a string representation of the rule
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

tag

public java.lang.String tag
The tag whose presence in the raw data triggers the application of this rule

action

public int action
A code indicating what conversion action is to be taken when this rule is applied

NONE

public static final int NONE
Possible action code - ignore data associated with this tag

CONVERT

public static final int CONVERT
Possible action code - convert data associated with this tag

START_DOCUMENT

public static final int START_DOCUMENT
Possible action code - create a new document

targetField

public java.lang.reflect.Field targetField
An instance of a field to be created by this rule

targetFieldClass

public java.lang.Class targetFieldClass
An instance of the class for a field to be created by this rule
Constructor Detail

ConversionRule

public ConversionRule()
Creates an empty conversion rule

ConversionRule

public ConversionRule(java.lang.String tag,
                      int action,
                      java.lang.String targetFieldName,
                      java.lang.String targetFieldClassName,
                      java.lang.String targetDocClassName)
Creates a conversion rule based on the specified parameters
Parameters:
tag - the triggering the rule's application
action - the code for the conversion action to be carried out
the - name of the field to be created
the - name field class to be created
the - name document class to be created
Method Detail

getTag

public java.lang.String getTag()
Returns the tag for this rule
Returns:
the tag for this rule

toString

public java.lang.String toString()
Returns a string representation of the rule
Returns:
a string representation of the rule
Overrides:
toString in class java.lang.Object