/** * Add a new dynamic property with no restrictions on data type, * readability, or writeability. * * @param name Name of the new dynamic property * * @throws IllegalArgumentException if name is null * @throws IllegalStateException if this DynaClass is currently * restricted, so no new properties can be added */ public void add(final String name) { add(new DynaProperty(name)); }
/** * Add a new dynamic property with no restrictions on data type, * readability, or writeability. * * @param name Name of the new dynamic property * * @throws IllegalArgumentException if name is null * @throws IllegalStateException if this DynaClass is currently * restricted, so no new properties can be added */ public void add(final String name) { add(new DynaProperty(name)); }
/** * <p>Return an array of <code>ProperyDescriptors</code> for the properties * currently defined in this DynaClass. If no properties are defined, a * zero-length array will be returned.</p> * * <p><strong>FIXME</strong> - Should we really be implementing * <code>getBeanInfo()</code> instead, which returns property descriptors * and a bunch of other stuff?</p> * @return the set of properties for this DynaClass */ public DynaProperty[] getDynaProperties() { int i = 0; final DynaProperty[] properties = new DynaProperty[values.size()]; for (final Map.Entry<String, Object> e : values.entrySet()) { final String name = e.getKey(); final Object value = values.get(name); properties[i++] = new DynaProperty(name, value == null ? null : value.getClass()); } return properties; }
/** * <p>Return an array of <code>ProperyDescriptors</code> for the properties * currently defined in this DynaClass. If no properties are defined, a * zero-length array will be returned.</p> * * <p><strong>FIXME</strong> - Should we really be implementing * <code>getBeanInfo()</code> instead, which returns property descriptors * and a bunch of other stuff?</p> * @return the set of properties for this DynaClass */ public DynaProperty[] getDynaProperties() { int i = 0; final DynaProperty[] properties = new DynaProperty[values.size()]; for (final Map.Entry<String, Object> e : values.entrySet()) { final String name = e.getKey(); final Object value = values.get(name); properties[i++] = new DynaProperty(name, value == null ? null : value.getClass()); } return properties; }
return new DynaProperty(name); } else { return new DynaProperty(name, value.getClass());
return new DynaProperty(name); } else { return new DynaProperty(name, value.getClass());
switch (sqlType) { case java.sql.Types.DATE: return new DynaProperty(name, java.sql.Date.class); case java.sql.Types.TIMESTAMP: return new DynaProperty(name, java.sql.Timestamp.class); case java.sql.Types.TIME: return new DynaProperty(name, java.sql.Time.class); default: className = metadata.getColumnClassName(i); clazz = loadClass(className); return new DynaProperty(name, clazz);
switch (sqlType) { case java.sql.Types.DATE: return new DynaProperty(name, java.sql.Date.class); case java.sql.Types.TIMESTAMP: return new DynaProperty(name, java.sql.Timestamp.class); case java.sql.Types.TIME: return new DynaProperty(name, java.sql.Time.class); default: className = metadata.getColumnClassName(i); clazz = loadClass(className); return new DynaProperty(name, clazz);
/** * Add a new dynamic property with the specified data type, but with * no restrictions on readability or writeability. * * @param name Name of the new dynamic property * @param type Data type of the new dynamic property (null for no * restrictions) * * @throws IllegalArgumentException if name is null * @throws IllegalStateException if this DynaClass is currently * restricted, so no new properties can be added */ public void add(final String name, final Class<?> type) { if (type == null) { add(name); } else { add(new DynaProperty(name, type)); } }
/** * Add a new dynamic property with the specified data type, but with * no restrictions on readability or writeability. * * @param name Name of the new dynamic property * @param type Data type of the new dynamic property (null for no * restrictions) * * @throws IllegalArgumentException if name is null * @throws IllegalStateException if this DynaClass is currently * restricted, so no new properties can be added */ public void add(final String name, final Class<?> type) { if (type == null) { add(name); } else { add(new DynaProperty(name, type)); } }
dynaProperty = new DynaProperty(name);
regulars[i]); properties[i] = new DynaProperty(regulars[i].getName(), regulars[i].getPropertyType()); propertiesMap.put(properties[i].getName(), (PropertyDescriptor) mappeds.get(name); properties[j] = new DynaProperty(descriptor.getName(), Map.class); propertiesMap.put(properties[j].getName(),
regulars[i]); properties[i] = new DynaProperty(regulars[i].getName(), regulars[i].getPropertyType()); propertiesMap.put(properties[i].getName(), (PropertyDescriptor) mappeds.get(name); properties[j] = new DynaProperty(descriptor.getName(), Map.class); propertiesMap.put(properties[j].getName(),
dynaProperty = new DynaProperty(name);
return new DynaProperty(name, type);
DynaProperty[] props = new DynaProperty[]{ new DynaProperty("firstName", String.class), new DynaProperty("lastName", String.class), new DynaProperty("address", java.util.Map.class) }; BasicDynaClass dynaClass = new BasicDynaClass("student", null, props);
public void end() { for (String property : predicates.keySet()) { if (!properties.containsKey(property)) { DynaProperty dp; if (isFunctional(property)) dp = new DynaProperty(property); else dp = new DynaProperty(property, Set.class); properties.put(property, dp); } } }
/** * Add a new dynamic property with no restrictions on data type, * readability, or writeability. * * @param name Name of the new dynamic property * * @exception IllegalArgumentException if name is null * @exception IllegalStateException if this DynaClass is currently * restricted, so no new properties can be added */ public void add(String name) { add(new DynaProperty(name)); }
@Override public DynaProperty[] getDynaProperties() { if (properties.isEmpty()) { delegate.keySet().forEach((String key) -> { Object oMember = delegate.getMember(key); if (!(oMember instanceof JSObject) || !((JSObject) oMember).isFunction()) { properties.put(key, new DynaProperty(key)); } }); } return properties.values().toArray(new DynaProperty[]{}); }
public void setIndexed(URI pred) { if (isFunctional(pred.getLocalName())) { DynaProperty dp = new DynaProperty(pred.getLocalName(), List.class); properties.put(pred.getLocalName(), dp); } }