Package com.fasterxml.classmate

Examples of com.fasterxml.classmate.ResolvedType


      context.validatedBy( (Class<? extends ConstraintValidator<A, ?>>) validatorType );
    }
  }

  private Class<?> determineAnnotationType(Class<?> constraintValidatorClass) {
    ResolvedType resolvedType = typeResolutionHelper.getTypeResolver()
        .resolve( constraintValidatorClass );

    return resolvedType.typeParametersFor( ConstraintValidator.class ).get( 0 ).getErasedType();
  }
View Full Code Here


      return valueHolder.getValue();
    }

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

    return source.getValue();
  }

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

    return source.getValue();
  }

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

  private boolean instanceMethodParametersResolveToSameTypes(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

    }
  }

  private Class<?> getResolvedType(Field field) {
    Class<?> type = field.getType();
    ResolvedType resolvedType = asResolved(resolver, type);
    ResolvedType alternativeType = alternateTypeProvider.alternateFor(resolvedType);
    Class<?> erasedType = alternativeType.getErasedType();
    if (type != erasedType) {
      LOGGER.debug("Found alternative type [{}] for field: [{}-{}]", erasedType, field, type);
    }
    return erasedType;
  }
View Full Code Here

    };
  }


  private List<ResolvedType> resolvedDependencies(ModelContext modelContext) {
    ResolvedType resolvedType = alternateTypeProvider.alternateFor(modelContext.resolvedType(typeResolver));
    if (Types.isBaseType(typeName(resolvedType))) {
      modelContext.seen(resolvedType);
      return newArrayList();
    }
    List<ResolvedType> dependencies = newArrayList(resolvedTypeParameters(modelContext, resolvedType));
View Full Code Here

      if (Types.isBaseType(typeName(property.getType()))) {
        continue;
      }
      properties.add(property.getType());
      if (Collections.isContainerType(property.getType())) {
        ResolvedType collectionElementType = Collections.collectionElementType(property.getType());
        if (Types.typeNameFor(collectionElementType.getErasedType()) == null) {
          if (!Types.isBaseType(typeName(collectionElementType))) {
            properties.add(collectionElementType);
          }
          properties.addAll(resolvedDependencies(ModelContext.fromParent(modelContext, collectionElementType)));
        }
View Full Code Here

            .fromNullable(typeNameFor(erasedType))
            .or(erasedType.getSimpleName());
    StringBuilder sb = new StringBuilder(String.format("%s«", simpleName));
    boolean first = true;
    for (int index = 0; index < erasedType.getTypeParameters().length; index++) {
      ResolvedType typeParam = resolvedType.getTypeParameters().get(index);
      if (first) {
        sb.append(innerTypeName(typeParam));
        first = false;
      } else {
        sb.append(String.format(",%s", innerTypeName(typeParam)));
View Full Code Here

    this.dependencyProvider = dependencyProvider;
  }

  @Override
  public com.google.common.base.Optional<Model> modelFor(ModelContext modelContext) {
    ResolvedType propertiesHost = alternateTypeProvider.alternateFor(modelContext.resolvedType(resolver));
    if (isContainerType(propertiesHost)
            || propertiesHost.getErasedType().isEnum()
            || Types.isBaseType(Types.typeNameFor(propertiesHost.getErasedType()))) {
      return Optional.absent();
    }
    Map<String, ModelProperty> properties = newLinkedHashMap();

    int index = 0;
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.