Package org.modelmapper.internal.PropertyInfoImpl

Examples of org.modelmapper.internal.PropertyInfoImpl.FieldPropertyInfo


   * Returns a FieldPropertyInfo instance for the given field.
   */
  static synchronized FieldPropertyInfo fieldPropertyFor(Class<?> type, Field field,
      Configuration configuration, String name) {
    Integer hashCode = hashCodeFor(type, field.getName(), configuration);
    FieldPropertyInfo fieldPropertyInfo = (FieldPropertyInfo) cache.get(hashCode);
    if (fieldPropertyInfo == null) {
      fieldPropertyInfo = new FieldPropertyInfo(type, field, name);
      cache.put(hashCode, fieldPropertyInfo);
    }

    return fieldPropertyInfo;
  }
View Full Code Here


        if (proxy == null) {
          proxy = createProxy(accessor.getType());
          interceptor.methodProxies.put(methodName, proxy);
        }
      } else if (accessor instanceof FieldPropertyInfo) {
        FieldPropertyInfo field = (FieldPropertyInfo) accessor;
        Object nextProxy = field.getValue(proxy);
        if (nextProxy == null) {
          nextProxy = createProxy(field.getType());
          field.setValue(proxy, nextProxy);
        }
        proxy = nextProxy;
      }
    }
  }
View Full Code Here

  enum Color {
    Red, Blue
  }

  MappingImpl mapping(final String arg) throws Exception {
    Mutator mutator = new FieldPropertyInfo(ArrayList.class,
        ArrayList.class.getDeclaredField("size"), arg) {
    };
    return new MappingImpl(Arrays.asList(mutator)) {
      public String toString() {
        return arg;
View Full Code Here

    private void recordDestinationField(Class<?> type, Field field) {
      assertNotFinal(field);
      if (PropertyInfoResolver.FIELDS.isValid(field)) {
        String propertyName = config.getDestinationNameTransformer().transform(field.getName(),
            NameableType.FIELD);
        FieldPropertyInfo propertyInfo = PropertyInfoRegistry.fieldPropertyFor(type, field, config,
            propertyName);
        mapping.destinationAccessors.add(propertyInfo);
        mapping.destinationMutators.add(propertyInfo);
      } else
        errors.invalidDestinationField(field);
View Full Code Here

TOP

Related Classes of org.modelmapper.internal.PropertyInfoImpl.FieldPropertyInfo

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.