public Standard(BeanPropertyAccessor<B> accessor, Map<String, BeanProperty> properties) { mAccessor = accessor; // Only reveal readable properties. SortedSet<String> propertyNames = new TreeSet<String>(); for (BeanProperty property : properties.values()) { if (property.getReadMethod() != null) { propertyNames.add(property.getName()); } } mPropertyNames = Collections.unmodifiableSortedSet(propertyNames); }
set == PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS) if (bp.getReadMethod() == null || bp.getWriteMethod() == null) { continue; set != PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS; if (bp.getReadMethod() != null) { if (checkedAllowed || !throwsCheckedException(bp.getReadMethod())) { readProperties.add(bp);
if (property.getReadMethod() == null || property.getWriteMethod() == null || BeanPropertyAccessor.throwsCheckedException(property.getReadMethod()) || BeanPropertyAccessor.throwsCheckedException(property.getWriteMethod()))
if (prop.getReadMethod() == null) { throw new IllegalArgumentException ("Property '" + propertyName + "' cannot be read");
IndexedProperty(BeanProperty property) { super(property.getName(), property.getType(), property.getCovariantTypes()); setReadMethod(property.getReadMethod()); setWriteMethod(property.getWriteMethod()); }
public final Method getReadMethod() { return mBeanProperty.getReadMethod(); }
public final Method getReadMethod() { return mBeanProperty.getReadMethod(); }
static Class getEnclosingType(BeanProperty property) { Method m = property.getReadMethod(); if (m == null) { m = property.getWriteMethod(); } return m.getDeclaringClass(); }
b.invoke(bp.getReadMethod()); b.invoke(bp.getReadMethod()); b.convert(TypeDesc.forClass(bp.getType()), TypeDesc.OBJECT); b.invokeVirtual(Object.class.getName(), "equals", TypeDesc.BOOLEAN, params);
static Class getEnclosingType(BeanProperty property) { Method m = property.getReadMethod(); if (m == null) { m = property.getWriteMethod(); } return m.getDeclaringClass(); }
public final String getReadMethodName() { Method m = mBeanProperty.getReadMethod(); if (m != null) { return m.getName(); } // Return synthetic name. return "get" + getWriteMethod().getName().substring(3); }
public Standard(BeanPropertyAccessor<B> accessor, Map<String, BeanProperty> properties) { mAccessor = accessor; // Only reveal readable properties. SortedSet<String> propertyNames = new TreeSet<String>(); for (BeanProperty property : properties.values()) { if (property.getReadMethod() != null) { propertyNames.add(property.getName()); } } mPropertyNames = Collections.unmodifiableSortedSet(propertyNames); }
public final String getReadMethodName() { Method m = mBeanProperty.getReadMethod(); if (m != null) { return m.getName(); } // Return synthetic name. return "get" + getWriteMethod().getName().substring(3); }
/** * @param property bean property which must have a read method * @return adapter with a null annotation, or null if nothing applicable */ static StorablePropertyAdapter selectAdapterFor(final BeanProperty property) { final Method readMethod = property.getReadMethod(); if (readMethod == null) { throw new IllegalArgumentException(); } final Class propertyType = property.getType(); if (DateTime.class.isAssignableFrom(propertyType) || DateMidnight.class.isAssignableFrom(propertyType) || LocalDate.class.isAssignableFrom(propertyType) || LocalDateTime.class.isAssignableFrom(propertyType) || java.util.Date.class.isAssignableFrom(propertyType)) { return selectAdapter(property, DateTimeAdapter.class, readMethod); } else if (String.class.isAssignableFrom(propertyType)) { return selectAdapter(property, TextAdapter.class, readMethod); } // else if ... return null; }
/** * @param property bean property which must have a read method * @return adapter with a null annotation, or null if nothing applicable */ static StorablePropertyAdapter selectAdapterFor(final BeanProperty property) { final Method readMethod = property.getReadMethod(); if (readMethod == null) { throw new IllegalArgumentException(); } final Class propertyType = property.getType(); if (DateTime.class.isAssignableFrom(propertyType) || DateMidnight.class.isAssignableFrom(propertyType) || LocalDate.class.isAssignableFrom(propertyType) || LocalDateTime.class.isAssignableFrom(propertyType) || java.util.Date.class.isAssignableFrom(propertyType)) { return selectAdapter(property, DateTimeAdapter.class, readMethod); } else if (String.class.isAssignableFrom(propertyType)) { return selectAdapter(property, TextAdapter.class, readMethod); } // else if ... return null; }
Class type; if (m.getName().equals(property.getReadMethod().getName())) { if (returnType == null || returnType == void.class) { continue;
case READ_METHOD: case TRY_READ_METHOD: default: { b.loadLocal(beanVar); b.invoke(bp.getReadMethod()); TypeDesc type = TypeDesc.forClass(bp.getType()); b.convert(type, type.toObjectType());
builder.invoke(prop.getReadMethod()); builder.storeLocal(p1); builder.loadLocal(obj2); builder.invoke(prop.getReadMethod()); builder.storeLocal(p2);
if (property.getReadMethod() == null || property.getWriteMethod() == null || BeanPropertyAccessor.throwsCheckedException(property.getReadMethod()) || BeanPropertyAccessor.throwsCheckedException(property.getWriteMethod()))
IndexedProperty(BeanProperty property) { super(property.getName(), property.getType(), property.getCovariantTypes()); setReadMethod(property.getReadMethod()); setWriteMethod(property.getWriteMethod()); }