public XmlBeanPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, String index, HintContainer deepIndexHintContainer) { fieldPropertyDescriptor = new JavaBeanPropertyDescriptor(clazz, fieldName, isIndexed, index, deepIndexHintContainer); isSetFieldPropertyDescriptor = new JavaBeanPropertyDescriptor(clazz, getIsSetFieldName(fieldName), isIndexed, index, deepIndexHintContainer); }
@Override protected Method getReadMethod() throws NoSuchMethodException { Method result = getPropertyDescriptor(deepIndexHintContainer).getReadMethod(); if (result == null) { throw new NoSuchMethodException( "Unable to determine read method for Field: " + fieldName + " in Class: " + clazz); } return result; }
public Class<?> getPropertyType() { return fieldPropertyDescriptor.getPropertyType(); }
private boolean isFieldSet(Object bean) { try { final Boolean isSetField = (Boolean) isSetFieldPropertyDescriptor.getPropertyValue(bean); return isSetField.booleanValue(); } catch (Throwable e) { // The isSetField will not be present for all fields eg. Class.name // - // that's ok. return true; } }
@Override protected String getSetMethodName() throws NoSuchMethodException { return getWriteMethod().getName(); }
@Override protected Method getReadMethod() throws NoSuchMethodException { if (readMethod == null || readMethod.get() == null) { if (customGetMethod != null) { Method method = ReflectionUtils.findAMethod(clazz, customGetMethod); readMethod = new SoftReference<Method>(method); } else { return super.getReadMethod(); } } return readMethod.get(); }
@Override protected String getSetMethodName() throws NoSuchMethodException { return customSetMethod != null ? customSetMethod : super.getSetMethodName(); }
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { fieldPropertyDescriptor.setPropertyValue(bean, value, fieldMap); }
private boolean isFieldSet(Object bean) { try { final Boolean isSetField = (Boolean) isSetFieldPropertyDescriptor.getPropertyValue(bean); return isSetField.booleanValue(); } catch (Throwable e) { // The isSetField will not be present for all fields eg. Class.name - // that's ok. return true; } }
@Override protected String getSetMethodName() throws NoSuchMethodException { return getWriteMethod().getName(); }
@Override protected Method getReadMethod() throws NoSuchMethodException { if (readMethod == null || readMethod.get() == null) { if (customGetMethod != null) { Method method = ReflectionUtils.findAMethod(clazz, customGetMethod); readMethod = new SoftReference<Method>(method); } else { return super.getReadMethod(); } } return readMethod.get(); }
@Override protected String getSetMethodName() throws NoSuchMethodException { return customSetMethod != null ? customSetMethod : super.getSetMethodName(); }
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { fieldPropertyDescriptor.setPropertyValue(bean, value, fieldMap); }
public XmlBeanPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index, HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer) { fieldPropertyDescriptor = new JavaBeanPropertyDescriptor(clazz, fieldName, isIndexed, index, srcDeepIndexHintContainer, destDeepIndexHintContainer); isSetFieldPropertyDescriptor = new JavaBeanPropertyDescriptor(clazz, getIsSetFieldName(fieldName), isIndexed, index, srcDeepIndexHintContainer, destDeepIndexHintContainer); }
@Override protected Method getReadMethod() throws NoSuchMethodException { Method result = getPropertyDescriptor(deepIndexHintContainer).getReadMethod(); if (result == null) { throw new NoSuchMethodException( "Unable to determine read method for Field: " + fieldName + " in Class: " + clazz); } return result; }
private boolean isFieldSet(Object bean) { try { final Boolean isSetField = (Boolean) isSetFieldPropertyDescriptor.getPropertyValue(bean); return isSetField.booleanValue(); } catch (Throwable e) { // The isSetField will not be present for all fields eg. Class.name // - // that's ok. return true; } }
@Override protected String getSetMethodName() throws NoSuchMethodException { return getWriteMethod().getName(); }
@Override protected Method getReadMethod() throws NoSuchMethodException { if (readMethod == null || readMethod.get() == null) { if (customGetMethod != null) { Method method = ReflectionUtils.findAMethod(clazz, customGetMethod); readMethod = new SoftReference<Method>(method); } else { return super.getReadMethod(); } } return readMethod.get(); }
@Override protected String getSetMethodName() throws NoSuchMethodException { return customSetMethod != null ? customSetMethod : super.getSetMethodName(); }
public Class<?> getPropertyType() { return fieldPropertyDescriptor.getPropertyType(); }