public MetaProperty getMetaProperty(String name) { return this.delegate.getMetaProperty(name); }
private static MetaBeanProperty getMetaPropertyFromMutableMetaClass(String propertyName, MetaClass metaClass) { final boolean isModified = ((MutableMetaClass) metaClass).isModified(); if (isModified) { final MetaProperty metaProperty = metaClass.getMetaProperty(propertyName); if(metaProperty instanceof MetaBeanProperty) return (MetaBeanProperty)metaProperty; } return null; }
public MetaProperty getMetaProperty(String name) { final Object owner = getOwner(); final MetaClass ownerMetaClass = getOwnerMetaClass(owner); return ownerMetaClass.getMetaProperty(name); }
@Override public ISlot create(Object owner, Type ownerType, String name) { MetaProperty property = GroovyRuntimeUtil.getMetaClass(owner).getMetaProperty(name); return property != null && MopUtil.isWriteable(property) ? new PropertySlot(owner, ownerType, property) : null; } }
@Override public ISlot create(Object owner, Type ownerType, String name) { String plural = toPluralForm(name); MetaProperty property = GroovyRuntimeUtil.getMetaClass(owner).getMetaProperty(plural); return property != null && Collection.class.isAssignableFrom(property.getType()) && MopUtil.isReadable(property) ? new CollectionSlot(plural, owner, ownerType, property) : null; }
final List<MetaProperty> propList = metaClass.getProperties(); for (MetaProperty prop : propList) if (self.getMetaProperty(prop.getName()) == null) { mc.registerBeanProperty(prop.getName(), new MixinInstanceMetaProperty(prop, mixin)); if (self.getMetaProperty(prop.getName()) == null) { mc.registerBeanProperty(prop.getName(), new MixinInstanceMetaProperty(prop, mixin));
private MetaBeanProperty getMetaPropertyFromMutableMetaClass(String propertyName, MetaClass metaClass) { final boolean isModified = ((MutableMetaClass) metaClass).isModified(); final MetaProperty metaProperty = metaClass.getMetaProperty(propertyName); if(metaProperty instanceof MetaBeanProperty) return isModified ? (MetaBeanProperty)metaProperty : null; else return null; }
private static EventTriggerCaller resolveMetaPropertyClosureCaller(String eventMethodName, MetaClass metaClass) { MetaProperty metaProperty = metaClass.getMetaProperty(eventMethodName); if (metaProperty != null) { return new MetaPropertyClosureCaller(metaProperty); } return null; }
private MetaBeanProperty getMetaPropertyFromMutableMetaClass(String propertyName, MetaClass metaClass) { final boolean isModified = ((MutableMetaClass) metaClass).isModified(); if (isModified) { final MetaProperty metaProperty = metaClass.getMetaProperty(propertyName); if(metaProperty instanceof MetaBeanProperty) return (MetaBeanProperty)metaProperty; } return null; }
@Nullable protected MetaProperty lookupProperty(MetaClass metaClass, String name) { if (metaClass instanceof MetaClassImpl) { try { return (MetaProperty) META_PROP_METHOD.invoke(metaClass, name, false); } catch (Throwable e) { throw UncheckedException.throwAsUncheckedException(e); } } // Some other meta-class implementation - fall back to the public API return metaClass.getMetaProperty(name); }
public PropertyDescriptor getPropertyDescriptor(String name) { MetaProperty property = theMetaClass.getMetaProperty(name); if(property != null) { return createPropertyDescriptor(clazz, property); } return null; }
private MetaBeanProperty getMetaPropertyFromMutableMetaClass(String propertyName, MetaClass metaClass) { final boolean isModified = ((MutableMetaClass) metaClass).isModified(); if (isModified) { final MetaProperty metaProperty = metaClass.getMetaProperty(propertyName); if(metaProperty instanceof MetaBeanProperty) return (MetaBeanProperty)metaProperty; } return null; }
private MetaBeanProperty getMetaPropertyFromMutableMetaClass(String propertyName, MetaClass metaClass) { final boolean isModified = ((MutableMetaClass) metaClass).isModified(); if (isModified) { final MetaProperty metaProperty = metaClass.getMetaProperty(propertyName); if(metaProperty instanceof MetaBeanProperty) return (MetaBeanProperty)metaProperty; } return null; }
@Nullable @Override protected MetaProperty lookupProperty(MetaClass metaClass, String name) { MetaProperty metaProperty = super.lookupProperty(metaClass, name); if (metaProperty != null) { return metaProperty; } metaProperty = classMetaData.getMetaProperty(name); if (metaProperty != null && Modifier.isStatic(metaProperty.getModifiers())) { return metaProperty; } return null; }
public boolean isReadableProperty(String name) { MetaProperty metaProperty = theMetaClass.getMetaProperty(name); if(metaProperty instanceof MetaBeanProperty) { MetaBeanProperty metaBeanProperty = (MetaBeanProperty) metaProperty; return metaBeanProperty.getField() != null || metaBeanProperty.getGetter() != null; } return false; }
public MetaProperty getMetaProperty(String name) { final Object owner = getOwner(); final MetaClass ownerMetaClass = getOwnerMetaClass(owner); return ownerMetaClass.getMetaProperty(name); }
public MetaProperty getMetaProperty(String name) { final Object owner = getOwner(); final MetaClass ownerMetaClass = getOwnerMetaClass(owner); return ownerMetaClass.getMetaProperty(name); }
private static Object getStaticPropertyValue(MetaClass theMetaClass, String name) { MetaProperty metaProperty = theMetaClass.getMetaProperty(name); if(metaProperty != null && Modifier.isStatic(metaProperty.getModifiers())) { return metaProperty.getProperty(theMetaClass.getTheClass()); } return null; }
public static Class<?> getPropertyType(Class<?> cls, String propertyName) { MetaProperty metaProperty = GroovySystem.getMetaClassRegistry().getMetaClass(cls).getMetaProperty(propertyName); if(metaProperty != null) { return metaProperty.getType(); } return null; }
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; }