Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Mirror API DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Types
.
@Deprecated public interface Types
Utility methods for operating on types.
Modifier and Type | Method and Description |
---|---|
ArrayType |
getArrayType(TypeMirror componentType)
Deprecated. Returns an array type with the specified component type. |
DeclaredType |
getDeclaredType(DeclaredType containing,
TypeDeclaration decl,
TypeMirror... typeArgs)
Deprecated. Returns the type corresponding to a type declaration and actual arguments, given a containing type of which it is a member. |
DeclaredType |
getDeclaredType(TypeDeclaration decl,
TypeMirror... typeArgs)
Deprecated. Returns the type corresponding to a type declaration and actual type arguments. |
TypeMirror |
getErasure(TypeMirror t)
Deprecated. Returns the erasure of a type. |
PrimitiveType |
getPrimitiveType(PrimitiveType.Kind kind)
Deprecated. Returns a primitive type. |
TypeVariable |
getTypeVariable(TypeParameterDeclaration tparam)
Deprecated. Returns the type variable declared by a type parameter. |
VoidType |
getVoidType()
Deprecated. Returns the pseudo-type representing the type of void. |
WildcardType |
getWildcardType(Collection<ReferenceType> upperBounds,
Collection<ReferenceType> lowerBounds)
Deprecated. Returns a new wildcard. |
boolean |
isAssignable(TypeMirror t1,
TypeMirror t2)
Deprecated. Tests whether one type is assignable to another. |
boolean |
isSubtype(TypeMirror t1,
TypeMirror t2)
Deprecated. Tests whether one type is a subtype of the another. |
Method Detail |
---|
boolean isSubtype(TypeMirror t1, TypeMirror t2)
t1
- the first typet2
- the second typeboolean isAssignable(TypeMirror t1, TypeMirror t2)
t1
- the first typet2
- the second typeTypeMirror getErasure(TypeMirror t)
t
- the type to be erasedPrimitiveType getPrimitiveType(PrimitiveType.Kind kind)
kind
- the kind of primitive type to returnVoidType getVoidType()
ArrayType getArrayType(TypeMirror componentType)
componentType
- the component typeIllegalArgumentException
- if the component type is not valid for
an arrayTypeVariable getTypeVariable(TypeParameterDeclaration tparam)
tparam
- the type parameterWildcardType getWildcardType(Collection<ReferenceType> upperBounds, Collection<ReferenceType> lowerBounds)
upperBounds
- the upper bounds of this wildcard,
or an empty collection if nonelowerBounds
- the lower bounds of this wildcard,
or an empty collection if noneIllegalArgumentException
- if bounds are not validDeclaredType getDeclaredType(TypeDeclaration decl, TypeMirror... typeArgs)
Set<String>
.
The number of type arguments must either equal the number of the declaration's formal type parameters, or must be zero. If zero, and if the declaration is generic, then the declaration's raw type is returned.
If a parameterized type is being returned, its declaration
must not be contained within a generic outer class.
The parameterized type Outer<String>.Inner<Number>
,
for example, may be constructed by first using this
method to get the type Outer<String>
, and then invoking
getDeclaredType(DeclaredType, TypeDeclaration, TypeMirror...)
.
decl
- the type declarationtypeArgs
- the actual type argumentsIllegalArgumentException
- if too many or too few
type arguments are given, or if an inappropriate type
argument or declaration is providedDeclaredType getDeclaredType(DeclaredType containing, TypeDeclaration decl, TypeMirror... typeArgs)
Outer<String>.Inner<Number>
,
for example, may be constructed by first using
getDeclaredType(TypeDeclaration, TypeMirror...)
to get the type Outer<String>
, and then invoking
this method.
If the containing type is a parameterized type, the number of type arguments must equal the number of the declaration's formal type parameters. If it is not parameterized or if it is null, this method is equivalent to getDeclaredType(decl, typeArgs).
containing
- the containing type, or null if nonedecl
- the type declarationtypeArgs
- the actual type argumentsIllegalArgumentException
- if too many or too few
type arguments are given, or if an inappropriate type
argument, declaration, or containing type is provided
|
Mirror API DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010, Oracle Corporation. All rights reserved.