|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.togethersoft.modules.qa.utils.PluginImpl
Plugin implementation - abstract class serving as ancestor for AuditPluginImpl and MetricsPluginImpl
| Field Summary | |
protected com.togethersoft.openapi.sci.SciClass |
currCls
stores the class that is now processed |
protected com.togethersoft.openapi.sci.SciMember |
currMbr
stores the member that is now processed |
private javax.swing.JPanel |
emptyOptionsPane
Empty options pane. |
protected int |
level
nesting level - used internally for the needs of tracing |
static int |
PROC_ATTRS
specifies that we are processing attributes |
static int |
PROC_OPERS
specifies that we are processing operations |
protected int |
procGoal
Defines wheather we are processing operations (PROC_OPERS), attributes(PROC_ATTRS) or both (PROC_OPERS | PROC_ATTRS) |
protected boolean |
stopIter
This flag is used to stop processing. |
protected static boolean |
trace
trace flag - if you set it to true,
default implementation would print debuggung information to the console |
| Constructor Summary | |
PluginImpl()
|
|
| Method Summary | |
boolean |
canProcessByteCode()
Determines whether plugin can process byte code or not. |
javax.swing.JComponent |
createOptionsPane()
Creates additional option pane |
protected void |
examineExpression(com.togethersoft.openapi.sci.SciExpression expr)
Is called for each expression. |
java.lang.String |
getAbbreviation()
Gets the abbreviated name of plugin. |
boolean |
getDefaultChoice()
Determines whether plugin must be chosen by default or not. |
java.lang.String |
getGroupName()
Used for grouping of plugin. |
javax.swing.JComponent |
getOptionsPane()
returns options panel created earlier by createOptionsPane |
abstract java.lang.String |
getPropertiesFileName()
Returns properties file name |
boolean |
getProperty(java.lang.String propName,
boolean defaultValue)
Retrieves boolean property from plugin properties file. |
int |
getProperty(java.lang.String propName,
int defaultValue)
Retrieves int property from plugin properties file. |
java.lang.String |
getProperty(java.lang.String propName,
java.lang.String defaultValue)
Retrieves String property from plugin properties file. |
java.lang.String |
getTitle()
Gets the plugin title. |
java.lang.String |
indent(int level)
used internally for the needs of tracing |
boolean |
isByteCode(com.togethersoft.openapi.sci.SciObject obj)
Is set to true,
if the processing unit is in form of byte codes,
otherwise is set to false |
boolean |
isDefaultPkg(com.togethersoft.openapi.sci.SciObject obj)
Is set to true,
if current package is the root package
otherwise is set to false |
void |
load()
Is called upon plugin creation to perform any additional actions |
boolean |
prepare()
Called after user presses the 'Start' button, before processing to carry out some additional work if need. |
protected boolean |
process(com.togethersoft.openapi.sci.SciObject obj)
if object obj corresponds to class, sets
currCls to this class,
currMbr to null
and calls processClass(obj) |
protected void |
processAttrib(com.togethersoft.openapi.sci.SciAttribute attr)
Is called for each attribute. Calls processConceptVar method |
protected void |
processAttribs(com.togethersoft.openapi.sci.SciClass cls)
Is invoked for each class. |
protected void |
processCaseStmt(com.togethersoft.openapi.sci.SciCaseStatement cs)
Is called for each case statement. |
protected void |
processCatchStmt(com.togethersoft.openapi.sci.SciCatchBlockStatement cs)
Is called for each catch statement. |
protected void |
processClass(com.togethersoft.openapi.sci.SciClass cls)
Is invoked by each class If procGoal & PROC_ATTRS ! |
protected void |
processCodeBlock(com.togethersoft.openapi.sci.SciCodeBlock cb)
Is called for each code block. |
protected void |
processCompStmt(com.togethersoft.openapi.sci.SciCompoundStatement cs)
Is called for each compound statement. |
protected void |
processConceptVar(com.togethersoft.openapi.sci.SciVariable var)
Is called for each atribute, parameter, or local variable. |
protected void |
processDeclStmt(com.togethersoft.openapi.sci.SciDeclarationStatement ds)
Is called for each declaration statement Default implementation calls processLocalVar for each declaration in statement. |
protected void |
processExpression(com.togethersoft.openapi.sci.SciExpression expr)
Is called for each expression, including expressions in function calls, conditional or loop statements and so on Default implementation calls examineExpression,
then calls processExpression for each expression's operand |
protected void |
processExprStmt(com.togethersoft.openapi.sci.SciExpressionStatement es)
Is called for each expression. |
protected void |
processIfStmt(com.togethersoft.openapi.sci.SciIfStatement is)
Is called for each if statement. |
protected void |
processInitValue(com.togethersoft.openapi.sci.SciExpression expr)
Is called for each initialization part of class attribute or local variable. |
protected void |
processLocalVar(com.togethersoft.openapi.sci.SciVariable var)
Is called for each local variable. |
protected void |
processLoopStmt(com.togethersoft.openapi.sci.SciLoopStatement ls)
Is called for each loop statement (i.e. |
protected void |
processOper(com.togethersoft.openapi.sci.SciOperation opr)
Is called for each operation. Default implementation calls processParam
for each parameter of given operation (if any),
processThrowSpec
for each exception in the throw list of operation (if any)
and then calls
processCodeBlock
for the body of operation |
protected void |
processOpers(com.togethersoft.openapi.sci.SciClass cls)
Is invoked for each class. |
protected void |
processParam(com.togethersoft.openapi.sci.SciParameter param)
Is called for each parameter of the operation. Default implementation calls processConceptVar
for this parameter |
protected void |
processReturnStmt(com.togethersoft.openapi.sci.SciReturnStatement rs)
Is called for each return statement. |
protected void |
processStatement(com.togethersoft.openapi.sci.SciStatement stmt)
Is called for each statement within code block. |
protected void |
processSwitchStmt(com.togethersoft.openapi.sci.SciSwitchStatement ss)
Is called for each switch statement. |
protected void |
processThrowSpec(com.togethersoft.openapi.sci.SciThrowSpecifier thr)
Is called for each exception in the operation throw list. |
protected void |
processThrowStmt(com.togethersoft.openapi.sci.SciThrowStatement ts)
Is called for each throw statement. |
protected void |
processTryStmt(com.togethersoft.openapi.sci.SciTryStatement ts)
Is called for each try-catch statement; Default implementation calls processStatement for the try part and for each of catch parts |
void |
putProperty(java.lang.String propName,
boolean value)
Puts boolean property from plugin properties file. |
void |
putProperty(java.lang.String propName,
int value)
Puts int property from plugin properties file. |
void |
putProperty(java.lang.String propName,
java.lang.String value)
Puts String property from plugin properties file. |
void |
restoreOptions()
Is used to restore options from the properties file. |
boolean |
storeOptions()
Is invoked when user presses 'Start' button. |
void |
traceAttr(com.togethersoft.openapi.sci.SciAttribute attr)
traces attribute |
void |
traceExpr(com.togethersoft.openapi.sci.SciExpression expr)
traces expression |
void |
traceOper(com.togethersoft.openapi.sci.SciOperation opr)
traces operation |
void |
traceStmt(com.togethersoft.openapi.sci.SciStatement stmt)
traces statement |
void |
traceVar(java.lang.String kind,
com.togethersoft.openapi.sci.SciVariable var)
traces variable |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface com.togethersoft.modules.qa.api.Plugin |
getDescriptionFileName |
| Field Detail |
private javax.swing.JPanel emptyOptionsPane
protected com.togethersoft.openapi.sci.SciClass currCls
protected com.togethersoft.openapi.sci.SciMember currMbr
protected boolean stopIter
true,
processing is stoppedprotected int level
protected static boolean trace
true,
default implementation would print debuggung information to the consoleprotected int procGoal
public static final int PROC_ATTRS
public static final int PROC_OPERS
| Constructor Detail |
public PluginImpl()
| Method Detail |
public void load()
Pluginload in interface Pluginpublic java.lang.String getTitle()
getTitle in interface Pluginpublic java.lang.String getGroupName()
getGroupName in interface Pluginpublic java.lang.String getAbbreviation()
getAbbreviation in interface Pluginpublic boolean getDefaultChoice()
getDefaultChoice in interface Pluginpublic javax.swing.JComponent createOptionsPane()
createOptionsPane in interface Pluginpublic javax.swing.JComponent getOptionsPane()
getOptionsPane in interface Pluginpublic void restoreOptions()
PluginrestoreOptions in interface Pluginpublic boolean storeOptions()
false, further processing is stopped.storeOptions in interface Pluginpublic boolean prepare()
false, further processing is stopped.prepare in interface Pluginpublic boolean canProcessByteCode()
canProcessByteCode in interface Plugintrue if plugin can process byte code, otherwise falsepublic abstract java.lang.String getPropertiesFileName()
getPropertiesFileName in interface Plugin
public java.lang.String getProperty(java.lang.String propName,
java.lang.String defaultValue)
propName - property namedefaultValue - default value
public int getProperty(java.lang.String propName,
int defaultValue)
propName - property namedefaultValue - default value
public boolean getProperty(java.lang.String propName,
boolean defaultValue)
propName - property namedefaultValue - default value
public void putProperty(java.lang.String propName,
java.lang.String value)
propName - property namevalue - value to store
public void putProperty(java.lang.String propName,
int value)
propName - property namevalue - value to store
public void putProperty(java.lang.String propName,
boolean value)
propName - property namevalue - value to storepublic java.lang.String indent(int level)
public void traceAttr(com.togethersoft.openapi.sci.SciAttribute attr)
attr - attribute to tracepublic void traceOper(com.togethersoft.openapi.sci.SciOperation opr)
opr - attribute to tracepublic void traceStmt(com.togethersoft.openapi.sci.SciStatement stmt)
stmt - statement to tracepublic void traceExpr(com.togethersoft.openapi.sci.SciExpression expr)
expr - expression to trace
public void traceVar(java.lang.String kind,
com.togethersoft.openapi.sci.SciVariable var)
expr - variable to tracepublic boolean isByteCode(com.togethersoft.openapi.sci.SciObject obj)
true,
if the processing unit is in form of byte codes,
otherwise is set to falsepublic boolean isDefaultPkg(com.togethersoft.openapi.sci.SciObject obj)
true,
if current package is the root package
otherwise is set to falseprotected boolean process(com.togethersoft.openapi.sci.SciObject obj)
obj corresponds to class, sets
currCls to this class,
currMbr to null
and calls processClass(obj)obj - object to processprotected void processClass(com.togethersoft.openapi.sci.SciClass cls)
procGoal & PROC_ATTRS != 0
procGoal & PROC_OPERS != 0
processOpers(cls)
If stopIter flag is set, stops processingcls - class to processprotected void processAttribs(com.togethersoft.openapi.sci.SciClass cls)
processAttrib
for each class attribute.
Before calling
processAttrib
it sets currMbr to the current atribute.
If stopIter flag is set, stops processingcls - class to processprotected void processAttrib(com.togethersoft.openapi.sci.SciAttribute attr)
processConceptVar methodattr - attributeprotected void processOpers(com.togethersoft.openapi.sci.SciClass cls)
processOper method
for each operation.
Before calling
processOper,
it sets currMbr to the current operation
If stopIter flag is set, stops processingcls - class to processprotected void processOper(com.togethersoft.openapi.sci.SciOperation opr)
processParam
for each parameter of given operation (if any),
processThrowSpec
for each exception in the throw list of operation (if any)
and then calls
processCodeBlock
for the body of operationopr - operationprotected void processParam(com.togethersoft.openapi.sci.SciParameter param)
processConceptVar
for this parameterparam - parameter of the operationprotected void processThrowSpec(com.togethersoft.openapi.sci.SciThrowSpecifier thr)
thr - throw specifierprotected void processCodeBlock(com.togethersoft.openapi.sci.SciCodeBlock cb)
processStatement for each statement.cb - code blockprotected void processStatement(com.togethersoft.openapi.sci.SciStatement stmt)
processCaseStmt,
processCatchStmt,
processSwitchStmt,
processCompStmt,
processDeclStmt,
processExprStmt,
processIfStmt,
processLoopStmt,
processReturnStmt,
processThrowStmt or
processTryStmt
stmt - statementprotected void processCaseStmt(com.togethersoft.openapi.sci.SciCaseStatement cs)
processExpression(cs)cs - case statementprotected void processCatchStmt(com.togethersoft.openapi.sci.SciCatchBlockStatement cs)
processCodeBlock for the statement bodycs - catch statementprotected void processCompStmt(com.togethersoft.openapi.sci.SciCompoundStatement cs)
processCodeBlock for the statement bodycs - catch statementprotected void processDeclStmt(com.togethersoft.openapi.sci.SciDeclarationStatement ds)
processLocalVar for each declaration in statement.ds - declaration statementprotected void processExprStmt(com.togethersoft.openapi.sci.SciExpressionStatement es)
processExpression for this expression.es - expressionprotected void processIfStmt(com.togethersoft.openapi.sci.SciIfStatement is)
processExpression for condition expression,
processCodeBlock for then and else branches.is - if statementprotected void processLoopStmt(com.togethersoft.openapi.sci.SciLoopStatement ls)
processStatement
for the initialization part and iteration part of for,
processExpression
for the repeat and exit conditions,
and
processCodeBlock for the loop body.ls - loop statementprotected void processReturnStmt(com.togethersoft.openapi.sci.SciReturnStatement rs)
processExpressionrs - return statementprotected void processSwitchStmt(com.togethersoft.openapi.sci.SciSwitchStatement ss)
processExpression
for the switch expression
and
processCodeBlock
for the code blockswitch - switch statementprotected void processThrowStmt(com.togethersoft.openapi.sci.SciThrowStatement ts)
processExpressionts - throw statementprotected void processTryStmt(com.togethersoft.openapi.sci.SciTryStatement ts)
processStatement for the try part and for each of catch partsts - try statementprotected void processLocalVar(com.togethersoft.openapi.sci.SciVariable var)
processConceptVarvar - local variableprotected void processConceptVar(com.togethersoft.openapi.sci.SciVariable var)
processInitValue for the initialisation part.var - atribute, parameter, or local variableprotected void processInitValue(com.togethersoft.openapi.sci.SciExpression expr)
processExpressionprotected void processExpression(com.togethersoft.openapi.sci.SciExpression expr)
examineExpression,
then calls processExpression for each expression's operandexpr - expressionprotected void examineExpression(com.togethersoft.openapi.sci.SciExpression expr)
expr - expression
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||