|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.pmd.AbstractPropertySource
net.sourceforge.pmd.lang.rule.AbstractRule
net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
net.sourceforge.pmd.lang.java.rule.sunsecure.AbstractSunSecureRule
public abstract class AbstractSunSecureRule
Utility methods for the package Created on Jan 17, 2005
Field Summary |
---|
Fields inherited from class net.sourceforge.pmd.AbstractPropertySource |
---|
propertyDescriptors, propertyValuesByDescriptor |
Fields inherited from interface net.sourceforge.pmd.Rule |
---|
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR |
Constructor Summary | |
---|---|
AbstractSunSecureRule()
|
Method Summary | |
---|---|
protected String |
getFirstNameImage(Node n)
Gets the image of the ASTName node found by Node.getFirstDescendantOfType(Class)
if it is the greatgrandchild of the given node. |
protected String |
getReturnedVariableName(ASTReturnStatement ret)
Gets the name of the variable returned. |
protected boolean |
isField(String varName,
ASTTypeDeclaration typeDeclaration)
Tells if the type declaration has a field with varName. |
protected boolean |
isLocalVariable(String vn,
Node node)
TODO modify usages to use symbol table Tells if the variable name is a local variable declared in the method. |
Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRule |
---|
apply, getDeclaringType, importsPackage, isQualifiedName, isSuppressed, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll |
Methods inherited from class net.sourceforge.pmd.AbstractPropertySource |
---|
copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.pmd.PropertySource |
---|
definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues |
Constructor Detail |
---|
public AbstractSunSecureRule()
Method Detail |
---|
protected final boolean isField(String varName, ASTTypeDeclaration typeDeclaration)
varName
- the name of the field to searchtypeDeclaration
- the type declaration
true
if there is a field in the type declaration
named varName, false
in other caseprotected final String getReturnedVariableName(ASTReturnStatement ret)
ret
- a return statement to evaluate
null
if it
cannot be detectedprotected boolean isLocalVariable(String vn, Node node)
vn
- the variable namenode
- the ASTMethodDeclaration where the local variable name will be
searched
true
if the method declaration contains any local
variable named vn and false
in other caseprotected String getFirstNameImage(Node n)
Node.getFirstDescendantOfType(Class)
if it is the greatgrandchild of the given node.
E.g.
n = Expression || StatementExpression PrimaryExpression PrimaryPrefix Name
n
- the node to search
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |