- java.lang.Object
-
- org.eclipse.persistence.indirection.ValueHolder<T>
-
- All Implemented Interfaces:
Serializable,Cloneable,ValueHolderInterface<T>,WeavedAttributeValueHolderInterface<T>
public class ValueHolder<T> extends Object implements WeavedAttributeValueHolderInterface<T>, Cloneable, Serializable
Purpose: Act as a place holder for a variable that required a value holder interface. This class should be used to initialze an objects attributes that are using indirection is their mappings.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TvalueStores the wrapped object.-
Fields inherited from interface org.eclipse.persistence.indirection.ValueHolderInterface
shouldToStringInstantiate
-
-
Constructor Summary
Constructors Constructor Description ValueHolder()PUBLIC: Initialize the holder.ValueHolder(T value)PUBLIC: Initialize the holder with an object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()INTERNAL:TgetValue()PUBLIC: Return the wrapped object.booleanisCoordinatedWithProperty()Used as part of the implementation of WeavedAttributeValueHolderInterface Used to track whether a valueholder that has been weaved into a class is coordinated with the underlying propertybooleanisInstantiated()PUBLIC: Return a boolean indicating whether the wrapped object has been set or not.booleanisNewlyWeavedValueHolder()Used as part of the implementation of WeavedAttributeValueHolderInterface Used to determine if this ValueHolder was added instantiated as part of the constructor of a weaved classvoidsetIsCoordinatedWithProperty(boolean coordinated)Used as part of the implementation of WeavedAttributeValueHolderInterface Used to track whether a valueholder that has been weaved into a class is coordinated with the underlying property This method will be called internall when the state of Coordination between the weaved valueholder and the underlying value is knownvoidsetIsNewlyWeavedValueHolder(boolean isNew)Used as part of the implementation of WeavedAttributeValueHolderInterface Used to determine if this ValueHolder was added instantiated as part of the constructor of a weaved class This method will be called when a ValueHolder is instantiated in a weaved classvoidsetValue(T value)PUBLIC: Set the wrapped object.booleanshouldAllowInstantiationDeferral()INTERNAL: Return if add/remove should trigger instantiation or avoid.StringtoString()INTERNAL:
-
-
-
Field Detail
-
value
protected T value
Stores the wrapped object.
-
-
Constructor Detail
-
ValueHolder
public ValueHolder()
PUBLIC: Initialize the holder.
-
ValueHolder
public ValueHolder(T value)
PUBLIC: Initialize the holder with an object.
-
-
Method Detail
-
clone
public Object clone()
INTERNAL:- Specified by:
clonein interfaceValueHolderInterface<T>- Overrides:
clonein classObject
-
getValue
public T getValue()
PUBLIC: Return the wrapped object.- Specified by:
getValuein interfaceValueHolderInterface<T>
-
isCoordinatedWithProperty
public boolean isCoordinatedWithProperty()
Used as part of the implementation of WeavedAttributeValueHolderInterface Used to track whether a valueholder that has been weaved into a class is coordinated with the underlying property- Specified by:
isCoordinatedWithPropertyin interfaceWeavedAttributeValueHolderInterface<T>
-
isNewlyWeavedValueHolder
public boolean isNewlyWeavedValueHolder()
Used as part of the implementation of WeavedAttributeValueHolderInterface Used to determine if this ValueHolder was added instantiated as part of the constructor of a weaved class- Specified by:
isNewlyWeavedValueHolderin interfaceWeavedAttributeValueHolderInterface<T>
-
isInstantiated
public boolean isInstantiated()
PUBLIC: Return a boolean indicating whether the wrapped object has been set or not.- Specified by:
isInstantiatedin interfaceValueHolderInterface<T>
-
setIsCoordinatedWithProperty
public void setIsCoordinatedWithProperty(boolean coordinated)
Used as part of the implementation of WeavedAttributeValueHolderInterface Used to track whether a valueholder that has been weaved into a class is coordinated with the underlying property This method will be called internall when the state of Coordination between the weaved valueholder and the underlying value is known- Specified by:
setIsCoordinatedWithPropertyin interfaceWeavedAttributeValueHolderInterface<T>
-
setIsNewlyWeavedValueHolder
public void setIsNewlyWeavedValueHolder(boolean isNew)
Used as part of the implementation of WeavedAttributeValueHolderInterface Used to determine if this ValueHolder was added instantiated as part of the constructor of a weaved class This method will be called when a ValueHolder is instantiated in a weaved class- Specified by:
setIsNewlyWeavedValueHolderin interfaceWeavedAttributeValueHolderInterface<T>
-
setValue
public void setValue(T value)
PUBLIC: Set the wrapped object.- Specified by:
setValuein interfaceValueHolderInterface<T>
-
shouldAllowInstantiationDeferral
public boolean shouldAllowInstantiationDeferral()
INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.- Specified by:
shouldAllowInstantiationDeferralin interfaceWeavedAttributeValueHolderInterface<T>
-
-