Package org.apache.bcel.generic
Class ObjectType
java.lang.Object
org.apache.bcel.generic.Type
org.apache.bcel.generic.ReferenceType
org.apache.bcel.generic.ObjectType
Denotes reference such as
String.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccessibleTo(ObjectType accessor) Java Virtual Machine Specification edition 2, 5.4.4 Access Control.booleanGets the class name.static ObjectTypegetInstance(String className) Constructs a new instance.inthashCode()Gets the hash code.booleanDeprecated.(since 6.0) this method returns an inaccurate result if the class or interface referenced cannot be found: use referencesClassExact() insteadbooleanReturn true if this type references a class, false if it references an interface.booleanDeprecated.(since 6.0) this method returns an inaccurate result if the class or interface referenced cannot be found: use referencesInterfaceExact() insteadbooleanReturn true if this type references an interface, false if it references a class.booleansubclassOf(ObjectType superclass) Return true if this type is a subclass of given ObjectType.Methods inherited from class org.apache.bcel.generic.ReferenceType
firstCommonSuperclass, getFirstCommonSuperclass, isAssignmentCompatibleWith, isCastableToMethods inherited from class org.apache.bcel.generic.Type
consumed, encode, getArgumentTypes, getArgumentTypesSize, getMethodSignature, getReturnType, getReturnTypeSize, getSignature, getSignature, getSize, getType, getType, getType, getTypes, getTypeSize, internalTypeNameToSignature, normalizeForStackOrLocal, size, toString
-
Field Details
-
className
-
-
Constructor Details
-
ObjectType
Constructs a new instance.- Parameters:
className- fully qualified class name, for exampleString.
-
-
Method Details
-
getInstance
Constructs a new instance.- Parameters:
className- fully qualified class name, for exampleString.- Returns:
- A new instance.
- Since:
- 6.0
-
accessibleTo
Java Virtual Machine Specification edition 2, 5.4.4 Access Control.- Parameters:
accessor- The accessing type.- Returns:
- true if accessible.
- Throws:
ClassNotFoundException- Thrown if the class referenced by this type can't be found.
-
equals
-
getClassName
Description copied from class:TypeGets the class name.- Overrides:
getClassNamein classType- Returns:
- name of referenced class.
-
hashCode
public int hashCode()Gets the hash code. -
referencesClass
Deprecated.(since 6.0) this method returns an inaccurate result if the class or interface referenced cannot be found: use referencesClassExact() insteadIf "this" doesn't reference a class, it references an interface or a non-existant entity.- Returns:
- true if it references a class, false otherwise.
-
referencesClassExact
Return true if this type references a class, false if it references an interface.- Returns:
- true if the type references a class, false if it references an interface.
- Throws:
ClassNotFoundException- Thrown if the class or interface referenced by this type can't be found
-
referencesInterface
Deprecated.(since 6.0) this method returns an inaccurate result if the class or interface referenced cannot be found: use referencesInterfaceExact() insteadIf "this" doesn't reference an interface, it references a class or a non-existant entity.- Returns:
- true if it references an interface, false otherwise.
-
referencesInterfaceExact
Return true if this type references an interface, false if it references a class.- Returns:
- true if the type references an interface, false if it references a class.
- Throws:
ClassNotFoundException- Thrown if the class or interface referenced by this type can't be found
-
subclassOf
Return true if this type is a subclass of given ObjectType.- Parameters:
superclass- The superclass to check against.- Returns:
- true if this is a subclass.
- Throws:
ClassNotFoundException- Thrown if any of this class's superclasses can't be found.
-