|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
public interface Types
형태로 조작을 행하기 위한 유틸리티 메소드입니다.
호환성에 관한 주: 플랫폼의 장래의 릴리스에서는, 이 인터페이스에 메소드가 추가될 가능성이 있습니다.
ProcessingEnvironment.getTypeUtils()
메소드의 개요 | |
---|---|
Element |
asElement (TypeMirror t)
형태에 대응하는 요소를 돌려줍니다. |
TypeMirror |
asMemberOf (DeclaredType containing,
Element element)
지정된 형태의 멤버로서 요소가 참조되는 경우, 혹은 지정된 형태에 직접 포함 되는 멤버로서 요소가 참조되는 경우, 요소의 형태를 돌려줍니다. |
TypeElement |
boxedClass (PrimitiveType p)
지정된 원시형의 복싱 된 값의 클래스를 돌려줍니다. |
TypeMirror |
capture (TypeMirror t)
형태에 취득 변환을 적용합니다. |
boolean |
contains (TypeMirror t1,
TypeMirror t2)
있는 형태 인수를 다른 형태에 「포함」할 수 있을지 어떨지를 테스트합니다. |
List <? extends TypeMirror > |
directSupertypes (TypeMirror t)
형태의 직접적인 슈퍼타입을 돌려줍니다. |
TypeMirror |
erasure (TypeMirror t)
형태의 소거를 돌려줍니다. |
ArrayType |
getArrayType (TypeMirror componentType)
지정된 컴퍼넌트형과 함께 배열형을 돌려줍니다. |
DeclaredType |
getDeclaredType (DeclaredType containing,
TypeElement typeElem,
TypeMirror ... typeArgs)
멤버인 형태의포함형을 지정하면(자), 형태 요소와 실제의 형태 인수에 대응하는 형태를 돌려줍니다. |
DeclaredType |
getDeclaredType (TypeElement typeElem,
TypeMirror ... typeArgs)
형태 요소와 실제의 형태 인수에 대응하는 형태를 돌려줍니다. |
NoType |
getNoType (TypeKind kind)
적절한 실제의 형태가 존재하지 않는 경우에 사용되는 의사형을 돌려줍니다. |
NullType |
getNullType ()
null 형을 돌려줍니다. |
PrimitiveType |
getPrimitiveType (TypeKind kind)
원시형을 돌려줍니다. |
WildcardType |
getWildcardType (TypeMirror extendsBound,
TypeMirror superBound)
새로운 와일드 카드의 형태 인수를 돌려줍니다. |
boolean |
isAssignable (TypeMirror t1,
TypeMirror t2)
있는 형태를 다른 형태에 대입할 수 있을지 어떨지를 테스트합니다. |
boolean |
isSameType (TypeMirror t1,
TypeMirror t2)
2 개의 TypeMirror 객체가 같은 형태를 나타낼지 어떨지를 테스트합니다. |
boolean |
isSubsignature (ExecutableType m1,
ExecutableType m2)
있는 메소드의 시그니챠가 다른 메소드의 「사브시그니챠」일지 어떨지를 테스트합니다. |
boolean |
isSubtype (TypeMirror t1,
TypeMirror t2)
있는 형태가 다른 형태의 subtype일지 어떨지를 테스트합니다. |
PrimitiveType |
unboxedType (TypeMirror t)
지정된 형태의 언 박싱 된 값의 형태 (원시형)를 돌려줍니다. |
메소드의 상세 |
---|
Element asElement(TypeMirror t)
DeclaredType
와 TypeVariable
의 머지않아인가입니다. 형태가 대응하는 요소를 가지지 않는 경우는 null
를 돌려줍니다.
boolean isSameType(TypeMirror t1, TypeMirror t2)
TypeMirror
객체가 같은 형태를 나타낼지 어떨지를 테스트합니다.
주의:이 메소드에게 건네지는 인수중 한쪽이 와일드 카드를 나타내고 있는 경우, 이 메소드는 false 를 돌려줍니다. 그 때문에, 와일드 카드는 자신과 같은 형태가 아닙니다. 이것은 일견 놀랄 만한 일입니다만, 다음과 같은 예는 컴파일러에 거부되는 것으로부터 이해할 수 있을 것입니다.
List<? > list = new ArrayList<Object>();
list.add(list.get(0));
t1
- 최초의 형태t2
- 2 번째의 형태
true
boolean isSubtype(TypeMirror t1, TypeMirror t2)
t1
- 최초의 형태t2
- 2 번째의 형태
true
IllegalArgumentException
- 실행 가능 파일 또는 패키지형이 건네받았을 경우boolean isAssignable(TypeMirror t1, TypeMirror t2)
t1
- 최초의 형태t2
- 2 번째의 형태
true
IllegalArgumentException
- 실행 가능 파일 또는 패키지형이 건네받았을 경우boolean contains(TypeMirror t1, TypeMirror t2)
t1
- 최초의 형태t2
- 2 번째의 형태
true
IllegalArgumentException
- 실행 가능 파일 또는 패키지형이 건네받았을 경우boolean isSubsignature(ExecutableType m1, ExecutableType m2)
m1
- 최초의 메소드m2
- 2 번째의 메소드
true
List <? extends TypeMirror > directSupertypes(TypeMirror t)
t
- 조사하는 대상의 형태
IllegalArgumentException
- 실행 가능 파일 또는 패키지형이 건네받았을 경우TypeMirror erasure(TypeMirror t)
t
- 소거되는 형태
IllegalArgumentException
- 패키지형이 건네받았을 경우TypeElement boxedClass(PrimitiveType p)
p
- 변환되는 원시형
p
의 복싱 된 값의 클래스PrimitiveType unboxedType(TypeMirror t)
t
- 언 박싱 되는 형태
t
의 언 박싱 된 값의 형태
IllegalArgumentException
- 지정된 형태가 언 박싱 변환을 가지지 않는 경우TypeMirror capture(TypeMirror t)
t
- 변환되는 형태
IllegalArgumentException
- 실행 가능 파일 또는 패키지형이 건네받았을 경우PrimitiveType getPrimitiveType(TypeKind kind)
kind
- 반환되는 원시형의 종류
IllegalArgumentException
- kind
가 원시형이 아닌 경우NullType getNullType()
null
의 형태입니다.
NoType getNoType(TypeKind kind)
VOID
와 NONE
의 머지않아인가입니다. 패키지에서는, 대신에 Elements.getPackageElement(CharSequence)
. asType()
를 사용합니다.
kind
- 반환되는 형태의 종류
VOID
또는 NONE
의 의사형.
IllegalArgumentException
- kind
가 무효인 경우ArrayType getArrayType(TypeMirror componentType)
componentType
- 컴퍼넌트형
IllegalArgumentException
- 배열에 대해서 컴퍼넌트형이 무효인 경우WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound)
extendsBound
- extends 경계 (상한). 존재하지 않는 경우는 null
superBound
- super 경계 (하한). 존재하지 않는 경우는 null
IllegalArgumentException
- 경계가 무효인 경우DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror ... typeArgs)
Set
의 형태 요소와 String
의 형태 밀러가 지정되고 있는 경우, 이 메소드를 사용하면(자), 파라미터화 된 형태 Set<String>
를 취득할 수 있습니다.
형태 인수의 수는, 형태 요소의 형식형 파라미터의 수에 동일한지, 제로가 아니면 안됩니다. 제로의 경우 및 형태 요소가 총칭의 경우는, 형태 요소의 생의형태가 돌려주어집니다.
파라미터화 된 형태가 반환되는 경우, 형태 요소는 총칭 외부 클래스내에 포함되지 않습니다. 예를 들어, 파라미터화 된 형태 Outer<String>.Inner<Number>
를 구축하려면 , 최초로 이 메소드를 사용해 Outer<String>
를 취득해, 다음에 getDeclaredType(DeclaredType, TypeElement, TypeMirror...)
(을)를 호출합니다.
typeElem
- 형 요소typeArgs
- 실제의 형태 인수
IllegalArgumentException
- 지정된 형태 인수가 너무 많을까 너무 적은 경우, 혹은 올바르지 않은 형태 인수 또는 형태 요소가 제공되었을 경우DeclaredType getDeclaredType(DeclaredType containing, TypeElement typeElem, TypeMirror ... typeArgs)
Outer<String>.Inner<Number>
를 구축하려면 , 최초로 getDeclaredType(TypeElement, TypeMirror...)
(을)를 사용해 형태 Outer<String>
를 취득해, 다음에 이 메소드를 호출합니다.
포함형이 파라미터화 된 형태의 경우, 형태 인수의 수는,typeElem
의 형식형 파라미터의 수에 동일하지 않으면 안됩니다. 파라미터화되어 있지 않은 경우 또는 null
의 경우, 이 메소드는 getDeclaredType(typeElem, typeArgs)
와 등가입니다.
containing
- 포함형. 존재하지 않는 경우는 null
typeElem
- 형 요소typeArgs
- 실제의 형태 인수
IllegalArgumentException
- 지정된 형태 인수가 너무 많을까 너무 적은 경우, 혹은 올바르지 않은 형태 인수, 형태 요소, 또는 포함형이 제공되었을 경우TypeMirror asMemberOf(DeclaredType containing, Element element)
Set<String>
의 멤버로서 참조되는 경우,Set.add
메소드는 형태 String
의 파라미터를 가지는 ExecutableType
입니다.
containing
- 포함형element
- 요소
IllegalArgumentException
- 지정된 형태에 대해서 요소가 무효인 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.