Package org.jboss.errai.codegen.meta

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


        for (MetaField field : getAllFields(pageClass)) {
          if (field.getType().getErased().equals(transitionToType)
                  || field.getType().getErased().equals(transitionAnchorType)
                  || field.getType().getErased().equals(transitionAnchorFactoryType)) {
            MetaType targetPageType = field.getType().getParameterizedType().getTypeParameters()[0];
            String targetPageName = pages.inverse().get(targetPageType);

            // entry for the link between nodes
            out.println("\"" + pageName + "\" -> \"" + targetPageName + "\" [label=\"" + field.getName() + "\"]");
          }
View Full Code Here


      final MetaParameter[] parameters = method.getParameters();
      final MetaType[] genericParmTypes = method.getGenericParameterTypes();

      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.getGenericParameterTypes() != null) {
        MetaType[] genTypes = method.getGenericParameterTypes();
        for (int i = 0; i < genTypes.length; i++) {
          if (genTypes[i] instanceof MetaParameterizedType) {
            if (parameters[i] instanceof MetaClass) {
              MetaType type = ((MetaParameterizedType) genTypes[i]).getTypeParameters()[0];
              if (type instanceof MetaTypeVariable) {
                writer.recordTypeParm(((MetaTypeVariable) type).getName(), (MetaClass) parameters[i]);
              }
            }
          }
View Full Code Here

      if (parameterizedType != null && parameterizedType.getTypeParameters().length != 0) {
        buf.append("<");

        for (int i = 0; i < parameterizedType.getTypeParameters().length; i++) {
          final MetaType typeParameter = parameterizedType.getTypeParameters()[i];

          if (typeParameter instanceof MetaParameterizedType) {
            final MetaParameterizedType parameterizedTypeParemeter = (MetaParameterizedType) typeParameter;
            buf.append(getClassReference(parameterizedTypeParemeter.getRawType(), context));
            buf.append(getClassReferencesForParameterizedTypes(parameterizedTypeParemeter, context));
View Full Code Here

    int methodParmIndex = 0;
    for (final MetaType methodParmType : method.getGenericParameterTypes()) {
      final Statement parm = callParameters.getParameters().get(methodParmIndex);

      final MetaType callParmType;
      if (parm instanceof TypeLiteral) {
        callParmType = ((TypeLiteral) parm).getActualType();
      }
      else {
        callParmType = parm.getType();
View Full Code Here

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

    if (method == null) {
      throw new GenerationException("Method 'getAssociatedType()' could not be found in the event ["
          + eventType.getName() + "]");
    }

    final MetaType returnType = method.getGenericReturnType();
    if (returnType == null) {
      throw new GenerationException("The method 'getAssociatedType()' in the event [" + eventType.getName()
          + "] returns void.");
    }

    logger.debug("eventType: " + eventType.getClass() + " -- " + eventType);
    logger.debug("method: " + method.getClass() + " -- " + method);
    logger.debug("genericReturnType: " + returnType.getClass() + " -- " + returnType);

    if (!(returnType instanceof MetaParameterizedType)) {
      throw new GenerationException("The method 'getAssociatedType()' in the event [" + eventType.getName()
          + "] does not return Type<? extends EventHandler>..");
    }
View Full Code Here

        for (MetaField field : getAllFields(pageClass)) {
          if (field.getType().getErased().equals(transitionToType)
                  || field.getType().getErased().equals(transitionAnchorType)
                  || field.getType().getErased().equals(transitionAnchorFactoryType)) {
            MetaType targetPageType = field.getType().getParameterizedType().getTypeParameters()[0];
            String targetPageName = pages.inverse().get(targetPageType);

            // entry for the link between nodes
            out.println("\"" + pageName + "\" -> \"" + targetPageName + "\" [label=\"" + field.getName() + "\"]");
          }
View Full Code Here

    final MetaType[] typeArgs = pType.getTypeParameters();
    final MetaClass[] typeArgsClasses = new MetaClass[typeArgs.length];

    for (int i = 0; i < typeArgs.length; i++) {
      final MetaType argType = typeArgs[i];

      if (argType instanceof MetaClass) {
        typeArgsClasses[i] = (MetaClass) argType;
      }
      else if (argType instanceof MetaParameterizedType) {
View Full Code Here

    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;
      }
      else {
        parameterizedCallParmType = ((MetaClass) callParmType).getParameterizedType();
View Full Code Here

TOP

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

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.