|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.workspace.DBClassifier
public class DBClassifier
Database (DB) Classifier to distinguish ESTs from different databases. This class corresponds to a "DBClassifier" element in a PEACE work space XML data. This class encapsulates the core information associated with a classifier. Users create these entries by specifiying a suitable regular expression to identify ESTs from a data base. The data is persisted in the XML workspace for future reference so that users can repeatedly reuse a classifier.
Field Summary | |
---|---|
private int |
color
The RGB color code associated with this entry. |
private java.lang.String |
description
A user defined description for this DB classifier enttry. |
private boolean |
enabled
Flag to indicate if this classifier is enabled and must be used to classify ESTs. |
private java.util.regex.Pattern |
pattern
The pre-compiled pattern corresponding to this regular expression. |
private java.lang.String |
regExp
The regular expression that is used to identify a given database name. |
Constructor Summary | |
---|---|
DBClassifier(java.lang.String regExp,
java.lang.String description,
int color,
boolean enabled)
Constructor to create a classifier object with the fixed value fields initialized to specific values. |
Method Summary | |
---|---|
static DBClassifier |
create(org.w3c.dom.Element jobNode)
Helper method to utilize data from a DOM tree to create a suitable DBClassifier entry. |
int |
getColor()
Obtain the color code for shading database entry. |
java.lang.String |
getDescription()
Obtain the user supplied description for this this classifier. |
java.util.regex.Pattern |
getPattern()
This method must be used to obtain the pre-compiled pattern associated with this classifier. |
java.lang.String |
getRegExp()
Obtain the raw regular expression set for this classifier. |
boolean |
isEnabled()
Determine if this classifier is enabled. |
void |
marshall(org.w3c.dom.Element dbClassList)
Method to marshall the data stored in this object to become part of a DOM tree element passed in. |
void |
marshall(java.io.PrintWriter out)
Method to marshall the data stored in this object directly to a XML fragment. |
void |
setColor(int color)
Set a color to shade ESTs identified by this classifier. |
void |
setDescription(java.lang.String desc)
Set a description for this entry The description is persisted in the work space configuration file and loaded when a work space is opened in the GUI. |
void |
setEnabled(boolean enabled)
Indicate if this classifier must be used to group/classify ESTs. |
void |
setRegExp(java.lang.String regExp)
Set the regular expression for this DB Classifier entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String description
private java.lang.String regExp
private int color
private boolean enabled
private transient java.util.regex.Pattern pattern
Constructor Detail |
---|
public DBClassifier(java.lang.String regExp, java.lang.String description, int color, boolean enabled)
regExp
- The regular expression to be associated with the given
classifier.description
- A user-supplied description for this entry. This
maybe an empty string (but cannot be null).color
- The RGB color code to be associated with this entry.enabled
- Flag to indicate if this classifier is enabled. Only
enabled classifiers are used for classifying ESTs.Method Detail |
---|
public static DBClassifier create(org.w3c.dom.Element jobNode) throws java.lang.Exception
jobNode
- The DOM element to be used for creating the classifier
entry and populating with the needed data.
java.lang.Exception
- This method throws an exception when errors occur
during reading and processing elements from the DOM node.public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc
- public void setRegExp(java.lang.String regExp)
Note: This method resets the pattern associated with this classifier.
regExp
- The regular expression to be set for this
entry. It is assumed that the regular expression is valid
and this method does not perform any specific validation.public java.lang.String getRegExp()
public int getColor()
public void setColor(int color)
color
- The RGB color code for the color to shade this
data base entry.public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- If the parameter is true, then this classifier entry
will be used for grouping/classifying ESTs.public java.util.regex.Pattern getPattern()
public final void marshall(org.w3c.dom.Element dbClassList)
dbClassList
- The DOM element corresponding to the "DBClassifier"
node that contains this entry.public final void marshall(java.io.PrintWriter out)
out
- The stream to which the XML must be serialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |