/** * 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 (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } final Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(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 (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } final Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(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) * * @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, Class type) { if (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(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 (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } final Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(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) * * @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, Class type) { if (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(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) * * @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, Class type) { if (name == null) { throw new IllegalArgumentException("Property name is missing."); } if (isRestricted()) { throw new IllegalStateException("DynaClass is currently restricted. No new properties can be added."); } Object value = values.get(name); // Check if the property already exists if (value == null) { values.put(name, type == null ? null : createProperty(name, type)); } }