Class JavaTypeQualifiedName
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.ast.JavaQualifiedName
-
- net.sourceforge.pmd.lang.java.qname.JavaTypeQualifiedName
-
- All Implemented Interfaces:
QualifiedName
@Deprecated public final class JavaTypeQualifiedName extends JavaQualifiedName
Deprecated.SpecialisesJavaQualifiedName
for type names.- Since:
- 6.1.0
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected int
buildHashCode()
Deprecated.Computes the hashcode.protected String
buildToString()
Deprecated.Construct the toString once.String
getBinaryName()
Deprecated.Returns the binary name of the type identified by this qualified name.List<String>
getClassList()
Deprecated.Returns the class specific part of the name.JavaTypeQualifiedName
getClassName()
Deprecated.String
getClassSimpleName()
Deprecated.Get the simple name of the class.List<String>
getPackageList()
Deprecated.Returns the packages in outer-to-inner order.Class<?>
getType()
Deprecated.Gets the Class instance identified by this qualified name.boolean
isAnonymousClass()
Deprecated.Returns true if this qualified name identifies an anonymous class.boolean
isClass()
Deprecated.boolean
isLocalClass()
Deprecated.Returns true if this qualified name identifies a local class.boolean
isOperation()
Deprecated.boolean
isUnnamedPackage()
Deprecated.Returns true if the class represented by this qualified name is in the unnamed package.protected boolean
structurallyEquals(JavaQualifiedName qname)
Deprecated.Returns true if the given qname is identical to this qname.-
Methods inherited from class net.sourceforge.pmd.lang.java.ast.JavaQualifiedName
equals, getClasses, getOperation, getPackages, hashCode, ofClass, ofString, toString
-
-
-
-
Method Detail
-
getClassName
public JavaTypeQualifiedName getClassName()
Deprecated.- Specified by:
getClassName
in interfaceQualifiedName
- Specified by:
getClassName
in classJavaQualifiedName
-
structurallyEquals
protected boolean structurallyEquals(JavaQualifiedName qname)
Deprecated.Description copied from class:JavaQualifiedName
Returns true if the given qname is identical to this qname. Performs a structural comparison. Used in the implementation ofJavaQualifiedName.equals(Object)
after taking shortcuts.- Specified by:
structurallyEquals
in classJavaQualifiedName
- Parameters:
qname
- The other comparand. Can always be casted down to the subclass type in which this method is overridden
-
buildHashCode
protected int buildHashCode()
Deprecated.Description copied from class:JavaQualifiedName
Computes the hashcode. Called once, then cached. Since QualifiedNames are mostly used as the keys of a map, caching the hashcode makes sense.- Specified by:
buildHashCode
in classJavaQualifiedName
-
isClass
public boolean isClass()
Deprecated.
-
isOperation
public boolean isOperation()
Deprecated.
-
isLocalClass
public boolean isLocalClass()
Deprecated.Returns true if this qualified name identifies a local class.- Overrides:
isLocalClass
in classJavaQualifiedName
-
isAnonymousClass
public boolean isAnonymousClass()
Deprecated.Returns true if this qualified name identifies an anonymous class.
-
getClassSimpleName
public String getClassSimpleName()
Deprecated.Get the simple name of the class.- Overrides:
getClassSimpleName
in classJavaQualifiedName
-
isUnnamedPackage
public boolean isUnnamedPackage()
Deprecated.Returns true if the class represented by this qualified name is in the unnamed package.- Overrides:
isUnnamedPackage
in classJavaQualifiedName
-
getPackageList
public List<String> getPackageList()
Deprecated.Returns the packages in outer-to-inner order. This is specific to Java's package structure. If the outer class is in the unnamed package, returns an empty list.@NotNull
- Returns:
- The packages.
-
getClassList
public List<String> getClassList()
Deprecated.Returns the class specific part of the name. It identifies a class in the namespace it's declared in. If the class is nested inside another, then the list returned contains all enclosing classes in order, from outermost to innermost.@NotNull
- Returns:
- The class names.
-
getType
public Class<?> getType()
Deprecated.Gets the Class instance identified by this qualified name.- Returns:
- A class instance, or null if the classloader threw a
ClassNotFoundException
orLinkageError
while trying to load the class.
-
getBinaryName
public String getBinaryName()
Deprecated.Returns the binary name of the type identified by this qualified name. The binary name can be used to load aClass
using aClassLoader
. Contrary to this method,JavaQualifiedName.toString()
is not guaranteed to return a binary name. For most purposes, you should avoid using this method directly and usegetType()
instead. Just don't build a dependency on the toString if you want a binary name.- Returns:
- The binary name of the type identified by this qualified name
-
buildToString
protected String buildToString()
Deprecated.Description copied from class:JavaQualifiedName
Construct the toString once. Called only once per instance- Specified by:
buildToString
in classJavaQualifiedName
-
-