Search in sources :

Example 1 with ClassTypeRef

use of apex.jorje.data.ast.TypeRefs.ClassTypeRef in project pmd by pmd.

the class ApexOpenRedirectRule method checkNewObjects.

/**
 * Traverses all new declarations to find PageReferences
 *
 * @param node
 * @param data
 */
private void checkNewObjects(ASTNewObjectExpression node, Object data) {
    ASTMethod method = node.getFirstParentOfType(ASTMethod.class);
    if (method != null && Helper.isTestMethodOrClass(method)) {
        return;
    }
    ClassTypeRef classRef = (ClassTypeRef) node.getNode().getTypeRef();
    Identifier identifier = classRef.getNames().get(0);
    if (identifier.getValue().equalsIgnoreCase(PAGEREFERENCE)) {
        getObjectValue(node, data);
    }
}
Also used : ClassTypeRef(apex.jorje.data.ast.TypeRefs.ClassTypeRef) Identifier(apex.jorje.data.Identifier) ASTMethod(net.sourceforge.pmd.lang.apex.ast.ASTMethod)

Aggregations

Identifier (apex.jorje.data.Identifier)1 ClassTypeRef (apex.jorje.data.ast.TypeRefs.ClassTypeRef)1 ASTMethod (net.sourceforge.pmd.lang.apex.ast.ASTMethod)1