org.pentaho.di.imp.rules
Class BaseImportRule

java.lang.Object
  extended by org.pentaho.di.imp.rules.BaseImportRule
All Implemented Interfaces:
Cloneable, ImportRuleInterface
Direct Known Subclasses:
DatabaseConfigurationImportRule, JobHasANoteImportRule, JobHasDescriptionImportRule, JobHasJobLogConfiguredImportRule, JobHasNoDisabledHopsImportRule, TransformationHasANoteImportRule, TransformationHasDescriptionImportRule, TransformationHasNoDisabledHopsImportRule, TransformationHasTransLogConfiguredImportRule

public abstract class BaseImportRule
extends Object
implements ImportRuleInterface


Field Summary
static String XML_TAG
           
 
Constructor Summary
BaseImportRule()
           
 
Method Summary
 ImportRuleInterface clone()
           
 String getCompositeClassName()
          This returns the expected name for the composite that allows a base import rule to be edited.
 String getId()
           
 String getXML()
           
 boolean isEnabled()
           
 boolean isUnique()
           
 void loadXML(Node ruleNode)
           
 void setEnabled(boolean enabled)
           
 void setId(String id)
           
 String toString()
           
abstract  List<ImportValidationFeedback> verifyRule(Object subject)
          Validate the rule against a subject (transformation, job, database, ...)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TAG

public static String XML_TAG
Constructor Detail

BaseImportRule

public BaseImportRule()
Method Detail

clone

public ImportRuleInterface clone()
Specified by:
clone in interface ImportRuleInterface
Overrides:
clone in class Object

isUnique

public boolean isUnique()
Specified by:
isUnique in interface ImportRuleInterface
Returns:
true if only one rule is needed in a whole set of rules. Adding another would not help. Returns false in case you can add this rule multiple times with different settings.

verifyRule

public abstract List<ImportValidationFeedback> verifyRule(Object subject)
Description copied from interface: ImportRuleInterface
Validate the rule against a subject (transformation, job, database, ...)

Specified by:
verifyRule in interface ImportRuleInterface
Parameters:
subject - The subject to validate against
Returns:
The feedback list consists of a series of approvals and/or warnings and/or errors.

getXML

public String getXML()
Specified by:
getXML in interface ImportRuleInterface

loadXML

public void loadXML(Node ruleNode)
             throws KettleException
Specified by:
loadXML in interface ImportRuleInterface
Throws:
KettleException

toString

public String toString()
Overrides:
toString in class Object

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface ImportRuleInterface
Returns:
the enabled

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface ImportRuleInterface
Parameters:
enabled - the enabled to set

getId

public String getId()
Specified by:
getId in interface ImportRuleInterface
Returns:
the id

setId

public void setId(String id)
Specified by:
setId in interface ImportRuleInterface
Parameters:
id - the id to set

getCompositeClassName

public String getCompositeClassName()
This returns the expected name for the composite that allows a base import rule to be edited. The expected name is in the org.pentaho.di.ui tree and has a class name that is the name of the job entry with 'Composite' added to the end. e.g. if the import rule class name is: "org.pentaho.di.imp.rules.DatabaseConfigurationImportRule" the composite then the composite class name would be: "org.pentaho.di.ui.imp.rules.DatabaseConfigurationImportRuleComposite" If the composite class for a job entry does not match this pattern it should override this method and return the appropriate class name

Specified by:
getCompositeClassName in interface ImportRuleInterface
Returns:
full class name of the composite class