private static boolean inheritedOrPublic(CachedField mfp) { return Modifier.isPublic(mfp.getModifiers()) || Modifier.isProtected(mfp.getModifiers()); }
public boolean isStatic() { return Modifier.isStatic(getModifiers()); }
public boolean isFinal() { return Modifier.isFinal(getModifiers()); }
private static boolean packageLocal(CachedField mfp, CachedClass klass) { if (klass == null) return false; return isDefaultVisibility(mfp.getModifiers()) && inSamePackage(mfp.field.getDeclaringClass(), klass.getTheClass()); }
/** * Set the property on the given object to the new value. * * @param object on which to set the property * @param newValue the new value of the property * @throws RuntimeException if the property could not be set */ public void setProperty(Object object, Object newValue) { MetaMethod setter = getSetter(); if (setter == null) { if (field != null && !Modifier.isFinal(field.getModifiers())) { field.setProperty(object, newValue); return; } throw new GroovyRuntimeException("Cannot set read-only property: " + name); } newValue = DefaultTypeTransformation.castToType(newValue, getType()); setter.invoke(object, new Object[]{newValue}); }
public boolean isFinal() { return Modifier.isFinal(getModifiers()); }
public boolean isStatic() { return Modifier.isStatic(getModifiers()); }
public boolean isStatic() { return Modifier.isStatic(getModifiers()); }
public boolean isStatic() { return Modifier.isStatic(getModifiers()); }
public boolean isStatic() { return Modifier.isStatic(getModifiers()); }
private void copyNonPrivateFields(SingleKeyHashMap from, SingleKeyHashMap to) { for (ComplexKeyHashMap.EntryIterator iter = from.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = (SingleKeyHashMap.Entry) iter.next(); CachedField mfp = (CachedField) entry.getValue(); if (!Modifier.isPublic(mfp.getModifiers()) && !Modifier.isProtected(mfp.getModifiers())) continue; to.put(entry.getKey(), mfp); } }
private void copyNonPrivateFields(SingleKeyHashMap from, SingleKeyHashMap to) { for (ComplexKeyHashMap.EntryIterator iter = from.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = (SingleKeyHashMap.Entry) iter.next(); CachedField mfp = (CachedField) entry.getValue(); if (!Modifier.isPublic(mfp.getModifiers()) && !Modifier.isProtected(mfp.getModifiers())) continue; to.put(entry.getKey(), mfp); } }
private void copyNonPrivateFields(SingleKeyHashMap from, SingleKeyHashMap to) { for (ComplexKeyHashMap.EntryIterator iter = from.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = (SingleKeyHashMap.Entry) iter.next(); CachedField mfp = (CachedField) entry.getValue(); if (!Modifier.isPublic(mfp.getModifiers()) && !Modifier.isProtected(mfp.getModifiers())) continue; to.put(entry.getKey(), mfp); } }
private void copyNonPrivateFields(SingleKeyHashMap from, SingleKeyHashMap to) { for (ComplexKeyHashMap.EntryIterator iter = from.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = (SingleKeyHashMap.Entry) iter.next(); CachedField mfp = (CachedField) entry.getValue(); if (!Modifier.isPublic(mfp.getModifiers()) && !Modifier.isProtected(mfp.getModifiers())) continue; to.put(entry.getKey(), mfp); } }
/** * Set the property on the given object to the new value. * * @param object on which to set the property * @param newValue the new value of the property * @throws RuntimeException if the property could not be set */ public void setProperty(Object object, Object newValue) { MetaMethod setter = getSetter(); if (setter == null) { if (field != null && !Modifier.isFinal(field.getModifiers())) { field.setProperty(object, newValue); return; } throw new GroovyRuntimeException("Cannot set read-only property: " + name); } newValue = DefaultTypeTransformation.castToType(newValue, getType()); setter.invoke(object, new Object[]{newValue}); }