Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
int |
hashCode() |
static ClassName |
parseClassName(java.lang.String string) |
static ClassName |
parseClassNameSuperClass(ClassFile classFile)
Parses the
String indirectly referred to by classFile.getSuperClass() into a ClassName instance. |
static ClassName |
parseClassNameThisClass(ClassFile classFile)
Parses the
String indirectly referred to by classFile.getThisClass() into a ClassName instance. |
java.lang.Class<?> |
toClass() |
java.lang.String |
toExternalForm() |
java.lang.String |
toInternalForm() |
java.lang.String |
toString() |
public java.lang.Class<?> toClass() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.String toExternalForm()
public java.lang.String toInternalForm()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static ClassName parseClassName(java.lang.String string)
public static ClassName parseClassNameSuperClass(ClassFile classFile)
String
indirectly referred to by classFile.getSuperClass()
into a ClassName
instance.
Returns a ClassName
instance.
If classFile
is null
, a NullPointerException
will be thrown.
If the String
indirectly referred to by classFile.getSuperClass()
cannot be retrieved, or it is malformed, an IllegalArgumentException
will be thrown.
In order to retrieve the String
to parse, classFile.getSuperClass()
must point to a valid index in the constant_pool table. The CPInfo
at that index must be a ConstantClassInfo
instance. The method
getNameIndex()
of the ConstantClassInfo
instance must also point to a valid index in the constant_pool table. The CPInfo
at this index must be a ConstantUTF8Info
instance. The method getString()
of the
ConstantUTF8Info
instance must return a String
that is not malformed.
classFile
- a ClassFile
ClassName
instancejava.lang.IllegalArgumentException
- thrown if, and only if, the String
indirectly referred to by classFile.getSuperClass()
cannot be retrieved, or it is malformedjava.lang.NullPointerException
- thrown if, and only if, classFile
is null
public static ClassName parseClassNameThisClass(ClassFile classFile)
String
indirectly referred to by classFile.getThisClass()
into a ClassName
instance.
Returns a ClassName
instance.
If classFile
is null
, a NullPointerException
will be thrown.
If the String
indirectly referred to by classFile.getThisClass()
cannot be retrieved, or it is malformed, an IllegalArgumentException
will be thrown.
In order to retrieve the String
to parse, classFile.getThisClass()
must point to a valid index in the constant_pool table. The CPInfo
at that index must be a ConstantClassInfo
instance. The method
getNameIndex()
of the ConstantClassInfo
instance must also point to a valid index in the constant_pool table. The CPInfo
at this index must be a ConstantUTF8Info
instance. The method getString()
of the
ConstantUTF8Info
instance must return a String
that is not malformed.
classFile
- a ClassFile
ClassName
instancejava.lang.IllegalArgumentException
- thrown if, and only if, the String
indirectly referred to by classFile.getThisClass()
cannot be retrieved, or it is malformedjava.lang.NullPointerException
- thrown if, and only if, classFile
is null