public void setDelegate(Property delegate) { this.delegate = delegate; if (writeMethod != null && write == null && !filler) { filler = true; write = discoverMethod(targetType, writeMethod, getActualTypeArguments()); } } }
@Override public Class<?>[] getActualTypeArguments() { if (parameters == null && delegate != null) { return delegate.getActualTypeArguments(); } return parameters; }
public final PropertyUtils getPropertyUtils() { if (propertyUtils == null) { propertyUtils = new PropertyUtils(); } return propertyUtils; }
protected void applySequence(Object bean, List<?> value) { try { Property property = getPropertyUtils().getProperty(bean.getClass(), getSequencePropertyName(bean.getClass())); property.set(bean, value); } catch (Exception e) { throw new YAMLException(e); } }
private Property discoverProperty(String name) { if (propertyUtils != null) { if (beanAccess == null) { return propertyUtils.getProperty(type, name); } return propertyUtils.getProperty(type, name, beanAccess); } return null; }
protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess) { Set<Property> properties = new TreeSet<Property>(); Collection<Property> props = getPropertiesMap(type, bAccess).values(); for (Property property : props) { if (property.isReadable() && (allowReadOnlyProperties || property.isWritable())) { properties.add(property); } } return properties; }
public Property getProperty(Class<? extends Object> type, String name, BeanAccess bAccess) { Map<String, Property> properties = getPropertiesMap(type, bAccess); Property property = properties.get(name); if (property == null && skipMissingProperties) { property = new MissingProperty(name); } if (property == null) { throw new YAMLException( "Unable to find property '" + name + "' on class: " + type.getName()); } return property; }
public Set<Property> getProperties(Class<? extends Object> type, BeanAccess bAccess) { if (readableProperties.containsKey(type)) { return readableProperties.get(type); } Set<Property> properties = createPropertySet(type, bAccess); readableProperties.put(type, properties); return properties; }
@Override public boolean isReadable() { return (read != null) || (field != null) || (delegate != null && delegate.isReadable()); }
@Override public boolean isWritable() { return (write != null) || (field != null) || (delegate != null && delegate.isWritable()); }
public Set<Property> getProperties(Class<? extends Object> type) { return getProperties(type, beanAccess); }
public PropertySubstitute(String name, Class<?> type, String readMethod, String writeMethod, Class<?>... params) { super(name, type); this.readMethod = readMethod; this.writeMethod = writeMethod; setActualTypeArguments(params); this.filler = false; }
public MethodProperty(PropertyDescriptor property) { super(property.getName(), property.getPropertyType(), MethodProperty.discoverGenericType(property)); this.property = property; this.readable = property.getReadMethod() != null; this.writable = property.getWriteMethod() != null; }
public Property getProperty(Class<? extends Object> type, String name) { return getProperty(type, name, beanAccess); }
public final PropertyUtils getPropertyUtils() { if (propertyUtils == null) { propertyUtils = new PropertyUtils(); } return propertyUtils; }
protected Property getProperty(Class<? extends Object> type, String name) { return getPropertyUtils().getProperty(type, name); } }