Examples of TypeKind


Examples of javax.lang.model.type.TypeKind

            case "long":
            case "float":
            case "double":
            case "char":
            case "boolean":
                final TypeKind kind = TypeKind.valueOf(name.toUpperCase(Locale.ENGLISH));
                return types.boxedClass(types.getPrimitiveType(kind));
            default:
                return (TypeElement) types.asElement(returnType);
        }
    }
View Full Code Here

Examples of javax.lang.model.type.TypeKind

        switch(e.getKind()) {
        case ANNOTATION_TYPE:
        case CLASS:
        case ENUM:
        case INTERFACE:
            TypeKind kind = e.asType().getKind();
            return !kind.isPrimitive() && kind!= TypeKind.VOID; // primitive elements don't work well.
        }
        return false;
    }
View Full Code Here

Examples of javax.lang.model.type.TypeKind

        return areEquivalent(type, subType) ||
               subType.isSubTypeOf(type);
    }

    public static boolean isImplicitNumericConversion(final Type<?> sourceType, final Type<?> targetType) {
        final TypeKind sourceKind = TypeUtils.getUnderlyingPrimitiveOrSelf(sourceType).getKind();
        final TypeKind targetKind = TypeUtils.getUnderlyingPrimitiveOrSelf(targetType).getKind();

        switch (sourceKind) {
            case BYTE:
                switch (targetKind) {
                    case BYTE:
View Full Code Here

Examples of javax.lang.model.type.TypeKind

                _types[i + 1] = coalesceKind(parameterTypes.get(i));
            }
        }

        private TypeKind coalesceKind(final Type<?> type) {
            final TypeKind kind = type.getKind();
            return kind.ordinal() <= TypeKind.VOID.ordinal() ? kind : TypeKind.DECLARED;
        }
View Full Code Here

Examples of javax.lang.model.type.TypeKind

      ArrayType at = (ArrayType) resultType;
      String boxedType = getBoxedTypeNameForTypeMirror(at.getComponentType());
      if (boxedType == null) return null;
      return boxedType+"[]";
    }
    TypeKind type = resultType.getKind();
    if (type == null) return null;
        if (type.equals(TypeKind.BOOLEAN)) {
      return "Boolean";
    } else if (type.equals(TypeKind.BYTE)) {
      return "Byte";
    } else if (type.equals(TypeKind.CHAR)) {
      return "Character";
    } else if (type.equals(TypeKind.DOUBLE)) {
      return "Double";
    } else if (type.equals(TypeKind.FLOAT)) {
      return "Float";
    } else if (type.equals(TypeKind.INT)) {
      return "Integer";
    } else if (type.equals(TypeKind.LONG)) {
      return "Long";
    } else if (type.equals(TypeKind.SHORT)) {
      return "Short";
    } else if (type.equals(TypeKind.VOID)) {
      return "Void";
    } else if (type.equals(TypeKind.DECLARED)) {
      return resultType.toString();
    }
        return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.