|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.parser.java.v2.common.AbstractElement
oracle.javatools.parser.java.v2.common.AbstractType
public abstract class AbstractType
An abstract implementation of JavaType. Provided so that all implementations have a consistent behavior for equals(O) and hashCode(). If you want to implement JavaClass, then you should extend AbstractClass instead.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface oracle.javatools.parser.java.v2.JavaPreferences |
---|
JavaPreferences.MemberOrder |
Field Summary |
---|
Fields inherited from interface oracle.javatools.parser.java.v2.model.JavaType |
---|
EMPTY_ARRAY |
Fields inherited from interface oracle.javatools.parser.java.v2.JavaOperators |
---|
OPT_ADD, OPT_ADDASG, OPT_AND, OPT_ANNOTATION, OPT_ARRAYCONST, OPT_ASG, OPT_base, OPT_BITAND, OPT_BITANDASG, OPT_BITNOT, OPT_BITOR, OPT_BITORASG, OPT_BITXOR, OPT_BITXORASG, OPT_CLASS_LITERAL, OPT_COND, OPT_DEREF, OPT_DIV, OPT_DIVASG, OPT_DOT, OPT_EQ, OPT_GE, OPT_GT, OPT_INSTANCEOF, OPT_invalid, OPT_INVOKE, OPT_LE, OPT_LIST, OPT_LITERAL, OPT_LSH, OPT_LSHASG, OPT_LT, OPT_max, OPT_MINUS, OPT_MINUSASG, OPT_MOD, OPT_MODASG, OPT_MUL, OPT_MULASG, OPT_NEGATIVE, OPT_NESTEXP, OPT_NEWARRAY, OPT_NEWOBJECT, OPT_NOT, OPT_NOTEQ, OPT_OR, OPT_POSITIVE, OPT_POSTDEC, OPT_POSTINC, OPT_precedence, OPT_PREDEC, OPT_PREINC, OPT_QUALIFIED_SUPER, OPT_QUALIFIED_THIS, OPT_RSH, OPT_RSHASG, OPT_SIMPLE_NAME, OPT_tokens, OPT_TYPE, OPT_TYPECAST, OPT_URSH, OPT_URSHASG, OPT_words |
Constructor Summary | |
---|---|
AbstractType() |
Method Summary | |
---|---|
void |
clearCompiledInfo() Overrides should chain. |
boolean |
equals(java.lang.Object o) |
JavaAnnotation |
getAnnotation(JavaType annotationType) Retrieves the annotation declared on this element that matches the input annotation type. |
java.util.Collection |
getAnnotations() Retrieves all the annotations declared on this element. |
int |
getArrayDimensions() |
JavaType |
getBaseComponentType() |
JavaClass |
getClass(java.lang.String name) Iteratively retrieves all member classes declared in this class or its hierarchy. |
java.util.Collection |
getClasses() Iteratively retrieves all member classes declared in this class or its hierarchy. |
JavaMethod |
getClinitMethod() |
JavaClass |
getClosestClass() Deprecated. Please use getTypeErasure() . |
JavaType |
getComponentType() |
JavaClass |
getDeclaredClass(java.lang.String name) |
java.util.Collection |
getDeclaredClasses() In order to get all inner classes, clients must recurse through direct inner classes. |
JavaMethod |
getDeclaredConstructor(JavaType[] targetTypes) |
java.util.Collection |
getDeclaredConstructors() |
JavaField |
getDeclaredField(java.lang.String name) |
java.util.Collection |
getDeclaredFields() |
JavaMethod |
getDeclaredMethod(java.lang.String name, JavaType[] targetTypes) |
java.util.Collection |
getDeclaredMethods() |
java.util.Collection |
getDeclaredMethods(java.lang.String name) |
abstract java.lang.String |
getDescriptor() Gets the descriptor for this type, as defined by the JVMS2. |
abstract int |
getElementKind() |
JavaField |
getField(java.lang.String name) Iteratively searches for a field declared in this class or its hierarchy. |
java.util.Collection |
getFields() Iteratively retrieves all fields declared in this class and its hierarchy. |
java.util.Set |
getHierarchy() Recursively gets the full list of all resolved superclasses and super-interfaces. |
java.util.Collection |
getInterfaces() The name "getInterfaces" was chosen to be consistent with java/lang/Class. |
JavaMethod |
getMethod(java.lang.String name, JavaType[] targetTypes) Iteratively searches for a method declared in this class or its hierarchy. |
java.util.Collection |
getMethods() Iteratively retrieves all methods declared in this class or its hierarchy. |
java.util.Collection |
getMethods(java.lang.String name) Iteratively retrieves all methods declared in this class or its hierarchy. |
int |
getModifiers() |
abstract java.lang.String |
getName() Gets the simplest name of this type with "[]"s if present. |
JavaElement |
getOwner() TODO: Document me! |
JavaClass |
getOwningClass() |
JavaMethod |
getOwningMethod() |
JavaPackage |
getPackage() Gets the owning package, null if N/A. |
java.lang.String |
getPackageName() Gets the qualified name of the owning package. |
abstract java.lang.String |
getQualifiedName() Gets the fully qualified name of this type in source format. |
java.lang.String |
getRawName() Gets the raw name of this type. |
JavaType |
getResolvedType() A JavaField instance will return the field's type. |
java.lang.String |
getSignature() Gets the "Signature" attribute of this type, as defined by the JVMS3. |
java.lang.String |
getSourceName() |
JavaType |
getSuperclass() The name "getSuperclass" was chosen to be consistent with java/lang/Class. |
CompiledTmpVariable |
getThisValue() In the interest of minimizing the number of tmp variables floating around in the heap, each type may create a value object (when needed) and store it (with a weak reference) for later use. |
abstract JavaClass |
getTypeErasure() Gets the type erasure of this type, as defined by the JLS3. |
JavaTypeVariable |
getTypeParameter(java.lang.String name) |
abstract java.lang.String |
getUniqueIdentifier() Gets a unique identifier for this type. |
java.lang.String |
getUnqualifiedName() Gets the name of this type in its unqualified form. |
java.util.Collection<UnresolvedType> |
getUnresolvedInterfaces() When reverse engineering byecode, some types cannot be resolved if the correct owning project is not associated to the JavaProvider. |
UnresolvedType |
getUnresolvedType() Information about a type that has not been resolved. |
java.net.URL |
getURL() If the input for this type is a *.class file, the returned URL will be for the *.class file. |
abstract java.lang.String |
getVMName() Gets the VM name for this type. |
int |
hashCode() |
boolean |
isAnnotation() |
boolean |
isArray() |
boolean |
isAssignableFrom(JavaType subject) Consider the following expression where S (subject) represents another type and T (this) represents this type. |
boolean |
isEnum() |
boolean |
isExported() |
boolean |
isInterface() |
boolean |
isMemberClass() True if this is a member type. |
boolean |
isPrimitive() |
boolean |
isSubtypeOf(JavaType supertype) True if this is a subtype of the indicated argument. |
java.lang.String |
printCompiledInfo() Debugging function for printing out compiled information. |
Methods inherited from class oracle.javatools.parser.java.v2.common.AbstractElement |
---|
getActualTypeArguments, getDeclaredAnnotation, getDeclaredAnnotations, getSourceElement, getSourceSymbol, getTypeParameters, hasActualTypeArguments, hasTypeParameters, isAbstract, isDeprecated, isFinal, isHidden, isPackagePrivate, isPrivate, isProtected, isPublic, isSourceElement, isStatic, isSynthetic, isTransient, isVarargs |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaType |
---|
getTypeSignature |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaIsGeneric |
---|
getActualTypeArguments, getTypeParameters, hasActualTypeArguments, hasTypeParameters |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaMember |
---|
isAbstract, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaHasAnnotations |
---|
getDeclaredAnnotation, getDeclaredAnnotations |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaElement |
---|
getFile, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic |
Constructor Detail |
---|
public AbstractType()
Method Detail |
---|
public abstract int getElementKind()
getElementKind
in interface JavaElement
getElementKind
in class AbstractElement
public abstract java.lang.String getName()
JavaType
The name of a non-parametrized top-level type of the form "pkg.Cls" is "Cls".
The name of a non-parametrized member type of the form "pkg.Cls.InnerClass" is "InnerClass".
The name of an array type T[] is the name of T suffixed by the appropriate number of "[]"s.
The name of a parametrized type is the same as the name of its raw type. That is, the name of "pkg.Cls<String>" is simply "Cls".
The name of a wildcard type is always "?".
The name of a type parameter should be pretty obvious.
The name of a primitive type should be pretty obvious.
The name of a local inner class is just its name.
An anonymous inner classes does not have a name and will return the empty string.
getName
in interface JavaHasName
getName
in interface JavaType
public abstract java.lang.String getQualifiedName()
JavaType
The source name of a non-parametrized top-level type of the form "pkg.Cls" is "pkg.Cls".
The source name of a non-parametrized member type of the form T.InnerClass (that is, a member type InnerClass that is a member of type T) is the source name of T suffixed with by ".InnerClass", e.g. "java.util.Map.Entry", "pkg.Cls<?>.InnerClass".
The source name of a parametrized type starts with the source name of the raw type and lists the source name of all of its actual type argumenths, e.g. "java.util.List<java.lang.String>". The source name of an array type T[] is the source name of T suffixed by the appropriate number of "[]"s.
The source name of a wildcard type is the string with which it would appear in a source file. The three possible forms this can take are: "?", "? extends T", "? super T".
The source name of a type parameter is just its name.
The source name of a primitive type should be pretty obvious.
The source name of a local inner class is just its name because a local inner class is referenced, in a source file, by its name.
An anonymous inner classes does not have a source name. It will return the empty string for its source name.
Open for discussion: What should be returned by an anonymous class? Technically, the concept of a source name is irrelevant because anonymous classes may not be referred to in a source compilation unit.
getQualifiedName
in interface JavaType
java.lang.Object
java.util.Map<String,String>
java.lang.String[][]
public abstract java.lang.String getVMName()
JavaType
The VM name of a non-parametrized top-level type of the form "pkg.Cls" is "pkg/Cls".
The VM name of a non-parametrized member-level type of the form "pkg.Cls.InnerClass" is "pkg/Cls$InnerClass".
The VM name of a parametrized type is the VM name of the raw type. Because parametrization is stripped at run-time, we will omit it from the VM name.
The VM name of an array type T[] is the VM name of T suffixed by the appropriate number of "[]"s.
The VM name of a local inner class or anonymous inner class is a string that uniquely identifies it from all other types and is usually prefixed with the VM name of its directly enclosing class. For example, an anonymous inner class belonging to the type "pkg.Cls" may return "pkg/Cls$1".
The VM name of any other type is the same as its source name.
getVMName
in interface JavaType
public abstract java.lang.String getDescriptor()
JavaType
For jdk < 1.5, the "FieldDescriptor" is returned (JVMS2). For jdk < 1.5, descriptors and signatures are the same thing.
For jdk >= 1.5, a type signature of the type erasure is returned.
Note: Do not confuse a type's descriptor with a method's descriptor. The descriptor of the type of a method is the field descriptor describing its return type. The descriptor of a method describes parameter types.
getDescriptor
in interface JavaType
public abstract java.lang.String getUniqueIdentifier()
JavaType
getUniqueIdentifier
in interface JavaMember
getUniqueIdentifier
in interface JavaType
public abstract JavaClass getTypeErasure()
JavaType
getTypeErasure
in interface JavaType
public JavaType getResolvedType()
JavaHasType
A JavaMethod instance will return the method's return type.
A JavaVariable instance will return the variable's type.
A JavaType instance will return itself.
getResolvedType
in interface JavaHasType
public UnresolvedType getUnresolvedType()
JavaHasType
getUnresolvedType
in interface JavaHasType
getUnresolvedType
in class AbstractElement
public int getModifiers()
getModifiers
in interface JavaElement
getModifiers
in class AbstractElement
public JavaElement getOwner()
JavaElement
getOwner
in interface JavaElement
getOwner
in class AbstractElement
public JavaClass getOwningClass()
getOwningClass
in interface JavaMember
class C<E>
{
E field;
{
C generic = new C();
generic.field = null;
C<String> specific = new C<String>();
specific.field = null;
}
}
If this instance represents the member field accessed by "generic.field", then getOwningClass will return the type for "C".
If this instance represents the member field accessed by "specific.field", then getOwningClass will return the type for "C<String>".
Further, the expressions "generic.field" and "specific.field" do not refer to the same JavaField instance.
public JavaMethod getOwningMethod()
public boolean isExported()
isExported
in interface JavaType
public boolean isInterface()
isInterface
in interface JavaType
public boolean isAnnotation()
isAnnotation
in interface JavaType
public boolean isEnum()
isEnum
in interface JavaType
public boolean isMemberClass()
JavaType
isMemberClass
in interface JavaType
public boolean isPrimitive()
isPrimitive
in interface JavaType
public boolean isArray()
isArray
in interface JavaType
public JavaType getComponentType()
getComponentType
in interface JavaType
public int getArrayDimensions()
getArrayDimensions
in interface JavaType
public JavaType getBaseComponentType()
getBaseComponentType
in interface JavaType
public JavaTypeVariable getTypeParameter(java.lang.String name)
getTypeParameter
in interface JavaIsGeneric
public java.lang.String getUnqualifiedName()
JavaType
Unlike getName(), this will contain type parameters in their unqualified form. In other words, for types containing no type parameterization, the behavior is the same as getName().
getUnqualifiedName
in interface JavaType
public java.lang.String getRawName()
JavaType
The raw name of a parametrized top-level or member or local inner type is the source name of its type erasure, as defined by the JLS3. Think of the raw name as the source name with all parametrization stripped out.
The raw name of an array type T[] is the raw name of T suffixed by the appropriate number of "[]"s.
The raw name for any other type is the same as its source name.
getRawName
in interface JavaType
public java.lang.String getSourceName()
public java.lang.String getSignature()
JavaType
The "Signature" attribute for a field is the "ClassTypeSignature" for its type.
The "Signature" attribute for a method involves the "ClassSignature"s for its type parameters and the "ClassTypeSignature"s of its remaining constituent types.
A JavaClass returns its "ClassSignature" (JVMS3).
A JavaTypeVariable does not have a class signature, but will return a string for use in a class signature or a method signature.
A WildcardType does not have a class signature and may not part of a class signature. Its return value is undefined.
getSignature
in interface JavaType
public java.lang.String printCompiledInfo()
JavaElement
printCompiledInfo
in interface JavaElement
printCompiledInfo
in class AbstractElement
public java.net.URL getURL()
JavaType
getURL
in interface JavaType
@Deprecated
public JavaClass getClosestClass()
getTypeErasure()
.JavaType
JavaType.getTypeErasure()
. If this type is a ...
... JavaClass, then it is returned.
... JavaTypeVariable, then the first bound is returned. There is always at least one bound.
... JavaWildcardType, then the lower bound is returned. There is always at least one lower bound.
getClosestClass
in interface JavaType
public CompiledTmpVariable getThisValue()
JavaType
EXPERIMENTAL.
getThisValue
in interface JavaType
public JavaPackage getPackage()
JavaType
getPackage
in interface JavaType
public java.lang.String getPackageName()
JavaType
getPackageName
in interface JavaType
public JavaType getSuperclass()
JavaType
getSuperclass
in interface JavaType
If this is a JavaClass: Null for java/lang/Object and primitive types, non-null otherwise. Where no base class was declared, java/lang/Object is returned, even for interfaces.
If this is a JavaType: Null if no superclass was declared AND an interface was declared.
If this is a JavaWildcardType: Always null.
public java.util.Collection getInterfaces()
JavaType
getInterfaces
in interface JavaType
public java.util.Collection<UnresolvedType> getUnresolvedInterfaces()
JavaType
getUnresolvedInterfaces
in interface JavaType
public java.util.Set getHierarchy()
JavaType
The full list of base classes and base interfaces does not have duplicates.
Here, the definition of "hierarchy" is the set of types that this type inherits members from. That is, "hierarchy" is defined by the "inherits from" relationship rather than from the "is a subtype of" relationship.
getHierarchy
in interface JavaType
public boolean isAssignableFrom(JavaType subject)
JavaType
void method( S subject ) { T variable = subject; }Notice that because the parameter subject is not a constant-value, the assignment conversion will not perform the implicit narrowing conversion.
NOTE: At the current writing, isAssignableFrom does not perform auto-boxing.
isAssignableFrom
in interface JavaType
public boolean isSubtypeOf(JavaType supertype)
JavaType
isSubtypeOf
in interface JavaType
public java.util.Collection getDeclaredFields()
getDeclaredFields
in interface JavaType
public JavaField getDeclaredField(java.lang.String name)
getDeclaredField
in interface JavaType
name
- Require non-null.public java.util.Collection getDeclaredMethods()
getDeclaredMethods
in interface JavaType
public java.util.Collection getDeclaredMethods(java.lang.String name)
getDeclaredMethods
in interface JavaType
public JavaMethod getDeclaredMethod(java.lang.String name, JavaType[] targetTypes)
getDeclaredMethod
in interface JavaType
targetTypes
- Null indicates an empty parameter list.public java.util.Collection getDeclaredConstructors()
getDeclaredConstructors
in interface JavaType
public JavaMethod getDeclaredConstructor(JavaType[] targetTypes)
getDeclaredConstructor
in interface JavaType
targetTypes
- Null indicates an empty parameter list.public JavaMethod getClinitMethod()
getClinitMethod
in interface JavaType
public java.util.Collection getDeclaredClasses()
JavaType
getDeclaredClasses
in interface JavaType
public JavaClass getDeclaredClass(java.lang.String name)
getDeclaredClass
in interface JavaType
public java.util.Collection getFields()
JavaType
The implicit length field for array types is not reflected by this method.
getFields
in interface JavaType
public JavaField getField(java.lang.String name)
JavaType
The implicit length field for array types is not reflected by this method.
getField
in interface JavaType
name
- Require non-null.public java.util.Collection getMethods()
JavaType
getMethods
in interface JavaType
public java.util.Collection getMethods(java.lang.String name)
JavaType
getMethods
in interface JavaType
name
- Require non-null.public JavaMethod getMethod(java.lang.String name, JavaType[] targetTypes)
JavaType
getMethod
in interface JavaType
name
- Require non-null.targetTypes
- Null indicates an empty parameter list.public java.util.Collection getClasses()
JavaType
getClasses
in interface JavaType
public JavaClass getClass(java.lang.String name)
JavaType
Note: Be careful not to get this confused with JavaProvider.getClass( String ).
getClass
in interface JavaType
public java.util.Collection getAnnotations()
JavaHasAnnotations
getAnnotations
in interface JavaHasAnnotations
getAnnotations
in class AbstractElement
public JavaAnnotation getAnnotation(JavaType annotationType)
JavaHasAnnotations
getAnnotation
in interface JavaHasAnnotations
getAnnotation
in class AbstractElement
public boolean equals(java.lang.Object o)
equals
in interface JavaType
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void clearCompiledInfo()
AbstractElement
clearCompiledInfo
in class AbstractElement
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |