|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.1) E13403-09 |
|||||||||
| 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 JavaElementgetElementKind in class AbstractElementpublic abstract java.lang.String getName()
JavaTypeThe 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 JavaHasNamegetName in interface JavaTypepublic abstract java.lang.String getQualifiedName()
JavaTypeThe 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 JavaTypejava.lang.Object java.util.Map<String,String> java.lang.String[][]public abstract java.lang.String getVMName()
JavaTypeThe 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 JavaTypepublic abstract java.lang.String getDescriptor()
JavaTypeFor 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 JavaTypepublic abstract java.lang.String getUniqueIdentifier()
JavaTypegetUniqueIdentifier in interface JavaMembergetUniqueIdentifier in interface JavaTypepublic abstract JavaClass getTypeErasure()
JavaTypegetTypeErasure in interface JavaTypepublic JavaType getResolvedType()
JavaHasTypeA 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 JavaHasTypepublic UnresolvedType getUnresolvedType()
JavaHasTypegetUnresolvedType in interface JavaHasTypegetUnresolvedType in class AbstractElementpublic int getModifiers()
getModifiers in interface JavaElementgetModifiers in class AbstractElementpublic JavaElement getOwner()
JavaElementgetOwner in interface JavaElementgetOwner in class AbstractElementpublic JavaClass getOwningClass()
getOwningClass in interface JavaMemberclass 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 JavaTypepublic boolean isInterface()
isInterface in interface JavaTypepublic boolean isAnnotation()
isAnnotation in interface JavaTypepublic boolean isEnum()
isEnum in interface JavaTypepublic boolean isMemberClass()
JavaTypeisMemberClass in interface JavaTypepublic boolean isPrimitive()
isPrimitive in interface JavaTypepublic boolean isArray()
isArray in interface JavaTypepublic JavaType getComponentType()
getComponentType in interface JavaTypepublic int getArrayDimensions()
getArrayDimensions in interface JavaTypepublic JavaType getBaseComponentType()
getBaseComponentType in interface JavaTypepublic JavaTypeVariable getTypeParameter(java.lang.String name)
getTypeParameter in interface JavaIsGenericpublic java.lang.String getUnqualifiedName()
JavaTypeUnlike 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 JavaTypepublic java.lang.String getRawName()
JavaTypeThe 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 JavaTypepublic java.lang.String getSourceName()
public java.lang.String getSignature()
JavaTypeThe "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 JavaTypepublic java.lang.String printCompiledInfo()
JavaElementprintCompiledInfo in interface JavaElementprintCompiledInfo in class AbstractElementpublic java.net.URL getURL()
JavaTypegetURL in interface JavaType
@Deprecated
public JavaClass getClosestClass()
getTypeErasure().JavaTypeJavaType.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 JavaTypepublic CompiledTmpVariable getThisValue()
JavaTypeEXPERIMENTAL.
getThisValue in interface JavaTypepublic JavaPackage getPackage()
JavaTypegetPackage in interface JavaTypepublic java.lang.String getPackageName()
JavaTypegetPackageName in interface JavaTypepublic JavaType getSuperclass()
JavaTypegetSuperclass in interface JavaTypeIf 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()
JavaTypegetInterfaces in interface JavaTypepublic java.util.Collection<UnresolvedType> getUnresolvedInterfaces()
JavaTypegetUnresolvedInterfaces in interface JavaTypepublic java.util.Set getHierarchy()
JavaTypeThe 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 JavaTypepublic 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 JavaTypepublic boolean isSubtypeOf(JavaType supertype)
JavaTypeisSubtypeOf in interface JavaTypepublic java.util.Collection getDeclaredFields()
getDeclaredFields in interface JavaTypepublic JavaField getDeclaredField(java.lang.String name)
getDeclaredField in interface JavaTypename - Require non-null.public java.util.Collection getDeclaredMethods()
getDeclaredMethods in interface JavaTypepublic java.util.Collection getDeclaredMethods(java.lang.String name)
getDeclaredMethods in interface JavaType
public JavaMethod getDeclaredMethod(java.lang.String name,
JavaType[] targetTypes)
getDeclaredMethod in interface JavaTypetargetTypes - Null indicates an empty parameter list.public java.util.Collection getDeclaredConstructors()
getDeclaredConstructors in interface JavaTypepublic JavaMethod getDeclaredConstructor(JavaType[] targetTypes)
getDeclaredConstructor in interface JavaTypetargetTypes - Null indicates an empty parameter list.public JavaMethod getClinitMethod()
getClinitMethod in interface JavaTypepublic java.util.Collection getDeclaredClasses()
JavaTypegetDeclaredClasses in interface JavaTypepublic JavaClass getDeclaredClass(java.lang.String name)
getDeclaredClass in interface JavaTypepublic java.util.Collection getFields()
JavaTypeThe implicit length field for array types is not reflected by this method.
getFields in interface JavaTypepublic JavaField getField(java.lang.String name)
JavaTypeThe implicit length field for array types is not reflected by this method.
getField in interface JavaTypename - Require non-null.public java.util.Collection getMethods()
JavaTypegetMethods in interface JavaTypepublic java.util.Collection getMethods(java.lang.String name)
JavaTypegetMethods in interface JavaTypename - Require non-null.
public JavaMethod getMethod(java.lang.String name,
JavaType[] targetTypes)
JavaTypegetMethod in interface JavaTypename - Require non-null.targetTypes - Null indicates an empty parameter list.public java.util.Collection getClasses()
JavaTypegetClasses in interface JavaTypepublic JavaClass getClass(java.lang.String name)
JavaTypeNote: Be careful not to get this confused with JavaProvider.getClass( String ).
getClass in interface JavaTypepublic java.util.Collection getAnnotations()
JavaHasAnnotationsgetAnnotations in interface JavaHasAnnotationsgetAnnotations in class AbstractElementpublic JavaAnnotation getAnnotation(JavaType annotationType)
JavaHasAnnotationsgetAnnotation in interface JavaHasAnnotationsgetAnnotation in class AbstractElementpublic boolean equals(java.lang.Object o)
equals in interface JavaTypeequals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void clearCompiledInfo()
AbstractElementclearCompiledInfo in class AbstractElement
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.1) E13403-09 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||