public final class QualifiedName extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
FORMAT
Pattern specifying the format.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String[] |
getClasses()
Returns the classes.
|
String |
getOperation()
Returns the operation string.
|
String[] |
getPackages()
Returns the packages.
|
int |
hashCode() |
boolean |
isClass()
Returns true if the resource addressed by this qualified name is a class.
|
boolean |
isOperation()
Returns true if the resource addressed by this qualified name is an operation.
|
static QualifiedName |
makeClassOf(Class<?> clazz) |
static QualifiedName |
makeNestedClassOf(QualifiedName parent,
String className)
Builds the qualified name of a nested class using the qualified name of its immediate parent.
|
static QualifiedName |
makeOperationOf(ASTConstructorDeclaration node)
Builds the qualified name of a constructor declaration.
|
static QualifiedName |
makeOperationOf(ASTMethodDeclaration node)
Builds the qualified name of a method declaration.
|
static QualifiedName |
makeOuterClassOf(ASTClassOrInterfaceDeclaration node)
Builds the qualified name of an outer (not nested) class.
|
static QualifiedName |
parseName(String name)
Parses a qualified name given in the format defined for this implementation.
|
String |
toString() |
public static final Pattern FORMAT
((\w+\.)+|\.)((\w+)(\$\w+)*)(#(\w+)\(((\w+)(, \w+)*)?\))?
public static QualifiedName makeOperationOf(ASTMethodDeclaration node)
node
- The method declaration nodepublic static QualifiedName makeOperationOf(ASTConstructorDeclaration node)
node
- The constructor declaration nodepublic static QualifiedName makeNestedClassOf(QualifiedName parent, String className)
parent
- The qname of the immediate parentclassName
- The name of the classpublic static QualifiedName makeOuterClassOf(ASTClassOrInterfaceDeclaration node)
node
- The class nodepublic static QualifiedName makeClassOf(Class<?> clazz)
public static QualifiedName parseName(String name)
FORMAT
). Examples:
com.company.MyClass$Nested#myMethod(String, int)
.MyClass$Nested
name
- The name to parse.public boolean isClass()
public boolean isOperation()
public String[] getPackages()
public String[] getClasses()
public String getOperation()
Copyright © 2002–2017 PMD. All rights reserved.