public interface MutableDynaClass extends DynaClass
A specialized extension to DynaClass that allows properties
to be added or removed dynamically.
WARNING - No guarantees that this will be in the final APIs ... it's here primarily to preserve some concepts that were in the original proposal for further discussion.
| Modifier and Type | Method and Description |
|---|---|
void |
add(String name)
Add a new dynamic property with no restrictions on data type,
readability, or writeability.
|
void |
add(String name,
Class<?> type)
Add a new dynamic property with the specified data type, but with
no restrictions on readability or writeability.
|
void |
add(String name,
Class<?> type,
boolean readable,
boolean writeable)
Add a new dynamic property with the specified data type, readability,
and writeability.
|
boolean |
isRestricted()
Is this DynaClass currently restricted, if so, no changes to the
existing registration of property names, data types, readability, or
writeability are allowed.
|
void |
remove(String name)
Remove the specified dynamic property, and any associated data type,
readability, and writeability, from this dynamic class.
|
void |
setRestricted(boolean restricted)
Set the restricted state of this DynaClass to the specified value.
|
getDynaProperties, getDynaProperty, getName, newInstancevoid add(String name)
name - Name of the new dynamic propertyIllegalArgumentException - if name is nullIllegalStateException - if this DynaClass is currently
restricted, so no new properties can be addedvoid add(String name, Class<?> type)
name - Name of the new dynamic propertytype - Data type of the new dynamic property (null for no
restrictions)IllegalArgumentException - if name is nullIllegalStateException - if this DynaClass is currently
restricted, so no new properties can be addedvoid add(String name, Class<?> type, boolean readable, boolean writeable)
name - Name of the new dynamic propertytype - Data type of the new dynamic property (null for no
restrictions)readable - Set to true if this property value
should be readablewriteable - Set to true if this property value
should be writeableIllegalArgumentException - if name is nullIllegalStateException - if this DynaClass is currently
restricted, so no new properties can be addedboolean isRestricted()
true if this Mutable DynaClass is restricted,
otherwise falsevoid remove(String name)
name - Name of the dynamic property to removeIllegalArgumentException - if name is nullIllegalStateException - if this DynaClass is currently
restricted, so no properties can be removedvoid setRestricted(boolean restricted)
restricted - The new restricted stateCopyright © 2000–2019 The Apache Software Foundation. All rights reserved.