Package com.fasterxml.classmate

Examples of com.fasterxml.classmate.ResolvedType


  @Override
  public void resolveAllTypes(String className) {
    // the resolved type for the top level class in the hierarchy
    Class<?> clazz = classLoaderService.getValue().classForName( className );
    ResolvedType resolvedType = typeResolver.resolve( clazz );
    while ( resolvedType != null ) {
      // todo - check whether there is already something in the map
      resolvedTypeCache.put( clazz, resolvedType );
      resolvedType = resolvedType.getParentClass();
      if ( resolvedType != null ) {
        clazz = resolvedType.getErasedType();
      }
    }
  }
View Full Code Here


   }

   @Override
   public Type getValidatedValueType(Type valueType)
   {
      ResolvedType resolvedType = typeResolver.resolve(valueType);
      return resolvedType.typeParametersFor(InputComponent.class).get(1).getErasedType();
   }
View Full Code Here

  @Override
  public void resolveAllTypes(String className) {
    // the resolved type for the top level class in the hierarchy
    Class<?> clazz = classLoaderService.getValue().classForName( className );
    ResolvedType resolvedType = typeResolver.resolve( clazz );
    while ( resolvedType != null ) {
      // todo - check whether there is already something in the map
      resolvedTypeCache.put( clazz, resolvedType );
      resolvedType = resolvedType.getParentClass();
      if ( resolvedType != null ) {
        clazz = resolvedType.getErasedType();
      }
    }
  }
View Full Code Here

  private boolean parametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod) {
    if ( subTypeMethod.getParameterTypes().length == 0 ) {
      return true;
    }

    ResolvedType resolvedSubType = typeResolver.resolve( subTypeMethod.getDeclaringClass() );

    MemberResolver memberResolver = new MemberResolver( typeResolver );
    memberResolver.setMethodFilter( new SimpleMethodFilter( subTypeMethod, superTypeMethod ) );
    ResolvedTypeWithMembers typeWithMembers = memberResolver.resolve(
        resolvedSubType,
View Full Code Here

            return null;
        }
        if (_superClass instanceof ResolvedObjectType) {
            return (ResolvedObjectType) _superClass;
        }
        ResolvedType rt = ((ResolvedRecursiveType) _superClass).getSelfReferencedType();
        if (!(rt instanceof ResolvedObjectType)) {
            throw new IllegalStateException("Internal error: self-referential parent type ("
                    +_superClass+") does not resolve into proper ResolvedObjectType, but instead to: "
                    +rt);
        }
View Full Code Here

  public void execute(RequestMappingContext context) {
    MethodParameter methodParameter = (MethodParameter) context.get("methodParameter");
    ResolvedMethodParameter resolvedMethodParameter
            = (ResolvedMethodParameter) context.get("resolvedMethodParameter");
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
    ResolvedType parameterType = resolvedMethodParameter.getResolvedParameterType();
    parameterType = swaggerGlobalSettings.getAlternateTypeProvider().alternateFor(parameterType);
    context.put("paramType", findParameterType(methodParameter, parameterType));
  }
View Full Code Here

    }
    return asResolved(typeResolver, methodToResolve.getReturnType());
  }

  private ResolvedMethod getResolvedMethod(final Method methodToResolve, Class<?> beanType) {
    ResolvedType enclosingType = typeResolver.resolve(beanType);
    MemberResolver resolver = new MemberResolver(typeResolver);
    resolver.setIncludeLangObject(false);
    ResolvedTypeWithMembers typeWithMembers = resolver.resolve(enclosingType, null, null);
    Iterable<ResolvedMethod> filtered = filter(newArrayList(typeWithMembers.getMemberMethods()),
            methodNamesAreSame(methodToResolve));
View Full Code Here

        for (int index = 0; index < input.getArgumentCount(); index++) {
          if (!covariant(input.getArgumentType(index), methodToResolve.getGenericParameterTypes()[index])) {
            return false;
          }
        }
        ResolvedType candidateMethodReturnValue = returnTypeOrVoid(input);
        return bothAreVoids(candidateMethodReturnValue, methodToResolve.getGenericReturnType())
                || contravariant(candidateMethodReturnValue, methodToResolve.getGenericReturnType());
      }
    };
  }
View Full Code Here

    return Void.class == candidateMethodReturnValue.getErasedType()
            && (Void.TYPE == returnType || Void.class == returnType);
  }

  private ResolvedType returnTypeOrVoid(ResolvedMethod input) {
    ResolvedType returnType = input.getReturnType();
    if (returnType == null) {
      returnType = typeResolver.resolve(Void.class);
    }
    return returnType;
  }
View Full Code Here

  }

  private void applyReturnTypeOverride(SwaggerGlobalSettings swaggerGlobalSettings, HandlerMethod handlerMethod,
      Map<Integer, ResponseMessage> byStatusCode) {

    ResolvedType returnType = handlerReturnType(swaggerGlobalSettings.getTypeResolver(), handlerMethod);
    returnType = swaggerGlobalSettings.getAlternateTypeProvider().alternateFor(returnType);
    if (!Void.class.equals(returnType.getErasedType()) && !Void.TYPE.equals(returnType.getErasedType())) {
      ResponseMessage responseMessage = byStatusCode.get(200);
      String message = null;
      if (responseMessage != null) {
        message = coalese(responseMessage.message(), HttpStatus.OK.getReasonPhrase());
      }
View Full Code Here

TOP

Related Classes of com.fasterxml.classmate.ResolvedType

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.