Class WriteableTypeImpl
java.lang.Object
org.glassfish.hk2.configuration.hub.internal.WriteableTypeImpl
- All Implemented Interfaces:
Type
,WriteableType
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWriteableTypeImpl
(WriteableBeanDatabaseImpl parent, String name) WriteableTypeImpl
(WriteableBeanDatabaseImpl parent, TypeImpl mother) -
Method Summary
Modifier and TypeMethodDescriptionaddInstance
(String key, Object bean) Adds the instance with the given key to the typeaddInstance
(String key, Object bean, Object metadata) Adds the instance with the given key to the type(package private) ClassReflectionHelper
getInstance
(String key) Gets the instance associated with this key, or null if there is noneReturns a read-only map of the instances that are associated with this typeGets information about this type.getName()
A unique identifier for this typemodifyInstance
(String key, Object newBean, PropertyChangeEvent... propChanges) Modifies the instance with the given keyremoveInstance
(String key) Removes the instance with the given key from the typevoid
setMetadata
(Object metadata) Sets an object containing information about this type.toString()
-
Field Details
-
parent
-
name
-
beanMap
-
helper
-
metadata
-
-
Constructor Details
-
WriteableTypeImpl
WriteableTypeImpl(WriteableBeanDatabaseImpl parent, TypeImpl mother) -
WriteableTypeImpl
WriteableTypeImpl(WriteableBeanDatabaseImpl parent, String name)
-
-
Method Details
-
getName
Description copied from interface:Type
A unique identifier for this type -
getInstances
Description copied from interface:Type
Returns a read-only map of the instances that are associated with this type- Specified by:
getInstances
in interfaceType
- Returns:
- A read-only and possibly empty map of instances associated with this type
-
getInstance
Description copied from interface:Type
Gets the instance associated with this key, or null if there is none- Specified by:
getInstance
in interfaceType
- Parameters:
key
- The non-null key for the instance- Returns:
- The resulting instance or null if there is none
-
addInstance
Description copied from interface:WriteableType
Adds the instance with the given key to the type- Specified by:
addInstance
in interfaceWriteableType
- Parameters:
key
- A non-null name for this beanbean
- The non-null bean to add- Returns:
- The instance that was created
-
addInstance
Description copied from interface:WriteableType
Adds the instance with the given key to the type- Specified by:
addInstance
in interfaceWriteableType
- Parameters:
key
- A non-null name for this beanbean
- The non-null bean to addmetadata
- Possibly null metadata to be associated with this bean- Returns:
- The instance that was created
-
removeInstance
Description copied from interface:WriteableType
Removes the instance with the given key from the type- Specified by:
removeInstance
in interfaceWriteableType
- Parameters:
key
- A non-null name for this bean- Returns:
- The possibly null bean that was removed. If null then no bean was found with the given name
-
modifyInstance
public PropertyChangeEvent[] modifyInstance(String key, Object newBean, PropertyChangeEvent... propChanges) Description copied from interface:WriteableType
Modifies the instance with the given key- Specified by:
modifyInstance
in interfaceWriteableType
- Parameters:
key
- 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 modification- Returns:
- If changes has length greater than zero then this simply returns changes. If changes is zero length then this will return the set of changes automatically determined by the system
-
getHelper
ClassReflectionHelper getHelper() -
getMetadata
Description copied from interface:Type
Gets information about this type. Can be used to describe the type in some useful way- Specified by:
getMetadata
in interfaceType
- Returns:
- The possibly null metadata associated with this type
-
setMetadata
Description copied from interface:Type
Sets an object containing information about this type. Can be used to describe the type in some useful way- Specified by:
setMetadata
in interfaceType
- Parameters:
metadata
- The possibly null metadata to be associated with this type
-
toString
-