Package javax.lang.model.type

Examples of javax.lang.model.type.TypeKind


   
    /**
     * Affirms if the given type mirrors a primitive.
     */
    private boolean isPrimitive(TypeMirror mirror) {
        TypeKind kind = mirror.getKind();
        return kind == TypeKind.BOOLEAN
            || kind == TypeKind.BYTE
            || kind == TypeKind.CHAR
            || kind == TypeKind.DOUBLE
            || kind == TypeKind.FLOAT
View Full Code Here


            }

            final TypeList parameterTypes = methodBuilder.getParameterTypes();
           
            for (int i = 0, n = parameterTypes.size(); i < localIndex && i < n; i++) {
                final TypeKind kind = parameterTypes.get(i).getKind();
                if (kind == TypeKind.LONG || kind == TypeKind.DOUBLE) {
                    ++index;
                }
            }
        }
View Full Code Here

            throw Error.invalidCast(sourceType, targetType);
        }
    }

    private void emitNumericConversion(final Type<?> sourceType, final Type<?> targetType) {
        final TypeKind sourceKind = sourceType.getKind();
        final TypeKind targetKind = targetType.getKind();

        if (sourceKind == targetKind) {
            return;
        }
View Full Code Here

        Type rType = tree.rhs.getNodeType();
        if (lType.isPrimitive() && rType.isPrimitive()) {
            Type.JCPrimitiveType lPrim = (Type.JCPrimitiveType) lType;
            Type.JCPrimitiveType rPrim = (Type.JCPrimitiveType) rType;

            TypeKind lKind = lPrim.getKind();
            TypeKind rKind = rPrim.getKind();

            if (lKind == TypeKind.FLOAT || lKind == TypeKind.DOUBLE
             || rKind == TypeKind.FLOAT || rKind == TypeKind.DOUBLE) {
                combinedElements.add(tree);
                return;
View Full Code Here

   
    /**
     * Affirms if the given type mirrors a primitive.
     */
    private boolean isPrimitive(TypeMirror mirror) {
        TypeKind kind = mirror.getKind();
        return kind == TypeKind.BOOLEAN
            || kind == TypeKind.BYTE
            || kind == TypeKind.CHAR
            || kind == TypeKind.DOUBLE
            || kind == TypeKind.FLOAT
View Full Code Here

  @Override
  public Optional<TypeElement> visitTypeVariable(TypeVariable t, Void p)
  {
    TypeVariable tv = t;
    TypeMirror lb = tv.getLowerBound();
    TypeKind lbk = lb.getKind();
    if (TypeKind.NONE.equals(lbk) == false && TypeKind.NULL.equals(lbk) == false)
    {
      return lb.accept(this, null);
    }
    else
View Full Code Here

  @Override
  public String visitTypeVariable(TypeVariable t, Void p)
  {
    TypeVariable tv = t;
    TypeMirror lb = tv.getLowerBound();
    TypeKind lbk = lb.getKind();
    if (TypeKind.NONE.equals(lbk) == false && TypeKind.NULL.equals(lbk) == false)
    {
      return " ? super " + lb.accept(this, null);
    }
    else
View Full Code Here

   
    /**
     * Affirms if the given type mirrors a primitive.
     */
    private boolean isPrimitive(TypeMirror mirror) {
        TypeKind kind = mirror.getKind();
        return kind == TypeKind.BOOLEAN
            || kind == TypeKind.BYTE
            || kind == TypeKind.CHAR
            || kind == TypeKind.DOUBLE
            || kind == TypeKind.FLOAT
View Full Code Here

   
    /**
     * Affirms if the given type mirrors a primitive.
     */
    private boolean isPrimitive(TypeMirror mirror) {
        TypeKind kind = mirror.getKind();
        return kind == TypeKind.BOOLEAN
            || kind == TypeKind.BYTE
            || kind == TypeKind.CHAR
            || kind == TypeKind.DOUBLE
            || kind == TypeKind.FLOAT
View Full Code Here

  public static TypeKind widenedNumericType(TypeMirror left, TypeMirror right) {
    if (!isNumeric(left) || !isNumeric(right)) {
      return TypeKind.NONE;
    }

    TypeKind leftKind = left.getKind();
    TypeKind rightKind = right.getKind();

    if (leftKind == TypeKind.DOUBLE || rightKind == TypeKind.DOUBLE) {
      return TypeKind.DOUBLE;
    }
View Full Code Here

TOP

Related Classes of javax.lang.model.type.TypeKind

Copyright © 2018 www.massapicom. 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.