Package com.cognifide.slice.mapper.strategy

Examples of com.cognifide.slice.mapper.strategy.MapperStrategy


    ValueMap valueMap = resource.adaptTo(ValueMap.class);
    try {
      Class<?> type = object.getClass();
      Field[] fields = ReflectionHelper.readAllDeclaredFields(type);
      for (Field field : fields) {
        MapperStrategy mapperStrategy = mapperStrategyFactory.getMapperStrategy(field
            .getDeclaringClass());
        if (shouldFieldBeMapped(field, mapperStrategy)) {
          Object value = mapResourceToField(resource, valueMap, field);
          FieldUtils.writeField(field, object, value, ReflectionHelper.FORCE_ACCESS);
        }
View Full Code Here


   */
  private <T> T mapResourceToObject(final Resource resource, final T object) {
    ValueMap valueMap = resource.adaptTo(ValueMap.class);
    try {
      Class<?> type = object.getClass();
      MapperStrategy mapperStrategy = mapperStrategyFactory.getMapperStrategy(type);
      Field[] fields = ReflectionHelper.readAllDeclaredFields(type);
      for (Field field : fields) {
        if (shouldFieldBeMapped(field, mapperStrategy)) {
          Object value = mapResourceToField(resource, valueMap, field);
          FieldUtils.writeField(field, object, value, ReflectionHelper.FORCE_ACCESS);
View Full Code Here

TOP

Related Classes of com.cognifide.slice.mapper.strategy.MapperStrategy

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.