Examples of JParameterizedType


Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    return false;
  }

  private void generateSerializationSignature(JType type, CRC32 crc) {
    JParameterizedType parameterizedType = type.isParameterized();
    if (parameterizedType != null) {
      generateSerializationSignature(parameterizedType.getRawType(), crc);

      return;
    }

    String serializedTypeName = getSerializedTypeName(type);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    }

    mti.setState(SerializableTypeOracleBuilder.CHECK_IN_PROGRESS);

    if (type.isParameterized() != null) {
      JParameterizedType parameterized = type.isParameterized();
      checkType(logger.branch(TreeLogger.DEBUG, "Analyzing raw type", null),
          parameterized.getRawType(), true);

      checkTypes(logger.branch(TreeLogger.DEBUG, "Analyzing type args", null),
          parameterized.getTypeArgs());
    } else if (type.isArray() != null) {
      checkArray(logger, type.isArray());
    } else if (type.isClassOrInterface() != null) {
      checkClassOrInterface(logger, type.isClassOrInterface(), checkSubtypes);
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

        throw new RuntimeException(match.toString());
    }

    private JType resolveType(final JType type) {
        JType ret = type;
        JParameterizedType pt = type.isParameterized();

        if (pt != null) {
            ret = pt.getRawType();
        }

        JTypeParameter tp = ret.isTypeParameter();

        if (tp != null) {
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

     * Binder fields are always declared raw, so we're cheating if the
     * user is playing with parameterized types. We're happy enough if the
     * raw types match, and rely on them to make sure the specific types
     * really do work.
     */
    JParameterizedType parameterized = possibleSupertype.isParameterized();
    if (parameterized != null) {
      return isElementAssignableTo(elem, parameterized.getRawType());
    }

    JClassType fieldtype = findFieldType(elem);
    if (fieldtype == null) {
      return false;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

                    }

                    JParameter[] parameters = method.getParameters();
                    for (JParameter parameter : parameters) {
                        JType parameterType = parameter.getType();
                        JParameterizedType parameterizedType = parameterType
                                .isParameterized();
                        if (parameterizedType == null) {
                            // Non generic type.
                            addRootType(parameterType);
                        } else if (((parameterizedType.getBaseType() != asyncType) && (parameterizedType
                                .getBaseType() != cbType))) {
                            // Generic type but not a callback.
                            addRootType(parameterType);
                        } else {
                            // Callback type, inspect the "inner" type.
                            if (parameterizedType.getTypeArgs().length > 0) {
                                JClassType t = parameterizedType.getTypeArgs()[0];
                                // Add the enclosed type if it is not equals to
                                // java.lang.Void.
                                if (t != null
                                        && !("Void".equals(t.getName()) && "java.lang"
                                                .equals(t.getPackage()
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    public JMethod findMethodWithoutParamsReturning(JGenericType returnType,
            JClassType returnTypeParameter) throws UnableToCompleteException {
        JMethod result = null;
        for (JClassType classType : inspectedClass.getFlattenedSupertypeHierarchy()) {
            for (JMethod method : classType.getMethods()) {
                JParameterizedType actualReturnType = method.getReturnType().isParameterized();
                if (method.getParameters().length == 0
                        && actualReturnType != null
                        && returnType.isAssignableFrom(actualReturnType)
                        && returnTypeParameter.isAssignableFrom(actualReturnType.getTypeArgs()[0])) {
                    if (result != null) {
                        logger.log(TreeLogger.ERROR, "The class '" + inspectedClass.getName()
                                + "' has more than one method returning " + returnType.getName()
                                + "<" + returnTypeParameter.getName() + "> and taking no parameter. "
                                + "This is not allowed.", null);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

            JClassType typeParameter, Class<? extends Annotation> annotation,
            List<JField> collection) throws UnableToCompleteException {
        for (JClassType classType : inspectedClass.getFlattenedSupertypeHierarchy()) {
            for (JField field : classType.getFields()) {
                if (field.getAnnotation(annotation) != null) {
                    JParameterizedType parameterizedType = field.getType().isParameterized();
                    if (!field.isStatic()
                            || parameterizedType == null
                            || !type.isAssignableFrom(parameterizedType)
                            || !typeParameter.isAssignableFrom(parameterizedType.getTypeArgs()[0])) {
                        logger.log(
                                TreeLogger.ERROR, "Found the annotation @" + annotation.getSimpleName()
                                + " on the invalid field '" + classType.getName() + "." + field.getName()
                                + "'. Field must be static and its type must be " + type.getName()
                                + "<" + typeParameter.getName() + ">.", null);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    /*
     * Binder fields are always declared raw, so we're cheating if the user is
     * playing with parameterized types. We're happy enough if the raw types
     * match, and rely on them to make sure the specific types really do work.
     */
    JParameterizedType parameterized = possibleSupertype.isParameterized();
    if (parameterized != null) {
      return isElementAssignableTo(elem, parameterized.getRawType());
    }

    JClassType fieldtype = findFieldType(elem);
    if (fieldtype == null) {
      return false;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

  }

  private JClassType getBeanType(TreeLogger logger, JClassType validator,
      JClassType gwtSpecificInterface) throws UnableToCompleteException {
    if (gwtSpecificInterface instanceof JParameterizedType) {
      JParameterizedType paramType = (JParameterizedType) gwtSpecificInterface;
      return paramType.getTypeArgs()[0];
    }
    logger.log(TreeLogger.ERROR, validator.getQualifiedSourceName()
        + " must implement " + GwtSpecificValidator.class.getCanonicalName()
        + " with a one generic parameter.", null);
    throw new UnableToCompleteException();
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

      } else {
        return "[" + computeBinaryClassName(arrayType.getComponentType());
      }
    }

    JParameterizedType parameterizedType = type.isParameterized();
    if (parameterizedType != null) {
      return computeBinaryClassName(parameterizedType.getBaseType());
    }

    JClassType classType = type.isClassOrInterface();
    assert (classType != 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.