/** * Convenience method to retrieve the {@link DynaProperty}s * for this {@link DynaClass}. * * @return The an array of the {@link DynaProperty}s. */ private DynaProperty[] getDynaProperties() { return getDynaBean().getDynaClass().getDynaProperties(); }
/** * Convenience method to retrieve the {@link DynaProperty}s * for this {@link DynaClass}. * * @return The an array of the {@link DynaProperty}s. */ private DynaProperty[] getDynaProperties() { return getDynaBean().getDynaClass().getDynaProperties(); }
if (Map.class.isAssignableFrom(elementType)) { dynaBean = createDynaBeanForMapProperty(object); this.elementDynaClass = dynaBean.getDynaClass(); } else if (DynaBean.class.isAssignableFrom(elementType)) { dynaBean = (DynaBean)object; this.elementDynaClass = dynaBean.getDynaClass(); } else { dynaBean = new WrapDynaBean(object); this.wrapDynaClass = (WrapDynaClass)dynaBean.getDynaClass();
if (Map.class.isAssignableFrom(elementType)) { dynaBean = createDynaBeanForMapProperty(object); this.elementDynaClass = dynaBean.getDynaClass(); } else if (DynaBean.class.isAssignableFrom(elementType)) { dynaBean = (DynaBean)object; this.elementDynaClass = dynaBean.getDynaClass(); } else { dynaBean = new WrapDynaBean(object); this.wrapDynaClass = (WrapDynaClass)dynaBean.getDynaClass();
newBean = ((DynaBean) bean).getDynaClass().newInstance(); } else { newBean = bean.getClass().newInstance();
newBean = ((DynaBean) bean).getDynaClass().newInstance(); } else { newBean = bean.getClass().newInstance();
/** * Indicate whether the {@link DynaBean} contains a specified * value for one (or more) of its properties. * * @param key The {@link DynaBean}'s property name * @return <code>true</code> if one of the {@link DynaBean}'s * properties contains a specified value. */ public boolean containsKey(final Object key) { final DynaClass dynaClass = getDynaBean().getDynaClass(); final DynaProperty dynaProperty = dynaClass.getDynaProperty(toString(key)); return (dynaProperty == null ? false : true); }
/** * Indicate whether the {@link DynaBean} contains a specified * value for one (or more) of its properties. * * @param key The {@link DynaBean}'s property name * @return <code>true</code> if one of the {@link DynaBean}'s * properties contains a specified value. */ public boolean containsKey(final Object key) { final DynaClass dynaClass = getDynaBean().getDynaClass(); final DynaProperty dynaProperty = dynaClass.getDynaProperty(toString(key)); return (dynaProperty == null ? false : true); }
/** * <p>Returns the Set of the property * names in the decorated {@link DynaBean}.</p> * * <p><b>N.B.</b>For {@link DynaBean}s whose associated {@link DynaClass} * is a {@link MutableDynaClass} a new Set is created every * time, otherwise the Set is created only once and cached.</p> * * @return An unmodifiable set of the {@link DynaBean}s * property names. */ public Set<K> keySet() { if (keySet != null) { return keySet; } // Create a Set of the keys final DynaProperty[] properties = getDynaProperties(); Set<K> set = new HashSet<K>(properties.length); for (DynaProperty propertie : properties) { set.add(convertKey(propertie.getName())); } set = Collections.unmodifiableSet(set); // Cache the keySet if Not a MutableDynaClass final DynaClass dynaClass = getDynaBean().getDynaClass(); if (!(dynaClass instanceof MutableDynaClass)) { keySet = set; } return set; }
/** * <p>Returns the Set of the property * names in the decorated {@link DynaBean}.</p> * * <p><b>N.B.</b>For {@link DynaBean}s whose associated {@link DynaClass} * is a {@link MutableDynaClass} a new Set is created every * time, otherwise the Set is created only once and cached.</p> * * @return An unmodifiable set of the {@link DynaBean}s * property names. */ public Set<K> keySet() { if (keySet != null) { return keySet; } // Create a Set of the keys final DynaProperty[] properties = getDynaProperties(); Set<K> set = new HashSet<K>(properties.length); for (DynaProperty propertie : properties) { set.add(convertKey(propertie.getName())); } set = Collections.unmodifiableSet(set); // Cache the keySet if Not a MutableDynaClass final DynaClass dynaClass = getDynaBean().getDynaClass(); if (!(dynaClass instanceof MutableDynaClass)) { keySet = set; } return set; }
((DynaBean) bean).getDynaClass().getDynaProperty(name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" + name + "' on dynaclass '" + ((DynaBean) bean).getDynaClass() + "'" );
if (bean instanceof DynaBean) { final DynaProperty[] descriptors = ((DynaBean) bean).getDynaClass().getDynaProperties(); for (DynaProperty descriptor : descriptors) { final String name = descriptor.getName();
((DynaBean) bean).getDynaClass().getDynaProperty(name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" + name + "' on dynaclass '" + ((DynaBean) bean).getDynaClass() + "'" );
((DynaBean) bean).getDynaClass().getDynaProperty(name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" + name + "' on dynaclass '" + ((DynaBean) bean).getDynaClass() + "'" );
if (bean instanceof DynaBean) { final DynaProperty[] descriptors = ((DynaBean) bean).getDynaClass().getDynaProperties(); for (DynaProperty descriptor : descriptors) { final String name = descriptor.getName();
((DynaBean) bean).getDynaClass().getDynaProperty(name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
if (bean instanceof DynaBean) { final DynaProperty[] descriptors = ((DynaBean) bean).getDynaClass().getDynaProperties(); for (DynaProperty descriptor : descriptors) { final String name = descriptor.getName();
if (bean instanceof DynaBean) { final DynaProperty[] descriptors = ((DynaBean) bean).getDynaClass().getDynaProperties(); for (DynaProperty descriptor : descriptors) { final String name = descriptor.getName();
final DynaClass dynaClass = ((DynaBean) target).getDynaClass(); final DynaProperty dynaProperty = dynaClass.getDynaProperty(propName); if (dynaProperty == null) {
final DynaClass dynaClass = ((DynaBean) target).getDynaClass(); final DynaProperty dynaProperty = dynaClass.getDynaProperty(propName); if (dynaProperty == null) {