Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.pmd.rules.sunsecure
Class AbstractSunSecureRule

    java.lang.Object
      net.sourceforge.pmd.ast.JavaParserVisitorAdapter
          net.sourceforge.pmd.AbstractRule
              net.sourceforge.pmd.rules.sunsecure.AbstractSunSecureRule

All Implemented Interfaces:
  JavaParserVisitor, Rule

Direct Known Subclasses:
  ArrayIsStoredDirectly, MethodReturnsInternalArray

public abstract class AbstractSunSecureRule
extends AbstractRule

Utility methods for the package

Author:
  mgriffa

Field Summary

Fields inherited from class net.sourceforge.pmd.AbstractRule
`description, example, externalInfoUrl, include, message, name, priority, properties, ruleSetName, usesDFA, usesTypeResolution`

Fields inherited from interface net.sourceforge.pmd.Rule
`LOWEST_PRIORITY, PRIORITIES`

Constructor Summary
`AbstractSunSecureRule()`

Method Summary
`protected java.lang.String` | `getFirstNameImage(SimpleNode n)` Gets the image of the first ASTName node found by `SimpleNode.getFirstChildOfType(Class)`
`protected java.lang.String` | `getReturnedVariableName(ASTReturnStatement ret)` Gets the name of the variable returned.
`protected boolean` | `isField(java.lang.String varName, ASTTypeDeclaration typeDeclaration)` Tells if the type declaration has a field with varName.
`protected boolean` | `isLocalVariable(java.lang.String vn, SimpleNode 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.AbstractRule
`addProperties, addProperty, addViolation, addViolation, addViolation, addViolationWithMessage, apply, asFixedMap, asFixedMap, equals, getBooleanProperties, getBooleanProperty, getBooleanProperty, getDeclaringType, getDescription, getDoubleProperties, getDoubleProperty, getDoubleProperty, getExample, getExternalInfoUrl, getIntProperties, getIntProperty, getIntProperty, getMessage, getName, getPriority, getPriorityName, getProperties, getRuleSetName, getStringProperties, getStringProperty, getStringProperty, getTypeProperties, getTypeProperty, hashCode, hasProperty, importsPackage, include, isQualifiedName, propertiesByName, propertyDescriptorFor, setBooleanProperty, setDescription, setExample, setExternalInfoUrl, setInclude, setMessage, setName, setPriority, setProperties, setProperty, setRuleSetName, setUsesDFA, setUsesTypeResolution, usesDFA, usesTypeResolution, visitAll`

Methods inherited from class net.sourceforge.pmd.ast.JavaParserVisitorAdapter
`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`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractSunSecureRule

    public AbstractSunSecureRule()

Method Detail

### isField

    protected final boolean isField(java.lang.String varName,
                                    ASTTypeDeclaration typeDeclaration)

  Tells if the type declaration has a field with varName.

  Parameters:
    `varName` - the name of the field to search
    `typeDeclaration` - the type declaration
  Returns:
    `true` if there is a field in the type declaration named varName, `false` in other case

### getReturnedVariableName

    protected final java.lang.String getReturnedVariableName(ASTReturnStatement ret)

  Gets the name of the variable returned. Some examples:
  for this.foo returns foo
  for foo returns foo
  for foo.bar returns foo.bar

  Parameters:
    `ret` - a return statement to evaluate
  Returns:
    the name of the variable associated or `null` if it cannot be detected

### isLocalVariable

    protected boolean isLocalVariable(java.lang.String vn,
                                      SimpleNode node)

  TODO modify usages to use symbol table Tells if the variable name is a local variable declared in the method.

  Parameters:
    `vn` - the variable name
    `node` - the ASTMethodDeclaration where the local variable name will be searched
  Returns:
    `true` if the method declaration contains any local variable named vn and `false` in other case

### getFirstNameImage

    protected java.lang.String getFirstNameImage(SimpleNode n)

  Gets the image of the first ASTName node found by `SimpleNode.getFirstChildOfType(Class)`

  Parameters:
    `n` - the node to search
  Returns:
    the image of the first ASTName or `null`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2006 InfoEther. All Rights Reserved.