public void update() { fireBinding(); }
public void reverseUpdate() { fireReverseBinding(); }
private void fireBinding() { if ((sourceBinding == null) || (targetBinding == null)) { // should we throw invalid binding exception? or fail quietly? return; } Object result = sourceBinding.getSourceValue(); if (getValidator() != null) { Object validation = getValidator().call(result); if ((validation == null) || ((validation instanceof Boolean) && !(Boolean) validation)) { // should we throw a validation failed exception? or fail quietly? return; } } if (getConverter() != null) { result = getConverter().call(result); } targetBinding.updateTargetValue(result); }
public void setSourceBinding(SourceBinding source) { if (!(source instanceof PropertyBinding)) { throw new IllegalArgumentException("Only PropertySourceBindings are accepted"); } if (!propertyName.equals(((PropertyBinding) source).getPropertyName())) { throw new IllegalArgumentException("PropertyName must be '" + propertyName + "'"); } Object bean = ((PropertyBinding) source).getBean(); if ((bean == null) || !klass.isAssignableFrom(bean.getClass())) { throw new IllegalArgumentException("SourceBean must be a " + klass.getName()); } super.setSourceBinding(source); }
public void setTargetBinding(TargetBinding target) { super.setTargetBinding(target); } }
private void fireReverseBinding() { if (!(sourceBinding instanceof TargetBinding) || !(targetBinding instanceof SourceBinding)) { throw new RuntimeException("Binding Instance is not reversable"); } Object result = ((SourceBinding)targetBinding).getSourceValue(); if (getReverseConverter() != null) { result = getReverseConverter().call(result); } ((TargetBinding)sourceBinding).updateTargetValue(result); }
public void setSourceBinding(SourceBinding source) { if (!(source instanceof PropertyBinding)) { throw new IllegalArgumentException("Only PropertySourceBindings are accepted"); } if (!propertyName.equals(((PropertyBinding) source).getPropertyName())) { throw new IllegalArgumentException("PropertyName must be '" + propertyName + "'"); } Object bean = ((PropertyBinding) source).getBean(); if ((bean == null) || !klass.isAssignableFrom(bean.getClass())) { throw new IllegalArgumentException("SourceBean must be a " + klass.getName()); } super.setSourceBinding(source); }
public void setTargetBinding(TargetBinding target) { super.setTargetBinding(target); } }
private void fireReverseBinding() { if (!(sourceBinding instanceof TargetBinding) || !(targetBinding instanceof SourceBinding)) { throw new RuntimeException("Binding Instance is not reversable"); } Object result = ((SourceBinding)targetBinding).getSourceValue(); if (getReverseConverter() != null) { result = getReverseConverter().call(result); } ((TargetBinding)sourceBinding).updateTargetValue(result); }
private void fireBinding() { if ((sourceBinding == null) || (targetBinding == null)) { // should we throw invalid binding exception? or fail quietly? return; } Object result = sourceBinding.getSourceValue(); if (getValidator() != null) { Object validation = getValidator().call(); if ((validation == null) || ((validation instanceof Boolean) && !((Boolean)validation).booleanValue())) { // should we throw a validation failed exception? or fail quietly? return; } } if (getConverter() != null) { result = getConverter().call(result); } targetBinding.updateTargetValue(result); }
public void setSourceBinding(SourceBinding source) { if (!(source instanceof PropertyBinding)) { throw new IllegalArgumentException("Only PropertySourceBindings are accepted"); } if (!propertyName.equals(((PropertyBinding) source).getPropertyName())) { throw new IllegalArgumentException("PropertyName must be '" + propertyName + "'"); } Object bean = ((PropertyBinding) source).getBean(); if ((bean == null) || !klass.isAssignableFrom(bean.getClass())) { throw new IllegalArgumentException("SourceBean must be a " + klass.getName()); } super.setSourceBinding(source); }
public void setTargetBinding(TargetBinding target) { super.setTargetBinding(target); } }
private void fireReverseBinding() { if (!(sourceBinding instanceof TargetBinding) || !(targetBinding instanceof SourceBinding)) { throw new RuntimeException("Binding Instance is not reversable"); } Object result = ((SourceBinding)targetBinding).getSourceValue(); if (getReverseConverter() != null) { result = getReverseConverter().call(result); } ((TargetBinding)sourceBinding).updateTargetValue(result); }
public void reverseUpdate() { fireReverseBinding(); }
public void update() { fireBinding(); }
private void fireBinding() { if ((sourceBinding == null) || (targetBinding == null)) { // should we throw invalid binding exception? or fail quietly? return; } Object result = sourceBinding.getSourceValue(); if (getValidator() != null) { Object validation = getValidator().call(result); if ((validation == null) || ((validation instanceof Boolean) && !(Boolean) validation)) { // should we throw a validation failed exception? or fail quietly? return; } } if (getConverter() != null) { result = getConverter().call(result); } targetBinding.updateTargetValue(result); }
public void setSourceBinding(SourceBinding source) { if (!(source instanceof PropertyBinding)) { throw new IllegalArgumentException("Only PropertySourceBindings are accepted"); } if (!propertyName.equals(((PropertyBinding) source).getPropertyName())) { throw new IllegalArgumentException("PropertyName must be '" + propertyName + "'"); } Object bean = ((PropertyBinding) source).getBean(); if ((bean == null) || !klass.isAssignableFrom(bean.getClass())) { throw new IllegalArgumentException("SourceBean must be a " + klass.getName()); } super.setSourceBinding(source); }
public void setTargetBinding(TargetBinding target) { super.setTargetBinding(target); }
private void fireReverseBinding() { if (!(sourceBinding instanceof TargetBinding) || !(targetBinding instanceof SourceBinding)) { throw new RuntimeException("Binding Instance is not reversable"); } Object result = ((SourceBinding)targetBinding).getSourceValue(); if (getReverseConverter() != null) { result = getReverseConverter().call(result); } ((TargetBinding)sourceBinding).updateTargetValue(result); }
public void reverseUpdate() { fireReverseBinding(); }