ruleset
Class Labeler

java.lang.Object
  extended by ruleset.Labeler

public class Labeler
extends java.lang.Object

Loads a rule set and processes one or more files. Labeler will load a ruleset (@see PPIRuleset) and apply it to one or more files in a directory tree. If a directory name is passed as the starting point then the ruleset will be applied to all files in the directory and subdirectories.

Options:

-d: Scan only the current directory. Do not recurse sub-directories. -r: Scan the current directory and recursely scan sub-directories.
Usage:
labeler ruleset [-d | -R] pathname [pathname ...]

Since:
1.0

Field Summary
 pds.util.PPIVariableList mCommandList
           
 pds.util.PPIVariableList mGlobalList
          Preserves global variables between executions of the ruleset.
 igpp.util.MultiPrinter mOutput
           
 boolean mRecurse
           
 java.lang.String mStartPath
           
 java.lang.String mStartRule
           
 
Constructor Summary
Labeler()
          Create an instance.
 
Method Summary
 igpp.util.MultiPrinter getOutput()
           
 boolean getRecurse()
           
 java.lang.String getStartPath()
           
static void main(java.lang.String[] args)
          Entry point for the application.
 boolean processItem(java.lang.String ruleset, java.lang.String pathName)
          Process a file or directory using a ruleset.
 boolean runRuleset(java.lang.String ruleFile, java.lang.String pathName)
          Process a single file using a ruleset.
 void setOutput(javax.servlet.jsp.JspWriter writer)
           
 void setOutput(java.io.PrintStream stream)
           
 void setOutput(java.io.PrintWriter writer)
           
 void setRecurse(boolean state)
           
 void setStartPath(java.lang.String path)
           
 void setVariable(java.lang.String name, java.lang.String value)
          Define a variable which set at the start of each exceution of a ruleset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mGlobalList

public pds.util.PPIVariableList mGlobalList
Preserves global variables between executions of the ruleset.


mCommandList

public pds.util.PPIVariableList mCommandList

mStartPath

public java.lang.String mStartPath

mStartRule

public java.lang.String mStartRule

mRecurse

public boolean mRecurse

mOutput

public igpp.util.MultiPrinter mOutput
Constructor Detail

Labeler

public Labeler()
Create an instance.

Method Detail

main

public static void main(java.lang.String[] args)
Entry point for the application.


processItem

public boolean processItem(java.lang.String ruleset,
                           java.lang.String pathName)
                    throws java.lang.Exception
Process a file or directory using a ruleset. If recusion is set to true then each file in a directory is also processed.

Parameters:
ruleset - the pathname to the ruleset file.
pathName - the pathname of the file to process. If pathName is a directory and recusion is true, then each file in the directory will be processed.
Returns:
true if processing was successful, false otherwise.
Throws:
java.lang.Exception
Since:
1.0

runRuleset

public boolean runRuleset(java.lang.String ruleFile,
                          java.lang.String pathName)
                   throws java.lang.Exception
Process a single file using a ruleset. Defines the initial environment for the ruleset and preserves the global variables between ruleset executions.

Parameters:
ruleset - the pathname to the ruleset file.
pathName - the pathname of the file to process. If pathName is a directory and recusion is true, then each file in the directory will be processed.
Returns:
true if processing was successful, false otherwise.
Throws:
java.lang.Exception
Since:
1.0

setVariable

public void setVariable(java.lang.String name,
                        java.lang.String value)
Define a variable which set at the start of each exceution of a ruleset.

Parameters:
name - the name of the variable.
value - the value to the set the variable.
Since:
1.0

setRecurse

public void setRecurse(boolean state)

getRecurse

public boolean getRecurse()

setStartPath

public void setStartPath(java.lang.String path)

getStartPath

public java.lang.String getStartPath()

setOutput

public void setOutput(java.io.PrintStream stream)

setOutput

public void setOutput(java.io.PrintWriter writer)

setOutput

public void setOutput(javax.servlet.jsp.JspWriter writer)

getOutput

public igpp.util.MultiPrinter getOutput()