public class WriteableTypeImpl extends java.lang.Object implements WriteableType
| Modifier and Type | Field and Description |
|---|---|
private java.util.HashMap<java.lang.String,Instance> |
beanMap |
private ClassReflectionHelper |
helper |
private java.lang.Object |
metadata |
private java.lang.String |
name |
private WriteableBeanDatabaseImpl |
parent |
| Constructor and Description |
|---|
WriteableTypeImpl(WriteableBeanDatabaseImpl parent,
java.lang.String name) |
WriteableTypeImpl(WriteableBeanDatabaseImpl parent,
TypeImpl mother) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(java.lang.String key,
java.lang.Object bean)
Adds the instance with the given key to the type
|
void |
addInstance(java.lang.String key,
java.lang.Object bean,
java.lang.Object metadata)
Adds the instance with the given key to the type
|
(package private) ClassReflectionHelper |
getHelper() |
Instance |
getInstance(java.lang.String key)
Gets the instance associated with this key, or null if there is none
|
java.util.Map<java.lang.String,Instance> |
getInstances()
Returns a read-only map of the instances that are associated with this type
|
java.lang.Object |
getMetadata()
Gets information about this type.
|
java.lang.String |
getName()
A unique identifier for this type
|
java.beans.PropertyChangeEvent[] |
modifyInstance(java.lang.String key,
java.lang.Object newBean,
java.beans.PropertyChangeEvent... propChanges)
Modifies the instance with the given key
|
Instance |
removeInstance(java.lang.String key)
Removes the instance with the given key from the type
|
void |
setMetadata(java.lang.Object metadata)
Sets an object containing information about this
type.
|
java.lang.String |
toString() |
private final WriteableBeanDatabaseImpl parent
private final java.lang.String name
private final java.util.HashMap<java.lang.String,Instance> beanMap
private final ClassReflectionHelper helper
private java.lang.Object metadata
WriteableTypeImpl(WriteableBeanDatabaseImpl parent, TypeImpl mother)
WriteableTypeImpl(WriteableBeanDatabaseImpl parent, java.lang.String name)
public java.lang.String getName()
Typepublic java.util.Map<java.lang.String,Instance> getInstances()
TypegetInstances in interface Typepublic Instance getInstance(java.lang.String key)
TypegetInstance in interface Typekey - The non-null key for the instancepublic void addInstance(java.lang.String key,
java.lang.Object bean)
WriteableTypeaddInstance in interface WriteableTypekey - A non-null name for this beanbean - The non-null bean to addpublic void addInstance(java.lang.String key,
java.lang.Object bean,
java.lang.Object metadata)
WriteableTypeaddInstance in interface WriteableTypekey - A non-null name for this beanbean - The non-null bean to addmetadata - Possibly null metadata to be associated with this beanpublic Instance removeInstance(java.lang.String key)
WriteableTyperemoveInstance in interface WriteableTypekey - A non-null name for this beanpublic java.beans.PropertyChangeEvent[] modifyInstance(java.lang.String key,
java.lang.Object newBean,
java.beans.PropertyChangeEvent... propChanges)
WriteableTypemodifyInstance in interface WriteableTypekey - A non-null name or key for the bean to modifynewBean - The new bean to use with this keypropChanges - The full set of changes from the previous version. If this
is a zero-length array then the system will attempt to automatically determine
the changes made to this type and will generate the list of PropertyChangeEvent
to be associated with this modificationClassReflectionHelper getHelper()
public java.lang.Object getMetadata()
TypegetMetadata in interface Typepublic void setMetadata(java.lang.Object metadata)
TypesetMetadata in interface Typemetadata - The possibly null metadata
to be associated with this typepublic java.lang.String toString()
toString in class java.lang.Object