Module org.eclipse.persistence.core
Class ValueHolder<T>
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:
-
Field Summary
Fields inherited from interface org.eclipse.persistence.indirection.ValueHolderInterface
shouldToStringInstantiate
-
Constructor Summary
ConstructorDescriptionPUBLIC: Initialize the holder.ValueHolder
(T value) PUBLIC: Initialize the holder with an object. -
Method Summary
Modifier and TypeMethodDescriptionclone()
INTERNAL:getValue()
PUBLIC: Return the wrapped object.boolean
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 propertyboolean
PUBLIC: Return a boolean indicating whether the wrapped object has been set or not.boolean
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 classvoid
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 knownvoid
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 classvoid
PUBLIC: Set the wrapped object.boolean
INTERNAL: Return if add/remove should trigger instantiation or avoid.toString()
INTERNAL:
-
Field Details
-
value
Stores the wrapped object.
-
-
Constructor Details
-
ValueHolder
public ValueHolder()PUBLIC: Initialize the holder. -
ValueHolder
PUBLIC: Initialize the holder with an object.
-
-
Method Details
-
clone
INTERNAL:- Specified by:
clone
in interfaceValueHolderInterface<T>
- Overrides:
clone
in classObject
-
getValue
PUBLIC: Return the wrapped object.- Specified by:
getValue
in 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:
isCoordinatedWithProperty
in 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:
isNewlyWeavedValueHolder
in interfaceWeavedAttributeValueHolderInterface<T>
-
isInstantiated
public boolean isInstantiated()PUBLIC: Return a boolean indicating whether the wrapped object has been set or not.- Specified by:
isInstantiated
in 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:
setIsCoordinatedWithProperty
in 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:
setIsNewlyWeavedValueHolder
in interfaceWeavedAttributeValueHolderInterface<T>
-
setValue
PUBLIC: Set the wrapped object.- Specified by:
setValue
in 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:
shouldAllowInstantiationDeferral
in interfaceWeavedAttributeValueHolderInterface<T>
-
toString
INTERNAL:
-