Package org.jboss.errai.codegen.meta

Examples of org.jboss.errai.codegen.meta.MetaTypeVariable



  private static void resolveTypeVariable(Map<String, MetaClass> typeVariables,
                                          MetaType methodParmType, MetaType callParmType) {
    if (methodParmType instanceof MetaTypeVariable) {
      MetaTypeVariable typeVar = (MetaTypeVariable) methodParmType;
      typeVariables.put(typeVar.getName(), (MetaClass) callParmType);
    }
    else if (methodParmType instanceof MetaParameterizedType) {
      MetaType parameterizedCallParmType;
      if (callParmType instanceof MetaParameterizedType) {
        parameterizedCallParmType = callParmType;
View Full Code Here


    if (method.getGenericReturnType() != null && method.getGenericReturnType() instanceof MetaTypeVariable) {
      typeVariables = new HashMap<String, MetaClass>();
      resolveTypeVariables();

      MetaTypeVariable typeVar = (MetaTypeVariable) method.getGenericReturnType();
      if (typeVariables.containsKey(typeVar.getName())) {
        returnType = typeVariables.get(typeVar.getName());
      }
      else if (writer.getTypeParm(typeVar.getName()) != null) {
        returnType = writer.getTypeParm(typeVar.getName());
      }
      else {
        // returning NullType as a stand-in for an unbounded wildcard type since this is a parameterized method
        // and there is not RHS qualification for the parameter.
        //
View Full Code Here

    }
  }

  private void resolveTypeVariable(MetaType methodParmType, MetaType callParmType) {
    if (methodParmType instanceof MetaTypeVariable) {
      MetaTypeVariable typeVar = (MetaTypeVariable) methodParmType;
      typeVariables.put(typeVar.getName(), (MetaClass) callParmType);
    }
    else if (methodParmType instanceof MetaParameterizedType) {
      MetaType parameterizedCallParmType;
      if (callParmType instanceof MetaParameterizedType) {
        parameterizedCallParmType = callParmType;
View Full Code Here

      if (genericParmTypes != null && genericParmTypes.length == parameters.length) {
        for (int i = 0, genericParmTypesLength = genericParmTypes.length; i < genericParmTypesLength; i++) {
          MetaType type = genericParmTypes[i];
          MetaClass parmType = parameters[i].getType();
          if (type instanceof MetaTypeVariable) {
            final MetaTypeVariable typeVariable = (MetaTypeVariable) type;
            if (typeVariableMap.containsKey(typeVariable.getName())) {
              final MetaType typeVar = typeVariableMap.get(typeVariable.getName());
              if (typeVar instanceof MetaClass) {
                parmType = (MetaClass) typeVar;
              }
            }
          }
View Full Code Here

    if (method.getGenericReturnType() != null && method.getGenericReturnType() instanceof MetaTypeVariable) {
      typeVariables = new HashMap<String, MetaClass>();
      resolveTypeVariables();

      final MetaTypeVariable typeVar = (MetaTypeVariable) method.getGenericReturnType();
      if (typeVariables.containsKey(typeVar.getName())) {
        returnType = typeVariables.get(typeVar.getName());
      }
      else if (writer.getTypeParm(typeVar.getName()) != null) {
        returnType = writer.getTypeParm(typeVar.getName());
      }
      else {
        // returning NullType as a stand-in for an unbounded wildcard type since this is a parameterized method
        // and there is not RHS qualification for the parameter.
        //
View Full Code Here

    }
  }

  private void resolveTypeVariable(final MetaType methodParmType, final MetaType callParmType) {
    if (methodParmType instanceof MetaTypeVariable) {
      final MetaTypeVariable typeVar = (MetaTypeVariable) methodParmType;
      final MetaClass resolvedType;
      if (callParmType instanceof MetaClass) {
        resolvedType = (MetaClass) callParmType;
      }
      else if (callParmType instanceof MetaWildcardType) {
        MetaType[] upperBounds = ((MetaWildcardType) callParmType).getUpperBounds();
        if (upperBounds != null && upperBounds.length == 1 && upperBounds[0] instanceof MetaClass) {
          resolvedType = (MetaClass) upperBounds[0];
        }
        else {
          // it's either unbounded (? or ? super X) or has fancy bounds like ? extends X & Y
          // so we'll fall back on good old java.lang.Object
          resolvedType = MetaClassFactory.get(Object.class);
        }
      }
      else {
        throw new IllegalArgumentException("Call parameter \"" + callParmType + "\" is of unexpected metatype " + callParmType.getClass());
      }
      typeVariables.put(typeVar.getName(), resolvedType);
    }
    else if (methodParmType instanceof MetaParameterizedType) {
      final MetaType parameterizedCallParmType;
      if (callParmType instanceof MetaParameterizedType) {
        parameterizedCallParmType = callParmType;
View Full Code Here


  private static void resolveTypeVariable(Map<String, MetaClass> typeVariables,
                                          MetaType methodParmType, MetaType callParmType) {
    if (methodParmType instanceof MetaTypeVariable) {
      MetaTypeVariable typeVar = (MetaTypeVariable) methodParmType;
      typeVariables.put(typeVar.getName(), (MetaClass) callParmType);
    }
    else if (methodParmType instanceof MetaParameterizedType) {
      MetaType parameterizedCallParmType;
      if (callParmType instanceof MetaParameterizedType) {
        parameterizedCallParmType = callParmType;
View Full Code Here

    if (method.getGenericReturnType() != null && method.getGenericReturnType() instanceof MetaTypeVariable) {
      typeVariables = new HashMap<String, MetaClass>();
      resolveTypeVariables();

      MetaTypeVariable typeVar = (MetaTypeVariable) method.getGenericReturnType();
      if (typeVariables.containsKey(typeVar.getName())) {
        returnType = typeVariables.get(typeVar.getName());
      }
      else if (writer.getTypeParm(typeVar.getName()) != null) {
        returnType = writer.getTypeParm(typeVar.getName());
      }
      else {
        // returning NullType as a stand-in for an unbounded wildcard type since this is a parameterized method
        // and there is not RHS qualification for the parameter.
        //
View Full Code Here

    }
  }

  private void resolveTypeVariable(MetaType methodParmType, MetaType callParmType) {
    if (methodParmType instanceof MetaTypeVariable) {
      MetaTypeVariable typeVar = (MetaTypeVariable) methodParmType;
      typeVariables.put(typeVar.getName(), (MetaClass) callParmType);
    }
    else if (methodParmType instanceof MetaParameterizedType) {
      MetaType parameterizedCallParmType;
      if (callParmType instanceof MetaParameterizedType) {
        parameterizedCallParmType = callParmType;
View Full Code Here

    else if (metaClass instanceof MetaParameterizedType) {
      MetaParameterizedType parameterizedType = (MetaParameterizedType) metaClass;
      return parameterizedType.toString();
    }
    else if (metaClass instanceof MetaTypeVariable) {
      MetaTypeVariable parameterizedType = (MetaTypeVariable) metaClass;
      return parameterizedType.getName();
    }
    else if (metaClass instanceof MetaWildcardType) {
      MetaWildcardType wildCardType = (MetaWildcardType) metaClass;
      return wildCardType.toString();
    }
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.meta.MetaTypeVariable

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.