Package com.fasterxml.classmate

Examples of com.fasterxml.classmate.ResolvedType


  private Option<ModelRef> itemModelRef(ResolvedType type) {
    if (!isContainerType(type)) {
      return Option.empty();
    }
    ResolvedType collectionElementType = collectionElementType(type);
    String elementTypeName = typeName(collectionElementType);
    String qualifiedElementTypeName = simpleQualifiedTypeName(collectionElementType);
    if (!isBaseType(elementTypeName)) {
      return Option.apply(new ModelRef(null,
              Option.apply(elementTypeName), Option.apply(qualifiedElementTypeName)));
View Full Code Here


      return false;
    }
    TypeBindings wildcardTypeBindings = wildcardType.getTypeBindings();
    TypeBindings bindingsToMatch = toMatch.getTypeBindings();
    for (int index = 0; index < bindingsToMatch.size(); index++) {
      ResolvedType wildcardTypeBindingsBoundType = wildcardTypeBindings.getBoundType(index);
      ResolvedType bindingsToMatchBoundType = bindingsToMatch.getBoundType(index);

      if (!wildcardTypeBindingsBoundType.getErasedType().equals(WildcardType.class)
              && !wildcardMatch(bindingsToMatchBoundType, wildcardTypeBindingsBoundType)) {
        return false;
      }
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 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

   */
  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 datastoreType the configuration type representing the current datastore.
   * @return a {@link GlobalContext} object
   * @throws HibernateException in case the given configuration type isn't supported by the current datastore provider
   */
  public <G extends GlobalContext<?, ?>, D extends DatastoreConfiguration<G>> G configureDatastore(Class<D> datastoreType) {
    ResolvedType resolvedDatastoreType = typeResolver.resolve( datastoreType );
    ResolvedType globalContextType = resolvedDatastoreType.typeParametersFor( DatastoreConfiguration.class ).get( 0 );

    ConfigurationBuilderService configurationBuilderService = getSessionFactory()
        .getServiceRegistry()
        .getService( ConfigurationBuilderService.class );

    GlobalContext<?, ?> globalContext = configurationBuilderService.getConfigurationBuilder();

    if ( globalContextType.getErasedType().isInstance( globalContext ) ) {
      @SuppressWarnings("unchecked")
      G store = (G) globalContext;
      return store;
    }

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

    private BeanMap beanMap;

    public TypeMapper(Class type)
    {
        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

  private static 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

  private static 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

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.