public MultipleSetterProperty(String name) { super(name, Object.class); this.setterName = MetaProperty.getSetterName(name); }
public ThreadBoundSetter(String name) { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(type)} ); this.name = getSetterName(name); }
private static MetaMethod createSetter(final MetaProperty property, final MixinInMetaClass mixinInMetaClass) { return new MetaMethod() { final String name = getSetterName(property.getName()); { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(property.getType())} ); } public int getModifiers() { return Modifier.PUBLIC; } public String getName() { return name; } public Class getReturnType() { return property.getType(); } public CachedClass getDeclaringClass() { return mixinInMetaClass.getInstanceClass(); } public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } }; }
String setterName = MetaProperty.getSetterName(leftPropertyExpression.getPropertyAsString()); List<MethodNode> methods = helper.getMethods(setterName); for (MethodNode method : methods) {
public ThreadBoundSetter(String name) { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(type)} ); this.name = getSetterName(name); }
public ThreadBoundSetter(String name) { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(type)} ); this.name = getSetterName(name); }
public ThreadBoundSetter(String name) { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(type)} ); this.name = getSetterName(name); }
static public boolean isJavaBeanPropertyWritable(Object instance, String propertyName) { MetaClass mc = InvokerHelper.getMetaClass(instance); MetaProperty metaProperty = mc.getMetaProperty(propertyName); if(metaProperty != null) { String setterName = MetaProperty.getSetterName(propertyName); return !mc.respondsTo(instance, setterName, new Class[]{metaProperty.getType()}).isEmpty(); } else if(instance instanceof Script) { return ((Script)instance).getProperty(propertyName) != null; } return false; }
private static MetaMethod createSetter(final MetaProperty property, final MixinInMetaClass mixinInMetaClass) { return new MetaMethod() { final String name = getSetterName(property.getName()); { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(property.getType())} ); } public int getModifiers() { return Modifier.PUBLIC; } public String getName() { return name; } public Class getReturnType() { return property.getType(); } public CachedClass getDeclaringClass() { return mixinInMetaClass.getInstanceClass(); } public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } }; }
private static MetaMethod createSetter(final MetaProperty property, final MixinInMetaClass mixinInMetaClass) { return new MetaMethod() { final String name = getSetterName(property.getName()); { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(property.getType())} ); } public int getModifiers() { return Modifier.PUBLIC; } public String getName() { return name; } public Class getReturnType() { return property.getType(); } public CachedClass getDeclaringClass() { return mixinInMetaClass.getInstanceClass(); } public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } }; }
private static MetaMethod createSetter(final MetaProperty property, final MixinInMetaClass mixinInMetaClass) { return new MetaMethod() { final String name = getSetterName(property.getName()); { setParametersTypes (new CachedClass [] {ReflectionCache.getCachedClass(property.getType())} ); } public int getModifiers() { return Modifier.PUBLIC; } public String getName() { return name; } public Class getReturnType() { return property.getType(); } public CachedClass getDeclaringClass() { return mixinInMetaClass.getInstanceClass(); } public Object invoke(Object object, Object[] arguments) { property.setProperty(mixinInMetaClass.getMixinInstance(object), arguments[0]); return null; } }; }
if (property instanceof MultipleSetterProperty) { String setterName = MetaProperty.getSetterName(property.getName()); DynamicInvokeResult setterResult = invokeMethod(setterName, value); if (setterResult.isFound()) {