TPTP 4.2.0 Platform Project
Public API Specification

org.eclipse.tptp.platform.analysis.core.rule
Class AbstractAnalysisRule

java.lang.Object
  extended byorg.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
      extended byorg.eclipse.tptp.platform.analysis.core.rule.AbstractAnalysisRule
All Implemented Interfaces:
IAnalysisElement, IAnalysisRule, org.eclipse.core.runtime.IExecutableExtension
Direct Known Subclasses:
RuleConditionalNegationIfCondition, RuleConditionalTernary, RuleDeclarationMutipleDeclarations, RuleExceptionsDestructorThrow, RuleLoopAssignLoopVariable, RuleLoopContinueStatement, RuleLoopNoConditionForLoop, RuleLoopNoInitIncrForLoop, RuleSwitchBranch, RuleSwitchDefaultLabel, Template_Avoid_Class_Method, Template_Avoid_Class_Method_Arguments, Template_Avoid_Extending_Class, TemplateAvoidCatchingException, TemplateAvoidClass, TemplateAvoidClassInstanceCreation, TemplateAvoidImplementingInterface, TemplateAvoidMethodInvocation, TemplateAvoidNewClass, TemplateAvoidNonSynchronizedClassMethod, TemplateAvoidPackage, TemplateAvoidThrowingException

public abstract class AbstractAnalysisRule
extends AbstractAnalysisElement
implements IAnalysisRule


Field Summary
 
Fields inherited from class org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
DETAIL_PROVIDER
 
Constructor Summary
AbstractAnalysisRule()
          Constructor
 
Method Summary
 void addHistoryResultSet(java.lang.String historyId, IAnalysisResult result)
          Add a new result to the history.
 void addParameter(RuleParameter parameter)
          Add a new parameter to the rule
 void addParameters(java.util.List parameters)
          Add a list of new rule parameters to the rule
abstract  void analyze(AnalysisHistory history)
          Analyze this rule
 java.lang.String getIconName()
           
 java.lang.String getLabelWithVariables()
           
 java.util.List getOwnedElements()
          Rules can never have owned members, so this method is final
 RuleParameter getParameter(java.lang.String name)
          Return the rule variable data of a named variable or null if no value was found
 int getParameterCount()
           
 java.util.List getParameterList()
           
 IAnalysisProvider getProvider()
          Return the provider, which is top-most owner in the category/rule tree
 IAnalysisQuickFix getQuickFix(java.lang.String newId)
          Return the quickfox instance for a given quickfix id
 int getQuickFixCount()
           
 java.util.Iterator getQuickFixIterator()
          Return an iterator that can be used to crawl a list of quickfix id strings related to this rule
 IAnalysisViewer getViewer()
           
 int getVisibleVariableCount()
          Return the number of variables in the rule that are visible in the user interface.
 boolean hasQuickFixes()
          Determine if the rule has any quickfixes associated with it
 boolean isCustom()
          Used Internally
 void removeHistoryResultSet(java.lang.String historyId)
          Remove the result data associated with the specified history id
 void setCustom(boolean isCustomRule)
          Used Internally
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config, java.lang.String propertyName, java.lang.Object data)
           
 void setQuickFixId(java.lang.String newId)
          Allows a custom rule to define its own id
 
Methods inherited from class org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
addDetailProvider, addHistoryResultSet, addOwnedElement, addOwnedElements, deleteHistoryResults, dispose, getDetailProviders, getElementType, getExecutionHistory, getHelpID, getHistoryResults, getId, getLabel, getOwner, getPluginId, getViewerID, preAnalyze, setElementType, setHelpID, setIconName, setId, setInitializationData, setLabel, setOwner, setPluginId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.tptp.platform.analysis.core.element.IAnalysisElement
addDetailProvider, addHistoryResultSet, addOwnedElement, addOwnedElements, dispose, getDetailProviders, getElementType, getHelpID, getHistoryResults, getId, getLabel, getOwner, getPluginId, preAnalyze, setElementType, setHelpID, setIconName, setId, setLabel, setOwner, setPluginId
 

Constructor Detail

AbstractAnalysisRule

public AbstractAnalysisRule()
Constructor

Method Detail

setInitializationData

public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
Specified by:
setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension

getLabelWithVariables

public java.lang.String getLabelWithVariables()
Specified by:
getLabelWithVariables in interface IAnalysisRule
Returns:
a label which includes variable substitutions

getIconName

public java.lang.String getIconName()
Specified by:
getIconName in interface IAnalysisElement
Overrides:
getIconName in class AbstractAnalysisElement
Returns:
The file name of the icon to use for this element

hasQuickFixes

public boolean hasQuickFixes()
Determine if the rule has any quickfixes associated with it

Specified by:
hasQuickFixes in interface IAnalysisRule
Returns:
true if there are associated quickfixes

setQuickFixId

public void setQuickFixId(java.lang.String newId)
Allows a custom rule to define its own id

Specified by:
setQuickFixId in interface IAnalysisRule
Parameters:
newId - The id for the rule

getQuickFixIterator

public final java.util.Iterator getQuickFixIterator()
Return an iterator that can be used to crawl a list of quickfix id strings related to this rule

Specified by:
getQuickFixIterator in interface IAnalysisRule
Returns:
A quickfix id iterator or null if no quickfixes relate to this rule

getQuickFix

public final IAnalysisQuickFix getQuickFix(java.lang.String newId)
Return the quickfox instance for a given quickfix id

Specified by:
getQuickFix in interface IAnalysisRule
Parameters:
newId - The unique id of the quickfix to retrieve
Returns:
The quickfix for this rule or null if the quickfix does not exist

getQuickFixCount

public final int getQuickFixCount()
Specified by:
getQuickFixCount in interface IAnalysisRule
Returns:
The number of quickfixes supported by this rule

getViewer

public IAnalysisViewer getViewer()
Specified by:
getViewer in interface IAnalysisRule
Returns:
the viewer for this rule

analyze

public abstract void analyze(AnalysisHistory history)
Analyze this rule

Specified by:
analyze in interface IAnalysisRule
Parameters:
history - A reference to the history record for this analysis

getOwnedElements

public final java.util.List getOwnedElements()
Rules can never have owned members, so this method is final

Specified by:
getOwnedElements in interface IAnalysisElement
Overrides:
getOwnedElements in class AbstractAnalysisElement
Returns:
A list of IAnalysisElement instances owned by this element, null if there are no owned elements

addParameter

public void addParameter(RuleParameter parameter)
Add a new parameter to the rule

Specified by:
addParameter in interface IAnalysisRule
Parameters:
parameter - The parameter to add to the rule

addParameters

public void addParameters(java.util.List parameters)
Add a list of new rule parameters to the rule

Specified by:
addParameters in interface IAnalysisRule
Parameters:
parameters - A list of RuleParameter instances to add to the rule

getParameter

public RuleParameter getParameter(java.lang.String name)
Return the rule variable data of a named variable or null if no value was found

Specified by:
getParameter in interface IAnalysisRule
Parameters:
name - The name of the variable
Returns:
the rule variable data of the named variable or null if no value was found

getParameterList

public java.util.List getParameterList()
Specified by:
getParameterList in interface IAnalysisRule
Returns:
The hashmap of variables for this rule or null if there are no variables

getParameterCount

public int getParameterCount()
Specified by:
getParameterCount in interface IAnalysisRule
Returns:
the number of variables in the rule

getVisibleVariableCount

public int getVisibleVariableCount()
Return the number of variables in the rule that are visible in the user interface. Visible varaibles are those that have a label. Variables with an empty label are not displayed.

Specified by:
getVisibleVariableCount in interface IAnalysisRule
Returns:
the number of variables in the rule that are visible in the user interface.

isCustom

public final boolean isCustom()
Description copied from interface: IAnalysisRule
Used Internally

Specified by:
isCustom in interface IAnalysisRule
Returns:
true if this is a user-defined custom rule

setCustom

public final void setCustom(boolean isCustomRule)
Used Internally

Specified by:
setCustom in interface IAnalysisRule
Parameters:
isCustomRule -

getProvider

public IAnalysisProvider getProvider()
Description copied from interface: IAnalysisRule
Return the provider, which is top-most owner in the category/rule tree

Specified by:
getProvider in interface IAnalysisRule
Returns:
the provider, which is top-most owner in the category/rule tree

addHistoryResultSet

public void addHistoryResultSet(java.lang.String historyId,
                                IAnalysisResult result)
Add a new result to the history.

Specified by:
addHistoryResultSet in interface IAnalysisRule
Parameters:
historyId - The id of the history analysis run
result - The result to add

removeHistoryResultSet

public void removeHistoryResultSet(java.lang.String historyId)
Remove the result data associated with the specified history id

Specified by:
removeHistoryResultSet in interface IAnalysisElement
Overrides:
removeHistoryResultSet in class AbstractAnalysisElement
Parameters:
historyId - The id of the history analysis run being removed

TPTP 4.2.0 Platform Project
Public API Specification