Package org.vesalainen.bcc.model
Class Typ
- java.lang.Object
-
- org.vesalainen.bcc.model.Typ
-
public class Typ extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTyp.StringIterator
-
Field Summary
Fields Modifier and Type Field Description static javax.lang.model.type.PrimitiveTypeBooleanstatic javax.lang.model.type.ArrayTypeBooleanAstatic javax.lang.model.type.PrimitiveTypeBytestatic javax.lang.model.type.ArrayTypeByteAstatic javax.lang.model.type.PrimitiveTypeCharstatic javax.lang.model.type.ArrayTypeCharAstatic javax.lang.model.type.PrimitiveTypeDoublestatic javax.lang.model.type.ArrayTypeDoubleAstatic javax.lang.model.type.PrimitiveTypeFloatstatic javax.lang.model.type.ArrayTypeFloatAstatic javax.lang.model.type.PrimitiveTypeIntstatic javax.lang.model.type.ArrayTypeIntAstatic javax.lang.model.type.PrimitiveTypeLongstatic javax.lang.model.type.ArrayTypeLongAprivate static javax.lang.model.util.TypesmyTypesstatic javax.lang.model.type.NoTypeNonestatic javax.lang.model.type.NullTypeNullstatic javax.lang.model.type.DeclaredTypeObjectstatic javax.lang.model.type.ArrayTypeObjectAstatic javax.lang.model.type.TypeMirrorReturnAddressstatic javax.lang.model.type.PrimitiveTypeShortstatic javax.lang.model.type.ArrayTypeShortAstatic javax.lang.model.type.DeclaredTypeStringstatic javax.lang.model.type.ArrayTypeStringAprivate static javax.lang.model.util.Typestypesstatic javax.lang.model.type.NoTypeVoid
-
Constructor Summary
Constructors Constructor Description Typ()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.lang.model.element.ElementasElement(javax.lang.model.type.TypeMirror t)static javax.lang.model.type.TypeMirrorasMemberOf(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.Element element)static javax.lang.model.element.TypeElementboxedClass(javax.lang.model.type.PrimitiveType p)static javax.lang.model.type.TypeMirrorcapture(javax.lang.model.type.TypeMirror t)static booleancontains(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)static java.lang.Objectconvert(java.lang.String constant, javax.lang.model.type.TypeKind kind)Returns a Object of type type converted from constantstatic java.util.List<? extends javax.lang.model.type.TypeMirror>directSupertypes(javax.lang.model.type.TypeMirror t)static javax.lang.model.type.TypeMirrorerasure(javax.lang.model.type.TypeMirror t)static javax.lang.model.type.ArrayTypegetArrayType(javax.lang.model.type.TypeMirror componentType)static javax.lang.model.type.DeclaredTypegetDeclaredType(javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)static javax.lang.model.type.DeclaredTypegetDeclaredType(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)static intgetIndexOf(java.util.List<? extends javax.lang.model.element.VariableElement> params, int ind)static java.lang.StringgetInternalForm(javax.lang.model.type.TypeMirror type)static intgetMaxIndexOf(java.util.List<? extends javax.lang.model.element.VariableElement> params)static javax.lang.model.type.NoTypegetNoType(javax.lang.model.type.TypeKind kind)static javax.lang.model.type.NullTypegetNullType()static javax.lang.model.type.PrimitiveTypegetPrimitiveType(javax.lang.model.type.TypeKind kind)static javax.lang.model.type.TypeMirrorgetTypeFor(java.lang.Class<?> cls)static javax.lang.model.type.TypeMirrorgetTypeFor(java.lang.String type)static intgetTypeNumber(javax.lang.model.type.TypeKind kind)Returns TypeKind ordinal for primitive types and DECLARED ordinal for DECLARED, ARRAY and TYPEVARstatic javax.lang.model.type.WildcardTypegetWildcardType(javax.lang.model.type.TypeMirror extendsBound, javax.lang.model.type.TypeMirror superBound)static booleanisAssignable(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)static booleanisCategory2(javax.lang.model.type.TypeMirror type)static booleanisInteger(javax.lang.model.type.TypeMirror type)Returns true if type is one of int, short, char, byte or booleanstatic booleanisJavaConstant(java.lang.Object value)static booleanisJavaConstantType(javax.lang.model.type.TypeMirror type)Returns true if type is one of int, long, float, double or java.lang.Stringstatic booleanisPrimitive(javax.lang.model.type.TypeMirror type)static booleanisSameType(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)static booleanisSubsignature(javax.lang.model.type.ExecutableType m1, javax.lang.model.type.ExecutableType m2)static booleanisSubtype(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)static javax.lang.model.type.TypeMirrornormalizeType(javax.lang.model.type.TypeKind kind)Returns primitive type for primitive and java.lang.Object type for referencesprivate static javax.lang.model.type.TypeMirrorparseNext(Typ.StringIterator si)private static java.lang.StringparseObject(Typ.StringIterator si)static voidsetTypes(javax.lang.model.util.Types types)static javax.lang.model.type.TypeMirrortypeFromDescriptor(java.lang.String descriptor)static javax.lang.model.type.TypeMirrortypeFromSignature(java.lang.String string)static java.util.List<? extends javax.lang.model.type.TypeMirror>typesFromDescriptor(java.lang.String descriptor)static javax.lang.model.type.PrimitiveTypeunboxedType(javax.lang.model.type.TypeMirror t)
-
-
-
Field Detail
-
Null
public static javax.lang.model.type.NullType Null
-
Void
public static javax.lang.model.type.NoType Void
-
None
public static javax.lang.model.type.NoType None
-
Byte
public static javax.lang.model.type.PrimitiveType Byte
-
Boolean
public static javax.lang.model.type.PrimitiveType Boolean
-
Char
public static javax.lang.model.type.PrimitiveType Char
-
Short
public static javax.lang.model.type.PrimitiveType Short
-
Int
public static javax.lang.model.type.PrimitiveType Int
-
Long
public static javax.lang.model.type.PrimitiveType Long
-
Float
public static javax.lang.model.type.PrimitiveType Float
-
Double
public static javax.lang.model.type.PrimitiveType Double
-
ByteA
public static javax.lang.model.type.ArrayType ByteA
-
BooleanA
public static javax.lang.model.type.ArrayType BooleanA
-
CharA
public static javax.lang.model.type.ArrayType CharA
-
ShortA
public static javax.lang.model.type.ArrayType ShortA
-
IntA
public static javax.lang.model.type.ArrayType IntA
-
LongA
public static javax.lang.model.type.ArrayType LongA
-
FloatA
public static javax.lang.model.type.ArrayType FloatA
-
DoubleA
public static javax.lang.model.type.ArrayType DoubleA
-
StringA
public static javax.lang.model.type.ArrayType StringA
-
ObjectA
public static javax.lang.model.type.ArrayType ObjectA
-
String
public static javax.lang.model.type.DeclaredType String
-
Object
public static javax.lang.model.type.DeclaredType Object
-
ReturnAddress
public static javax.lang.model.type.TypeMirror ReturnAddress
-
myTypes
private static final javax.lang.model.util.Types myTypes
-
types
private static javax.lang.model.util.Types types
-
-
Method Detail
-
setTypes
public static void setTypes(javax.lang.model.util.Types types)
-
getTypeNumber
public static int getTypeNumber(javax.lang.model.type.TypeKind kind)
Returns TypeKind ordinal for primitive types and DECLARED ordinal for DECLARED, ARRAY and TYPEVAR- Parameters:
kind-- Returns:
-
normalizeType
public static javax.lang.model.type.TypeMirror normalizeType(javax.lang.model.type.TypeKind kind)
Returns primitive type for primitive and java.lang.Object type for references- Parameters:
kind-- Returns:
-
isJavaConstant
public static boolean isJavaConstant(java.lang.Object value)
-
isPrimitive
public static boolean isPrimitive(javax.lang.model.type.TypeMirror type)
-
getTypeFor
public static javax.lang.model.type.TypeMirror getTypeFor(java.lang.Class<?> cls)
-
getTypeFor
public static javax.lang.model.type.TypeMirror getTypeFor(java.lang.String type)
-
getMaxIndexOf
public static int getMaxIndexOf(java.util.List<? extends javax.lang.model.element.VariableElement> params)
-
getIndexOf
public static int getIndexOf(java.util.List<? extends javax.lang.model.element.VariableElement> params, int ind)
-
isCategory2
public static boolean isCategory2(javax.lang.model.type.TypeMirror type)
-
typeFromDescriptor
public static javax.lang.model.type.TypeMirror typeFromDescriptor(java.lang.String descriptor)
-
typesFromDescriptor
public static java.util.List<? extends javax.lang.model.type.TypeMirror> typesFromDescriptor(java.lang.String descriptor)
-
parseNext
private static javax.lang.model.type.TypeMirror parseNext(Typ.StringIterator si)
-
parseObject
private static java.lang.String parseObject(Typ.StringIterator si)
-
asElement
public static javax.lang.model.element.Element asElement(javax.lang.model.type.TypeMirror t)
-
isSameType
public static boolean isSameType(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)
-
isSubtype
public static boolean isSubtype(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)
-
isAssignable
public static boolean isAssignable(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)
-
contains
public static boolean contains(javax.lang.model.type.TypeMirror t1, javax.lang.model.type.TypeMirror t2)
-
isSubsignature
public static boolean isSubsignature(javax.lang.model.type.ExecutableType m1, javax.lang.model.type.ExecutableType m2)
-
directSupertypes
public static java.util.List<? extends javax.lang.model.type.TypeMirror> directSupertypes(javax.lang.model.type.TypeMirror t)
-
erasure
public static javax.lang.model.type.TypeMirror erasure(javax.lang.model.type.TypeMirror t)
-
boxedClass
public static javax.lang.model.element.TypeElement boxedClass(javax.lang.model.type.PrimitiveType p)
-
unboxedType
public static javax.lang.model.type.PrimitiveType unboxedType(javax.lang.model.type.TypeMirror t)
-
capture
public static javax.lang.model.type.TypeMirror capture(javax.lang.model.type.TypeMirror t)
-
getPrimitiveType
public static javax.lang.model.type.PrimitiveType getPrimitiveType(javax.lang.model.type.TypeKind kind)
-
getNullType
public static javax.lang.model.type.NullType getNullType()
-
getNoType
public static javax.lang.model.type.NoType getNoType(javax.lang.model.type.TypeKind kind)
-
getArrayType
public static javax.lang.model.type.ArrayType getArrayType(javax.lang.model.type.TypeMirror componentType)
-
getWildcardType
public static javax.lang.model.type.WildcardType getWildcardType(javax.lang.model.type.TypeMirror extendsBound, javax.lang.model.type.TypeMirror superBound)
-
getDeclaredType
public static javax.lang.model.type.DeclaredType getDeclaredType(javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)
-
getDeclaredType
public static javax.lang.model.type.DeclaredType getDeclaredType(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)
-
asMemberOf
public static javax.lang.model.type.TypeMirror asMemberOf(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.Element element)
-
typeFromSignature
public static javax.lang.model.type.TypeMirror typeFromSignature(java.lang.String string)
-
isInteger
public static boolean isInteger(javax.lang.model.type.TypeMirror type)
Returns true if type is one of int, short, char, byte or boolean- Parameters:
type-- Returns:
-
isJavaConstantType
public static boolean isJavaConstantType(javax.lang.model.type.TypeMirror type)
Returns true if type is one of int, long, float, double or java.lang.String- Parameters:
type-- Returns:
-
convert
public static java.lang.Object convert(java.lang.String constant, javax.lang.model.type.TypeKind kind)Returns a Object of type type converted from constant- Parameters:
constant-kind-- Returns:
-
getInternalForm
public static java.lang.String getInternalForm(javax.lang.model.type.TypeMirror type)
-
-