public class ObjectVar<T extends _BaseObject_> extends object<T>
This implementation takes care of counting the references of assigned legacy 4GL class instances.
Object variables are instantiated as ObjectVar (by the TypeFactory or
ArrayAssigner); this is required to enable the reference counting ONLY for the instances
which were defined as variables in the legacy code. Also, they are registered at the defining
top-level block via ObjectOps.registerPending(java.lang.Object...) when they are defined via TypeFactory, so
that when they get out of scope, their referenced object can update the counter.
This type can't be sub-classed, as Hibernate types are dependent on it.
BaseDataType.Type, BaseDataType.WrapperHandler| Constructor and Description |
|---|
ObjectVar()
Default ctor.
|
ObjectVar(java.lang.Class<T> cls)
Initialize this object reference, allowing only assignment to objects compatible with the
specified type.
|
ObjectVar(ObjectVar var)
Create a copy of the specified object variable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(object value)
Sets the state (data and unknown value) of this instance based on the state of the passed
instance.
|
protected void |
decrement()
Decrement the reference counter for this instance.
|
protected void |
increment()
Increment the reference counter for this instance.
|
void |
setUnknown()
Sets the state of this instance's
unknown value flag or state to
true. |
_isValid, assign, assign, assign, compareTo, defaultFormatString, duplicate, fromResourceId, getType, hashCode, instantiateDefault, instantiateUnknown, isIncompatibleTypesOnConversion, isTracked, isUnknown, isValid, readExternal, ref, resourceId, set, toString, toString, toStringExport, toStringMessage, type, writeExternalassign, assign, calcFormatLength, createProxy, createProxy, deepCopy, elementsOfType, equals, fallback, formatLength, fromTypeName, generateDefault, generateUnknown, getAssigner, getSize, getTypeName, incompatibleTypesOnConversion, initialize, initializeDefaultExtent, instantiateDefaultExtent, invalidInitializer, isAllKnown, isAllKnown, isAssignDirect, isProxy, isUnknownValue, maximum, minimum, notUnknownValue, sameType, val, variablechanged, checkUndoable, checkUndoable, checkUndoable, getTransLevel, isGlobal, isUndoable, markUndoable, popBlock, rollback, setGlobalpublic ObjectVar()
public ObjectVar(java.lang.Class<T> cls)
cls - The type of references this object can hold.public ObjectVar(ObjectVar var)
Reference counting will be performed.
var - The variable to copy.public void assign(object value)
Reference management is performed for the old and new values.
assign in class object<T extends _BaseObject_>value - The instance from which to copy state.public void setUnknown()
unknown value flag or state to
true.
Warning: the data stored in this instance will be invalid after calling this method.
setUnknown in class object<T extends _BaseObject_>protected void decrement()
decrement in class object<T extends _BaseObject_>protected void increment()
increment in class object<T extends _BaseObject_>