Examples of PrimitiveType


Examples of com.bacoder.parser.java.api.PrimitiveType

      return type;
    }

    PrimitiveTypeContext primitiveTypeContext = getChild(context, PrimitiveTypeContext.class);
    if (primitiveTypeContext != null) {
      PrimitiveType type = getAdapter(PrimitiveTypeAdapter.class).adapt(primitiveTypeContext);
      type.setDimensions(getAdapter(ArrayDimensionsAdapter.class).adapt(context));
      return type;
    }

    return null;
  }
View Full Code Here

Examples of com.bacoder.parser.java.api.PrimitiveType

    super(adapters);
  }

  @Override
  public PrimitiveType adapt(PrimitiveTypeContext context) {
    PrimitiveType primitiveType = createNode(context);

    TerminalNode node = getChild(context, TerminalNode.class);
    if (node != null) {
      switch (node.getSymbol().getType()) {
      case JavaParser.BOOLEAN:
        primitiveType.setType(Type.BOOLEAN);
        break;
      case JavaParser.BYTE:
        primitiveType.setType(Type.BYTE);
        break;
      case JavaParser.CHAR:
        primitiveType.setType(Type.CHAR);
        break;
      case JavaParser.DOUBLE:
        primitiveType.setType(Type.DOUBLE);
        break;
      case JavaParser.FLOAT:
        primitiveType.setType(Type.FLOAT);
        break;
      case JavaParser.INT:
        primitiveType.setType(Type.INT);
        break;
      case JavaParser.LONG:
        primitiveType.setType(Type.LONG);
        break;
      case JavaParser.SHORT:
        primitiveType.setType(Type.SHORT);
        break;
      default:
      }
    }
    return primitiveType;
View Full Code Here

Examples of com.github.antlrjavaparser.api.type.PrimitiveType

            final ClassOrInterfaceType cType2 = (ClassOrInterfaceType) type2;
            return cType.getName().equals(cType2.getName());

        }
        else if (type instanceof PrimitiveType) {
            final PrimitiveType pType = (PrimitiveType) type;
            final PrimitiveType pType2 = (PrimitiveType) type2;
            return pType.getType() == pType2.getType();

        }
        else if (type instanceof VoidType) {
            return true;
        }
View Full Code Here

Examples of com.github.antlrjavaparser.api.type.PrimitiveType

                internalType = ((ReferenceType) internalType).getType();
            }
        }

        if (internalType instanceof PrimitiveType) {
            final PrimitiveType pt = (PrimitiveType) internalType;
            if (pt.getType().equals(Primitive.Boolean)) {
                return new JavaType(Boolean.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Char)) {
                return new JavaType(Character.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Byte)) {
                return new JavaType(Byte.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Short)) {
                return new JavaType(Short.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Int)) {
                return new JavaType(Integer.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Long)) {
                return new JavaType(Long.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Float)) {
                return new JavaType(Float.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Double)) {
                return new JavaType(Double.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            throw new IllegalStateException("Unsupported primitive '"
                    + pt.getType() + "'");
        }

        if (internalType instanceof WildcardType) {
            // We only provide very primitive support for wildcard types; Roo
            // only needs metadata at the end of the day,
View Full Code Here

Examples of com.github.antlrjavaparser.api.type.PrimitiveType

                "Java type must be primitive to be presented to this method");
        if (javaType.equals(JavaType.VOID_PRIMITIVE)) {
            return new VoidType();
        }
        else if (javaType.equals(JavaType.BOOLEAN_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Boolean);
        }
        else if (javaType.equals(JavaType.BYTE_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Byte);
        }
        else if (javaType.equals(JavaType.CHAR_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Char);
        }
        else if (javaType.equals(JavaType.DOUBLE_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Double);
        }
        else if (javaType.equals(JavaType.FLOAT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Float);
        }
        else if (javaType.equals(JavaType.INT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Int);
        }
        else if (javaType.equals(JavaType.LONG_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Long);
        }
        else if (javaType.equals(JavaType.SHORT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Short);
        }
        throw new IllegalStateException("Unknown primitive " + javaType);
    }
View Full Code Here

Examples of com.impossibl.postgres.types.PrimitiveType

    sqlToPrimitiveMatrix[getSQLTypeIndex(Types.OTHER)]          = new PrimitiveType[] {};
  }

  public static int getSQLType(Type type) {

    PrimitiveType ptype = type.getPrimitiveType();
    if (ptype == null) {
      return Types.OTHER;
    }

    return primitiveToSQLTypeMatrix[ptype.ordinal()];
  }
View Full Code Here

Examples of com.impossibl.postgres.types.PrimitiveType

  public static int getMaxPrecision(Type type) {

    type = type.unwrap();

    PrimitiveType ptype = type.getPrimitiveType();
    if (ptype == null) {
      return 0;
    }

    switch(ptype) {
View Full Code Here

Examples of com.impossibl.postgres.types.PrimitiveType

      lenMod = typeLength;
    }
    //Calculate prec

    int prec = 0;
    PrimitiveType ptype = type.getPrimitiveType();
    if (ptype == null) {
      prec = lenMod;
    }
    else {
View Full Code Here

Examples of com.impossibl.postgres.types.PrimitiveType

  }

  public static int getMinScale(Type type) {

    type = type.unwrap();
    PrimitiveType ptype = type.getPrimitiveType();
    if (ptype == null) {
      return 0;
    }

    switch(ptype) {
View Full Code Here

Examples of com.impossibl.postgres.types.PrimitiveType

  public static int getMaxScale(Type type) {

    type = type.unwrap();

    PrimitiveType ptype = type.getPrimitiveType();
    if (ptype == null) {
      return 0;
    }

    switch(ptype) {
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.