ChainedPropertyDescriptor(Class<?> clazz, String fieldName, boolean indexed, String index) { this.indexed = indexed; this.index = index; field = ReflectionUtils.getFieldFromBean(clazz, fieldName); }
ChainedPropertyDescriptor(Class<?> clazz, String fieldName, boolean indexed, int index) { this.indexed = indexed; this.index = index; field = ReflectionUtils.getFieldFromBean(clazz, fieldName); }
public static Field getFieldFromBean(Class<?> clazz, String fieldName) { return getFieldFromBean(clazz, fieldName, clazz); }
ChainedPropertyDescriptor(Class<?> clazz, String fieldName, boolean indexed, String index) { this.indexed = indexed; this.index = index; field = ReflectionUtils.getFieldFromBean(clazz, fieldName); }
public static Field getFieldFromBean(Class<?> clazz, String fieldName) { return getFieldFromBean(clazz, fieldName, clazz); }
public static Field getFieldFromBean(Class<?> clazz, String fieldName) { return getFieldFromBean(clazz, fieldName, clazz); }
private static Field getFieldFromBean(Class<?> clazz, String fieldName, final Class<?> originalClass) { try { Field field = clazz.getDeclaredField(fieldName); // Allow access to private instance var's that dont have public // setter. field.setAccessible(true); return field; } catch (NoSuchFieldException e) { if (clazz.getSuperclass() != null) { return getFieldFromBean(clazz.getSuperclass(), fieldName, originalClass); } throw new MappingException("No such field found " + originalClass.getName() + "." + fieldName, e); } }
public FieldPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index, HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer) { super(clazz, fieldName, isIndexed, index, srcDeepIndexHintContainer, destDeepIndexHintContainer); String[] tokens = fieldName.split(DozerConstants.DEEP_FIELD_DELIMITER_REGEXP); descriptorChain = new DozerPropertyDescriptor[tokens.length]; Class<?> currentType = clazz; for (int i = 0, tokensLength = tokens.length; i < tokensLength; i++) { String token = tokens[i]; descriptorChain[i] = new ChainedPropertyDescriptor(currentType, token, isIndexed, index); if (i < tokensLength) { Field field = ReflectionUtils.getFieldFromBean(currentType, tokens[i]); currentType = field.getType(); } } }
private static Field getFieldFromBean(Class<?> clazz, String fieldName, final Class<?> originalClass) { try { Field field = clazz.getDeclaredField(fieldName); // Allow access to private instance var's that dont have public setter. field.setAccessible(true); return field; } catch (NoSuchFieldException e) { if (clazz.getSuperclass() != null) { return getFieldFromBean(clazz.getSuperclass(), fieldName, originalClass); } throw new MappingException("No such field found " + originalClass.getName() + "." + fieldName, e); } }
public FieldPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, String index, HintContainer deepIndexHintContainer) { super(clazz, fieldName, isIndexed, index, deepIndexHintContainer); String[] tokens = fieldName.split(DozerConstants.DEEP_FIELD_DELIMITER_REGEXP); descriptorChain = new DozerPropertyDescriptor[tokens.length]; Class<?> currentType = clazz; for (int i = 0, tokensLength = tokens.length; i < tokensLength; i++) { String token = tokens[i]; descriptorChain[i] = new ChainedPropertyDescriptor(currentType, token, isIndexed, index); if (i < tokensLength) { Field field = ReflectionUtils.getFieldFromBean(currentType, tokens[i]); currentType = field.getType(); } } }
private static Field getFieldFromBean(Class<?> clazz, String fieldName, final Class<?> originalClass) { try { Field field = clazz.getDeclaredField(fieldName); // Allow access to private instance var's that dont have public // setter. field.setAccessible(true); return field; } catch (NoSuchFieldException e) { if (clazz.getSuperclass() != null) { return getFieldFromBean(clazz.getSuperclass(), fieldName, originalClass); } throw new MappingException("No such field found " + originalClass.getName() + "." + fieldName, e); } }
public FieldPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, String index, HintContainer deepIndexHintContainer) { super(clazz, fieldName, isIndexed, index, deepIndexHintContainer); String[] tokens = fieldName.split(DozerConstants.DEEP_FIELD_DELIMITER_REGEXP); descriptorChain = new DozerPropertyDescriptor[tokens.length]; Class<?> currentType = clazz; for (int i = 0, tokensLength = tokens.length; i < tokensLength; i++) { String token = tokens[i]; descriptorChain[i] = new ChainedPropertyDescriptor(currentType, token, isIndexed, index); if (i < tokensLength) { Field field = ReflectionUtils.getFieldFromBean(currentType, tokens[i]); currentType = field.getType(); } } }