|
Eclipse JDT 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A type binding represents a class type, interface type, array type, a
primitive type (including the special return type void), or the
null type.
This interface is not intended to be implemented by clients.
getDeclaredTypes()| Field Summary |
| Fields inherited from interface org.eclipse.jdt.core.dom.IBinding |
METHOD, PACKAGE, TYPE, VARIABLE |
| Method Summary | |
IVariableBinding[] |
getDeclaredFields()
Returns a list of bindings representing all the fields declared as members of this class or interface. |
IMethodBinding[] |
getDeclaredMethods()
Returns a list of method bindings representing all the methods and constructors declared for this class or interface. |
int |
getDeclaredModifiers()
Returns the declared modifiers for this class or interface binding as specified in the original source declaration of the class or interface. |
ITypeBinding[] |
getDeclaredTypes()
Returns a list of type bindings representing all the classes and interfaces declared as members of this class or interface type. |
ITypeBinding |
getDeclaringClass()
Returns the type binding representing the class or interface that declares this binding. |
int |
getDimensions()
Returns the dimensionality of this array type, or 0 if this
is not an array type binding. |
ITypeBinding |
getElementType()
Returns the binding representing the element type of this array type, or null if this is not an array type binding. |
ITypeBinding[] |
getInterfaces()
Returns a list of type bindings representing the direct superinterfaces of the class or interface represented by this type binding. |
int |
getModifiers()
Returns the compiled modifiers for this class or interface binding. |
String |
getName()
Returns the unqualified name of the type represented by this binding. |
IPackageBinding |
getPackage()
Returns the binding for the package in which this class or interface is declared. |
String |
getQualifiedName()
Returns the fully qualified name of the type represented by this binding if it has one. |
ITypeBinding |
getSuperclass()
Returns the type binding for the superclass of the type represented by this class binding. |
boolean |
isAnonymous()
Returns whether this type binding represents an anonymous class. |
boolean |
isArray()
Returns whether this type binding represents an array type. |
boolean |
isClass()
Returns whether this type binding represents a class type. |
boolean |
isFromSource()
Returns whether this type binding originated in source code. |
boolean |
isInterface()
Returns whether this type binding represents an interface type. |
boolean |
isLocal()
Returns whether this type binding represents a local class or interface. |
boolean |
isMember()
Returns whether this type binding represents a member class or interface. |
boolean |
isNested()
Returns whether this type binding represents a nested class or interface. |
boolean |
isNullType()
Returns whether this type binding represents the null type. |
boolean |
isPrimitive()
Returns whether this type binding represents a primitive type. |
boolean |
isTopLevel()
Returns whether this type binding represents a top-level class or interface. |
| Methods inherited from interface org.eclipse.jdt.core.dom.IBinding |
equals, getKey, getKind, isDeprecated, isSynthetic, toString |
| Method Detail |
public boolean isPrimitive()
There are nine predefined type bindings to represent the eight primitive
types and void. These have the same names as the primitive
types that they represent, namely boolean, byte, char, short, int,
long, float, and double, and void.
The set of primitive types is mutually exclusive with the sets of array types, with the sets of class and interface types, and with the null type.
true if this type binding is for a primitive type,
and false otherwiseisArray(),
isClass(),
isInterface()public boolean isNullType()
The null type is the type of a NullLiteral node.
The null type is mutually exclusive with the sets of array types, with the sets of class and interface types, and with the set of primitive types .
true if this type binding is for the null type,
and false otherwisepublic boolean isArray()
The set of array types is mutually exclusive with the sets of primitive types and with the sets of class and interface types.
true if this type binding is for an array type,
and false otherwiseisClass(),
isInterface(),
isPrimitive()public ITypeBinding getElementType()
null if this is not an array type binding. The element
type of an array is never itself an array type.
null if this is
not an array typepublic int getDimensions()
0 if this
is not an array type binding.
0 if this is not an array typepublic boolean isClass()
The set of class types is mutually exclusive with the sets of primive types, array types, interface types, and the null type.
true if this object represents a class,
and false otherwiseisArray(),
isInterface(),
isPrimitive()public boolean isInterface()
The set of interface types is mutually exclusive with the sets of primive types, array types, class types, and the null type.
true if this object represents an interface,
and false otherwiseisArray(),
isClass(),
isPrimitive()public String getName()
For named classes and interfaces, this is the simple name of the type. For primitive types, the name is the keyword for the primitive type. For array types, the name is the unqualified name of the component type followed by "[]". If this represents an anonymous class, it returns an empty string (note that it is impossible to have an array type with an anonymous class as element type). For the null type, it returns "null".
getName in interface IBindinggetQualifiedName()public IPackageBinding getPackage()
null if this type binding represents a
primitive type, an array type, or the null type.public ITypeBinding getDeclaringClass()
The declaring class of a member class or interface is the class or interface of which it is a member. The declaring class of a local class or interface (including anonymous classes) is the innermost class or interface containing the expression or statement in which this type is declared. Array types, primitive types, the null type, and top-level types have no declaring class.
null if nonepublic ITypeBinding getSuperclass()
If this type binding represents any class other than the class
java.lang.Object, then the type binding for the direct
superclass of this class is returned. If this type binding represents
the class java.lang.Object, then null is
returned.
Loops that ascend the class hierarchy need a suitable termination test.
Rather than test the superclass for null, it is more
transparent to check whether the class is Object, by
comparing whether the class binding is identical to
ast.resolveWellKnownType("java.lang.Object").
If this type binding represents an interface, an array type, a
primitive type, or the null type, then null is returned.
null if noneAST.resolveWellKnownType(java.lang.String)public ITypeBinding[] getInterfaces()
If this type binding represents a class, the return value is an array
containing type bindings representing all interfaces directly implemented
by this class. The number and order of the interface objects in the array
corresponds to the number and order of the interface names in the
implements clause of the original declaration of this class.
If this type binding represents an interface, the array contains
type bindings representing all interfaces directly extended by this
interface. The number and order of the interface objects in the array
corresponds to the number and order of the interface names in the
extends clause of the original declaration of this interface.
If the class implements no interfaces, or the interface extends no interfaces, or if this type binding represents an array type, a primitive type, or the null type, this method returns an array of length 0.
public int getModifiers()
getDeclaredModifiers method
should be used if the original modifiers are needed.
Returns 0 if this type does not represent a class or interface.
getModifiers in interface IBindingModifier constantsgetDeclaredModifiers()public int getDeclaredModifiers()
getModifiers method should be used if
the compiled modifiers are needed. Returns -1 if this type does not
represent a class or interface.
Modifier constantsgetModifiers(),
Modifierpublic boolean isTopLevel()
A top-level type is any class or interface whose declaration does not occur within the body of another class or interface. The set of top level types is disjoint from the set of nested types.
true if this type binding is for a top-level class
or interface, and false otherwisepublic boolean isNested()
A nested type is any class or interface whose declaration occurs within the body of another class or interface. The set of nested types is disjoint from the set of top-level types. Nested types further subdivide into member types, local types, and anonymous types.
true if this type binding is for a nested class
or interface, and false otherwisepublic boolean isMember()
A member type is any class or interface declared as a member of another class or interface. A member type is a subspecies of nested type, and mutually exclusive with local types.
true if this type binding is for a member class
or interface, and false otherwisepublic boolean isLocal()
A local type is any nested class or interface not declared as a member of another class or interface. A local type is a subspecies of nested type, and mutually exclusive with member types. Note that anonymous classes are a subspecies of local types.
true if this type binding is for a local class
or interface, and false otherwisepublic boolean isAnonymous()
An anonymous class is a subspecies of local class, and therefore mutually
exclusive with member types. Note that anonymous classes have no name
(getName returns the empty string).
true if this type binding is for an anonymous class,
and false otherwisepublic ITypeBinding[] getDeclaredTypes()
public IVariableBinding[] getDeclaredFields()
length field of array types is not considered
to be a declared field). The resulting bindings are in no particular
order.
public IMethodBinding[] getDeclaredMethods()
public boolean isFromSource()
false for primitive types, the null type, array types,
and classes and interfaces whose information came from a pre-compiled binary
class file.
true if the type is in source code,
and false otherwisepublic String getQualifiedName()
"java.lang.String"."java.io.ObjectInputStream.GetField"."int"."java.lang.String[]".
getName()
|
Eclipse JDT 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||