|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeD
Represents a type.
The order of the member listing should be determined by the type hierarchy. If type B occurs before type A in the type hierarchy, then all of B's declared members should occur before any of A's declared members in the member collection. Consider the following two classes.
class A { int a; } class B extends A { int b; }
The iterator for the collection returned for the member fields of B should always return B.b
before A.a
. Order within the same declaring type is not defined.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface javax.ide.model.java.declaration.Declaration |
---|
Declaration.DeclarationKind |
Field Summary | |
---|---|
static TypeD[] |
EMPTY_ARRAY |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o) True if the other object is also a TypeD and they represent the same type. |
ClassD |
getClass(java.lang.String name) Gets the first matching member class, null if none. |
java.util.Collection |
getClasses() Gets all member classes, declared and inherited. |
ClassD |
getDeclaredClass(java.lang.String name) Gets the matching member class, null if none. |
java.util.Collection |
getDeclaredClasses() Gets all declared member classes. |
ConstructorD |
getDeclaredConstructor(TypeD[] parameters) Gets the matching declared constructor, null if none. |
java.util.Collection |
getDeclaredConstructors() Gets all declared constructors. |
FieldD |
getDeclaredField(java.lang.String name) Gets the first matching declared field, null if none. |
java.util.Collection |
getDeclaredFields() Gets all declared fields. |
MethodD |
getDeclaredMethod(java.lang.String name, TypeD[] parameters) Gets the matching declared method, null if none. |
java.util.Collection |
getDeclaredMethods() Gets all declared methods. |
java.util.Collection |
getDeclaredMethods(java.lang.String name) Gets all matching declared methods. |
java.lang.String |
getDescriptor() Gets the descriptor for this type, as defined by the JVMS2. |
FieldD |
getField(java.lang.String name) Gets the matching member field, null if none. |
java.util.Collection |
getFields() Gets all member fields, declared and inherited. |
java.util.Collection |
getHierarchy() Recursively gets all direct supertypes. |
java.util.Collection |
getInterfaces() Gets this type's super-interfaces. |
MethodD |
getMethod(java.lang.String name, TypeD[] parameters) Gets the first matching method, null if none. |
java.util.Collection |
getMethods() Gets all member methods, declared and inherited. |
java.util.Collection |
getMethods(java.lang.String name) Gets all matching methods. |
java.lang.String |
getQualifiedName() Gets the fully qualified name of this type in source format. |
TypeD |
getSuperclass() Gets this type's superclass. |
TypeD |
getType() Gets itself as its type. |
ClassD |
getTypeErasure() Gets the type erasure of this type. |
java.lang.String |
getTypeSignature() Gets the type signature for this type, as defined by the JVMS3. |
boolean |
isAnnotation() True if this is an annotation type. |
boolean |
isArray() True if this is an array type. |
boolean |
isAssignableFrom(TypeD subject) True if this type is assignable from the subject type. |
boolean |
isEnum() True if this is an enum type. |
boolean |
isInterface() True if this is an interface. |
boolean |
isPrimitive() True if this is a primitive type, including the special void type. |
Methods inherited from interface javax.ide.model.java.declaration.HasNameD |
---|
getName |
Methods inherited from interface javax.ide.model.java.declaration.Declaration |
---|
getDeclarationKind, getPosition, isSynthetic |
Field Detail |
---|
static final TypeD[] EMPTY_ARRAY
Method Detail |
---|
TypeD getType()
getType
in interface HasTypeD
ClassD getTypeErasure()
boolean isPrimitive()
void
type.boolean isArray()
boolean isEnum()
boolean isAnnotation()
boolean isInterface()
java.lang.String getQualifiedName()
An array type returns the fully qualified name of its component type suffixed by the appropriate number of brackets. Parameterized types return the fully qualified name of its unparameterize type suffixed with the type parameters. A local inner class returns only its simple name because that is how it is referred to in a source compilation unit.
Note: Anonymous inner classes return the empty string because they may not be referred to in a source compilation unit.
java.lang.Object
, java.util.Map<String,String>
, java.lang.String[][]
java.lang.String getDescriptor()
For jdk < 1.5, the "FieldDescriptor" is returned (JVMS2). For jdk >= 1.5, a type signature of the type erasure is returned.
Note: The descriptor is equivalent to the type signature of this type's erasure.
java.lang.String getTypeSignature()
A ClassD returns its "ClassTypeSignature" (JVMS3). A ClassD is uniquely identified by its type signature. Example value: Ljava/util/List<Ljava/lang/Object;>;
A TypeVariableD returns its "TypeVariableSignature" (JVMS3). A TypeVariableD is uniquely identified by its owning declaration and its type signature. Example value: TE;
.
A WildcardTypeD returns its "TypeArgument" value (JVMS3). A WildcardTypeD is uniquely identified by its type signature. Example values: *
+Ljava/lang/Object;
TypeD getSuperclass()
If this is a ClassD: Null is returned 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 TypeVariableD: Null if no superclass was declared AND an interface as declared.
If this is a WildcardTypeD: Always non-null. If no superclass was declared, then the TypeD for java/lang/Object is returned.
Note: Wildcard types may have a type variable as an upper bound, therefore, this must return a TypeD instead of a ClassD.
java.util.Collection getInterfaces()
Collection of TypeDs.
java.util.Collection getHierarchy()
For ClassDs, this means superclasses and superinterfaces. Order is depth-first, classes before interfaces, left-to-right, no duplicates.
For TypeVariableDs and WildcardTypeDs, this means bounds.
Collection of TypeDs.
boolean isAssignableFrom(TypeD subject)
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.
Reflection does not perform auto-boxing and therefore, neither does this.
java.util.Collection getDeclaredFields()
Collection of FieldDs.
FieldD getDeclaredField(java.lang.String name)
name
- The name to match. Require non-null.java.util.Collection getDeclaredConstructors()
Note: Constructors are not inherited, so the collection of declared constructors is the same as the collection of constructors.
Collection of ConstructorDs.
ConstructorD getDeclaredConstructor(TypeD[] parameters)
parameters
- The exact parameter types to match. Null indicates an empty parameter list.java.util.Collection getDeclaredMethods()
clinit
method. Does not include the various "access$" methods that may be present in class files.clinit
method.
Collection of MethodDs.
java.util.Collection getDeclaredMethods(java.lang.String name)
name
- The method name to match. Require non-null.Collection of MethodDs.
MethodD getDeclaredMethod(java.lang.String name, TypeD[] parameters)
name
- The method name to match. Require non-null.parameters
- The exact parameter types to match. Null indicates an empty parameter list.java.util.Collection getDeclaredClasses()
TODO: Should this return local and anonymous inner classes? I don't remember what reflection does.
Collection of ClassDs.
ClassD getDeclaredClass(java.lang.String name)
java.util.Collection getFields()
For more detal on members, please see the Members discussion at TypeD
.
Note: The implicit "length" field for array types should be suppressed because according to the JLS, it is technically not a member variable.
Collection of FieldDs.
FieldD getField(java.lang.String name)
name
- The field name to match. Require non-null.java.util.Collection getMethods()
For more detal on members, please see the Members discussion at TypeD
.
Collection of MethodDs.
java.util.Collection getMethods(java.lang.String name)
name
- The method name to match. Require non-null.Collection of MethodDs.
MethodD getMethod(java.lang.String name, TypeD[] parameters)
name
- The method name to match. Require non-null.parameters
- The exact parameter types to match. Null indicates an empty parameter list.java.util.Collection getClasses()
For more detal on members, please see the Members discussion at TypeD
.
Collection of ClassDs.
ClassD getClass(java.lang.String name)
name
- The simple class name to match. Require non-null.boolean equals(java.lang.Object o)
ClassDs and WildcardTypeDs are uniquely identified by their type signatures. TypeVariableDs are uniquely identified by both their owning declaration and type signature.
equals
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |