@Override public Property<?> createProperty(Object bean) { return new MethodProperty<Object>(propertyType, bean, readMethod, writeMethod); }
/** * Sets the value of the property. * * Note that since Vaadin 7, no conversions are performed and the value must * be of the correct type. * * @param newValue * the New value of the property. * @throws <code>Property.ReadOnlyException</code> * if the object is in read-only mode. * @see #invokeSetMethod(Object) */ @Override public void setValue(T newValue) throws Property.ReadOnlyException { // Checks the mode if (isReadOnly()) { throw new Property.ReadOnlyException(); } invokeSetMethod(newValue); fireValueChange(); }
Object[] setArgs = (Object[]) in.readObject(); Object[] getArgs = (Object[]) in.readObject(); setArguments(getArgs, setArgs, setArgumentIndex); String name = (String) in.readObject(); Class<?>[] paramTypes = SerializerHelper.readClassArray(in); getLogger().log(Level.SEVERE, "Internal deserialization error", e); } catch (NoSuchMethodException e) { getLogger().log(Level.SEVERE, "Internal deserialization error", e);
getMethod = initGetterMethod(beanPropertyName, beanClass); } catch (final NoSuchMethodException ignored) { throw new MethodException(this, setArguments(DEFAULT_GET_ARGS, DEFAULT_SET_ARGS, 0); this.instance = instance;
if (p instanceof MethodProperty) { MethodProperty mp = (MethodProperty) p; assert (mp.getInstance() == getBean()); mp.setInstance(bean); } else if (p instanceof NestedMethodProperty) { NestedMethodProperty nmp = (NestedMethodProperty) p;
setArguments(getArgs, setArgs, setArgumentIndex); this.instance = instance; this.type = convertedType;
/** * Sets the instance used by this property. * <p> * The new instance must be of the same type as the old instance * <p> * To be consistent with {@link #setValue(Object)}, this method will fire a * value change event even if the value stays the same * * @param instance * the instance to use * @since 7.7.7 */ public void setInstance(Object instance) { if (this.instance.getClass() != instance.getClass()) { throw new IllegalArgumentException("The new instance is of type " + instance.getClass().getName() + " which does not match the old instance type " + this.instance.getClass().getName()); } this.instance = instance; fireValueChange(); }
lastClass = propertyClass; try { Method getter = MethodProperty.initGetterMethod( simplePropertyName, propertyClass); propertyClass = getter.getReturnType();
setArguments(getArgs, setArgs, setArgumentIndex); this.instance = instance;
return new MethodProperty<Object>(getType(propertyId), new FileItem((File) itemId), FILEITEM_NAME, null); return new MethodProperty<Object>(getType(propertyId), new FileItem((File) itemId), FILEITEM_ICON, null); return new MethodProperty<Object>(getType(propertyId), new FileItem((File) itemId), FILEITEM_SIZE, null); return new MethodProperty<Object>(getType(propertyId), new FileItem((File) itemId), FILEITEM_LASTMODIFIED, null);