本文整理匯總了Java中javax.lang.model.type.TypeKind.PACKAGE屬性的典型用法代碼示例。如果您正苦於以下問題:Java TypeKind.PACKAGE屬性的具體用法?Java TypeKind.PACKAGE怎麽用?Java TypeKind.PACKAGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.lang.model.type.TypeKind
的用法示例。
在下文中一共展示了TypeKind.PACKAGE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: unboxBoxed
/**
* Unbox a wrapper type into a TypeKind. Some additional types are mapped to TypeKinds which cannot really appear in
* expressions (at least I hope)
*
* @param tm
* @return
*/
private static TypeKind unboxBoxed(TypeMirror tm) {
TypeElement te = (TypeElement)((DeclaredType)tm).asElement();
String qn = te.getQualifiedName().toString();
if (!qn.startsWith("java.lang.")) { // NO18N
if (qn.equals("java.math.BigInteger")) { // NOI18N
return TypeKind.WILDCARD;
}
return null;
}
switch (qn.substring(10)) {
case "Short": return TypeKind.SHORT; // NOI18N
case "Long": return TypeKind.LONG; // NOI18N
case "Byte": return TypeKind.BYTE; // NOI18N
case "Integer": return TypeKind.INT; // NOI18N
case "Double": return TypeKind.DOUBLE; // NOI18N
case "Float": return TypeKind.FLOAT; // NOI18N
case "Character": return TypeKind.CHAR; // NOI18N
case "String": return TypeKind.OTHER; // NOI18N
case "Object": return TypeKind.PACKAGE; // NOI18N
}
return null;
}
示例2: canBeMissingAnnotations
private static boolean canBeMissingAnnotations(TypeMirror typeMirror) {
if (typeMirror == null) {
return false;
}
if (typeMirror.getKind() == TypeKind.VOID
|| typeMirror.getKind() == TypeKind.NONE
|| typeMirror.getKind() == TypeKind.PACKAGE) {
return true;
}
if (typeMirror.getKind() == TypeKind.WILDCARD) {
return canBeMissingAnnotations(((WildcardType) typeMirror).getExtendsBound());
}
return typeMirror.getKind() == TypeKind.TYPEVAR;
}
示例3: isValidType
public static boolean isValidType(TypeMirror m) {
return m != null && (
m.getKind() != TypeKind.PACKAGE &&
m.getKind() != TypeKind.OTHER &&
m.getKind() != TypeKind.ERROR);
}
示例4: isAcceptable
private static boolean isAcceptable(CompilationInfo info, TypeMirror type) {
if (!Utilities.isValidType(type)) return false;
TypeKind typeKind = type.getKind();
return typeKind != TypeKind.EXECUTABLE && typeKind != TypeKind.PACKAGE;
}
示例5: getKind
public TypeKind getKind() {
return TypeKind.PACKAGE;
}