@Override public void write(Object value) { property.setProperty(owner, value); } }
public void setValue(Object value) { mp.setProperty(bean, value); } }
public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } };
@Override @SuppressWarnings("unchecked") public void write(Object value) { Collection collection = (Collection) property.getProperty(owner); if (collection == null) { if (MopUtil.isWriteable(property)) { collection = createCollection(property.getType()); property.setProperty(owner, collection); } else { throw new RuntimeException(String.format( "Cannot add element to collection property '%s' because it is neither initialized nor does it have a setter", name)); } } collection.add(value); }
public void setChild(FactoryBuilderSupport builder, Object parent, Object child) { if (child == null) return; ObjectGraphBuilder ogbuilder = (ObjectGraphBuilder) builder; if (parent != null) { Map context = ogbuilder.getContext(); Map parentContext = ogbuilder.getParentContext(); String parentName = null; String childName = (String) context.get(NODE_NAME); if (parentContext != null) { parentName = (String) parentContext.get(NODE_NAME); } String propertyName = ogbuilder.relationNameResolver.resolveParentRelationName( parentName, parent, childName, child); MetaProperty metaProperty = InvokerHelper.getMetaClass(child) .hasProperty(child, propertyName); if (metaProperty != null) { metaProperty.setProperty(child, parent); } } }
private void resolveLazyReferences() { if (!lazyReferencesAllowed) return; for (NodeReference ref : lazyReferences) { if (ref.parent == null) continue; Object child = null; try { child = getProperty(ref.refId); } catch (MissingPropertyException mpe) { // ignore } if (child == null) { throw new IllegalArgumentException("There is no valid node for reference " + ref.parentName + "." + ref.childName + "=" + ref.refId); } // set child first childPropertySetter.setChild(ref.parent, child, ref.parentName, relationNameResolver.resolveChildRelationName(ref.parentName, ref.parent, ref.childName, child)); // set parent afterwards String propertyName = relationNameResolver.resolveParentRelationName(ref.parentName, ref.parent, ref.childName, child); MetaProperty metaProperty = InvokerHelper.getMetaClass(child) .hasProperty(child, propertyName); if (metaProperty != null) { metaProperty.setProperty(child, ref.parent); } } }
mp.setProperty(object, newValue); return;
field.setProperty(object, newValue); return;
return metaProperty.getProperty(instance); else { metaProperty.setProperty(instance, optionalValue); return null;
logger.info("setting property {} to {}", prjProp, val); Class type = prop.getType(); Consumer<Object> set = (v) -> prop.setProperty(lenskit, v); if (type.equals(Property.class)) { Method m = null;
public void setValue(Object value) { mp.setProperty(bean, value); } }
public void setValue(Object value) { mp.setProperty(bean, value); } }
public void setValue(Object value) { mp.setProperty(bean, value); } }
public void setValue(Object value) { mp.setProperty(bean, value); } }
public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } };
public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } };
public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } };
public void setChild(FactoryBuilderSupport builder, Object parent, Object child) { if (child == null) return; ObjectGraphBuilder ogbuilder = (ObjectGraphBuilder) builder; if (parent != null) { Map context = ogbuilder.getContext(); Map parentContext = ogbuilder.getParentContext(); String parentName = null; String childName = (String) context.get(NODE_NAME); if (parentContext != null) { parentName = (String) parentContext.get(NODE_NAME); } String propertyName = ogbuilder.relationNameResolver.resolveParentRelationName( parentName, parent, childName, child); MetaProperty metaProperty = InvokerHelper.getMetaClass(child) .hasProperty(child, propertyName); if (metaProperty != null) { metaProperty.setProperty(child, parent); } } }
public void setChild(FactoryBuilderSupport builder, Object parent, Object child) { if (child == null) return; ObjectGraphBuilder ogbuilder = (ObjectGraphBuilder) builder; if (parent != null) { Map context = ogbuilder.getContext(); Map parentContext = ogbuilder.getParentContext(); String parentName = null; String childName = (String) context.get(NODE_NAME); if (parentContext != null) { parentName = (String) parentContext.get(NODE_NAME); } String propertyName = ogbuilder.relationNameResolver.resolveParentRelationName( parentName, parent, childName, child); MetaProperty metaProperty = InvokerHelper.getMetaClass(child) .hasProperty(child, propertyName); if (metaProperty != null) { metaProperty.setProperty(child, parent); } } }
public void setChild( FactoryBuilderSupport builder, Object parent, Object child ) { if( child == null ) return; ObjectGraphBuilder ogbuilder = (ObjectGraphBuilder) builder; if( parent != null ){ Map context = ogbuilder.getContext(); Map parentContext = ogbuilder.getParentContext(); String parentName = null; String childName = (String) context.get( NODE_NAME ); if( parentContext != null ){ parentName = (String) parentContext.get( NODE_NAME ); } String propertyName = ogbuilder.relationNameResolver.resolveParentRelationName( parentName, parent, childName, child ); MetaProperty metaProperty = InvokerHelper.getMetaClass( child ) .hasProperty( child, propertyName ); if( metaProperty != null ){ metaProperty.setProperty( child, parent ); } } }