Package com.fasterxml.classmate

Examples of com.fasterxml.classmate.TypeResolver


   * @param clazz class to substitute
   * @param with  the class which substitutes 'clazz'
   * @return this SwaggerSpringMvcPlugin
   */
  public SwaggerSpringMvcPlugin directModelSubstitute(Class clazz, Class with) {
    TypeResolver typeResolver = swaggerGlobalSettings.getTypeResolver();
    this.alternateTypeRules.add(newRule(typeResolver.resolve(clazz), typeResolver.resolve(with)));
    return this;
  }
View Full Code Here


   *
   * @param genericClasses - generic classes on which to apply generic model substitution.
   * @return this SwaggerSpringMvcPlugin
   */
  public SwaggerSpringMvcPlugin genericModelSubstitutes(Class... genericClasses) {
    TypeResolver typeResolver = swaggerGlobalSettings.getTypeResolver();
    for (Class clz : genericClasses) {
      this.alternateTypeRules.add(newRule(typeResolver.resolve(clz, WildcardType.class),
              typeResolver.resolve(WildcardType.class)));
    }
    return this;
  }
View Full Code Here

    this.alternateTypeProvider = alternateTypeProvider;
  }

  @VisibleForTesting
  void setTypeResolver(TypeResolver typeResolver) {
    this.typeResolver = new TypeResolver();
  }
View Full Code Here

  private ClassLoaderService classLoaderService;

  public AnnotationBindingContext(Index index, ServiceRegistry serviceRegistry) {
    this.index = index;
    this.serviceRegistry = serviceRegistry;
    this.typeResolver = new TypeResolver();
    this.resolvedTypeCache = new HashMap<Class<?>, ResolvedType>();
  }
View Full Code Here

    }

    protected List<String> getFieldNames(Class<?> type)
    {
        List<String> fields = new ArrayList<String>();
        TypeResolver typeResolver = new TypeResolver();
        ResolvedType resolvedType = typeResolver.resolve(type);

        MemberResolver memberResolver = new MemberResolver(typeResolver);
        ResolvedTypeWithMembers typeWithMembers = memberResolver.resolve(resolvedType, null, null);

        for (ResolvedField field : typeWithMembers.getMemberFields())
View Full Code Here

   * @param type the type to be handled
   *
   * @return the handler for the given type or {@code null} if no matching handler was found
   */
  private ValidatedValueUnwrapper<?> getValidatedValueHandler(Type type) {
    TypeResolver typeResolver = typeResolutionHelper.getTypeResolver();

    for ( ValidatedValueUnwrapper<?> handler : validatedValueHandlers ) {
      ResolvedType handlerType = typeResolver.resolve( handler.getClass() );
      List<ResolvedType> typeParameters = handlerType.typeParametersFor( ValidatedValueUnwrapper.class );

      if ( TypeHelper.isAssignable( typeParameters.get( 0 ).getErasedType(), type ) ) {
        return handler;
      }
View Full Code Here

   * @param type the type to be handled
   *
   * @return the handler for the given type or {@code null} if no matching handler was found
   */
  public ValidatedValueUnwrapper<?> getValidatedValueUnwrapper(Type type) {
    TypeResolver typeResolver = typeResolutionHelper.getTypeResolver();

    for ( ValidatedValueUnwrapper<?> handler : validatedValueUnwrappers ) {
      ResolvedType handlerType = typeResolver.resolve( handler.getClass() );
      List<ResolvedType> typeParameters = handlerType.typeParametersFor( ValidatedValueUnwrapper.class );

      if ( TypeHelper.isAssignable( typeParameters.get( 0 ).getErasedType(), type ) ) {
        return handler;
      }
View Full Code Here

public class TypeResolutionHelper {

  private final TypeResolver typeResolver;

  public TypeResolutionHelper() {
    typeResolver = new TypeResolver();
  }
View Full Code Here

   * @param clazz class to substitute
   * @param with  the class which substitutes 'clazz'
   * @return this SwaggerSpringMvcPlugin
   */
  public SwaggerSpringMvcPlugin directModelSubstitute(Class clazz, Class with) {
    TypeResolver typeResolver = swaggerGlobalSettings.getTypeResolver();
    this.alternateTypeRules.add(newRule(typeResolver.resolve(clazz), typeResolver.resolve(with)));
    return this;
  }
View Full Code Here

   *
   * @param genericClasses - generic classes on which to apply generic model substitution.
   * @return this SwaggerSpringMvcPlugin
   */
  public SwaggerSpringMvcPlugin genericModelSubstitutes(Class... genericClasses) {
    TypeResolver typeResolver = swaggerGlobalSettings.getTypeResolver();
    for (Class clz : genericClasses) {
      this.alternateTypeRules.add(newRule(typeResolver.resolve(clz, WildcardType.class),
              typeResolver.resolve(WildcardType.class)));
    }
    return this;
  }
View Full Code Here

TOP

Related Classes of com.fasterxml.classmate.TypeResolver

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.