TPTP 4.4.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:
RuleCastingPreferCppStyleCast, RuleClassesAssignmentOperator, RuleClassesAvoidOverloading, RuleClassesAvoidPublicProtectedFields, RuleClassesCopyConstructor, RuleClassesDeclareOpEquals, RuleClassesDefaultClassFunctions, RuleClassesImplicitTypeConversion, RuleClassesOperatorDelete, RuleConditionalAssignmentInCondition, RuleConditionalNegationIfCondition, RuleConditionalTernary, RuleDeclarationHideNormalNew, RuleDeclarationInitializeOrder, RuleDeclarationMutipleDeclarations, RuleExceptionsCatchReference, RuleExceptionsDestructorThrow, RuleFunctionCopyConstructAllMembers, RuleFunctionOperatorAssignAllMembers, RuleFunctionOperatorAssignReturn, RuleFunctionOperatorAssignSelfCheck, RuleFunctionOperatorIncrReturn, RuleFunctionOperatorReturnConstObject, RuleFunctionOverloadPointerAndNumber, RuleFunctionPreferInitialization, RuleFunctionPreferPassByReference, RuleFunctionReturningNewObject, RuleFunctionReturnPrivateReference, RuleInheritanceDesctructorVirtual, RuleInheritanceOverrideDefaultParameter, RuleInheritanceOverrideNonVirtual, RuleLoopAssignLoopVariable, RuleLoopContinueStatement, RuleLoopNoConditionForLoop, RuleLoopNoInitIncrForLoop, RuleMemoryDeletePointers, RuleMemoryNewDeleteForm, RulePreprocessorAvoidDefineConst, RulePreprocessorAvoidStdio, RuleStatementAvoidMalloc, RuleStatementPreferPrefix, 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, org.eclipse.core.runtime.IExecutableExtension

This class provides common functionality for most analysis rules. Any methods here can be overridden by derivatives of this class


Field Summary
 
Fields inherited from class org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
CATEGORY_ELEMENT_TYPE, COMBO_VALUE, DETAIL_PROVIDER, PLUGIN_PROP_CATEGORY, PLUGIN_PROP_CLASS, PLUGIN_PROP_CONFIGURATION, PLUGIN_PROP_DESCRIPTION, PLUGIN_PROP_HELP, PLUGIN_PROP_ICON, PLUGIN_PROP_ID, PLUGIN_PROP_LABEL, PLUGIN_PROP_MANAGER, PLUGIN_PROP_PROVIDER, PLUGIN_PROP_QUICKFIX_ICON, PLUGIN_PROP_RESULT_VIEW_ID, PLUGIN_PROP_SEVERITY, PLUGIN_PROP_VIEWER, PROVIDER_ELEMENT_TYPE, PROVIDER_MANAGER_ELEMENT_TYPE, RESULT_ELEMENT_TYPE, RULE_ELEMENT_TYPE
 
Constructor Summary
protected AbstractAnalysisRule()
          Constructor
protected AbstractAnalysisRule(int type)
           
 
Method Summary
 void addHistoryResultSet(java.lang.String historyId, AbstractAnalysisResult result)
          Add a new result to the history.
abstract  void analyze(AnalysisHistory history)
          Run the analysis portion of the rule to generate results for any matching data
 java.lang.String getIconName()
           
 java.lang.String getLabelWithParameters()
           
 java.lang.String getLabelWithVariables()
          Deprecated. use getLabelWithParameters()
 java.util.List getOwnedElements()
           
 IAnalysisQuickFix getQuickFix(java.lang.String newId)
           
 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()
           
 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 value)
          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 for a quickfix
 
Methods inherited from class org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
addDetailProvider, addHistoryResultSet, addOwnedElement, addOwnedElements, addParameter, addParameters, deleteHistoryResults, dispose, getDetailProviders, getElementType, getExecutionHistory, getExternalDataMap, getHelpID, getHistoryResults, getId, getLabel, getOwner, getOwnerId, getParameter, getParameterCount, getParameterList, getPluginId, getProvider, getProviderManager, getViewerID, getVisibleParameterCount, loadOwnedVariables, loadOwnedVariables, postAnalyze, preAnalyze, setElementType, setExternalDataMap, setHelpID, setIconName, setId, setInitializationData, setLabel, setOwner, setOwnerId, 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.rule.IAnalysisRule
addParameter, addParameters, getParameter, getParameterCount, getParameterList, getProvider, getVisibleParameterCount
 
Methods inherited from interface org.eclipse.tptp.platform.analysis.core.element.IAnalysisElement
addDetailProvider, addHistoryResultSet, addOwnedElement, addOwnedElements, dispose, getDetailProviders, getElementType, getExternalDataMap, getHelpID, getHistoryResults, getId, getLabel, getOwner, getPluginId, preAnalyze, setElementType, setExternalDataMap, setHelpID, setIconName, setId, setLabel, setOwner, setPluginId
 

Constructor Detail

AbstractAnalysisRule

protected AbstractAnalysisRule()
Constructor


AbstractAnalysisRule

protected AbstractAnalysisRule(int type)
Method Detail

analyze

public abstract void analyze(AnalysisHistory history)
Description copied from interface: IAnalysisRule
Run the analysis portion of the rule to generate results for any matching data

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

setInitializationData

public final 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 final java.lang.String getLabelWithVariables()
Deprecated. use getLabelWithParameters()

Specified by:
getLabelWithVariables in interface IAnalysisRule
Returns:
a label which includes analysis parameter substitutions

getLabelWithParameters

public final java.lang.String getLabelWithParameters()
Returns:
a label which includes analysis parameter substitutions

getIconName

public final java.lang.String getIconName()
Specified by:
getIconName in interface IAnalysisElement
Overrides:
getIconName in class AbstractAnalysisElement
See Also:
IAnalysisElement.getIconName()

hasQuickFixes

public final 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 final void setQuickFixId(java.lang.String newId)
Allows a custom rule to define its own id for a quickfix

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)
Specified by:
getQuickFix in interface IAnalysisRule
Parameters:
newId - The unique id of the quickfix to retrieve
Returns:
The the quickfix for this rule

getQuickFixCount

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

getViewer

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

getOwnedElements

public final java.util.List getOwnedElements()
Specified by:
getOwnedElements in interface IAnalysisElement
Overrides:
getOwnedElements in class AbstractAnalysisElement
Returns:
A list of IAnalysisElement instances owned by this element

isCustom

public final boolean isCustom()
Used Internally

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

setCustom

public final void setCustom(boolean value)
Used Internally

Specified by:
setCustom in interface IAnalysisRule

addHistoryResultSet

public final void addHistoryResultSet(java.lang.String historyId,
                                      AbstractAnalysisResult 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 final void removeHistoryResultSet(java.lang.String historyId)
Description copied from interface: IAnalysisElement
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.4.0 Platform Project
Public API Specification