public class ObjectOps
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ObjectOps.ObjectHelper
Helper to expose APIs which have direct access to the context-local state.
|
private static class |
ObjectOps.WorkArea
Context-local data.
|
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
DE_SPEC
DYNAMIC-ENUM() error message specification.
|
private static java.util.Map<java.lang.Class<? extends _BaseObject_>,java.lang.String> |
legacyNames
Legacy names for each loaded class.
|
private static ContextLocal<ObjectOps.WorkArea> |
local
Context-local data.
|
private static java.lang.Object |
lock
Controls access to the static class/name lookup data.
|
private static java.util.Map<java.lang.String,java.lang.Class<? extends _BaseObject_>> |
name2cls
Map of legacy names converted classes.
|
| Constructor and Description |
|---|
ObjectOps() |
| Modifier and Type | Method and Description |
|---|---|
static ObjectResource |
asResource(_BaseObject_ ref)
Convert this object to its associated pseudo-resource.
|
static ObjectResource |
asResource(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Convert this object to its associated pseudo-resource.
|
static <T extends _BaseObject_> |
cast(BaseDataType val,
java.lang.Class<T> cls)
Cast this object to the specified type.
|
static <T extends _BaseObject_> |
cast(object<?>[] o,
java.lang.Class<T> cls)
Cast this object array to the specified type.
|
static <T extends _BaseObject_> |
cast(object<?> o,
java.lang.Class<T> cls)
Cast this object to the specified type.
|
static void |
decrement(_BaseObject_ ref)
Decrement the reference counter for this instance.
|
static void |
decrement(object<? extends _BaseObject_> obj)
Decrement the reference counter for this object instance.
|
static void |
decrement(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Decrement the reference counter for this instance.
|
(package private) static void |
defaultStaticConstructor(java.lang.Class<?> cls)
Emulate an implicit static constructor.
|
(package private) static boolean |
delete(_BaseObject_ ref)
Deletes the given object.
|
static void |
delete(object<?> o)
Deletes the given object.
|
(package private) static boolean |
delete(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Deletes the given object.
|
static object<? extends _BaseObject_>[] |
dynamicCast(BaseDataType[] o,
character legacyClsName)
Cast this object array to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_>[] |
dynamicCast(BaseDataType[] o,
java.lang.String legacyClsName)
Cast this object array to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_> |
dynamicCast(BaseDataType o,
character legacyClsName)
Cast this object to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_> |
dynamicCast(BaseDataType o,
java.lang.String legacyClsName)
Cast this object to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_>[] |
dynamicCast(object<?>[] o,
character legacyClsName)
Cast this object array to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_>[] |
dynamicCast(object<?>[] o,
java.lang.String legacyClsName)
Cast this object array to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_> |
dynamicCast(object<?> o,
character legacyClsName)
Cast this object to the specified type, resolved dynamically.
|
static object<? extends _BaseObject_> |
dynamicCast(object<?> o,
java.lang.String legacyClsName)
Cast this object to the specified type, resolved dynamically.
|
static <T extends LegacyEnum> |
dynamicEnum(character cname,
character name)
Find and return the specified enum.
|
static <T extends LegacyEnum> |
dynamicEnum(character cname,
int64 value)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(character cname,
long value)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(character cname,
java.lang.String name)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(java.lang.String cname,
character name)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(java.lang.String cname,
int64 value)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(java.lang.String cname,
long value)
Find and return the specified enum.
|
static object<? extends LegacyEnum> |
dynamicEnum(java.lang.String cname,
java.lang.String name)
Find and return the specified enum.
|
(package private) static void |
endInitialization(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Remove this instance from the pending initializations, as it was initialized.
|
private static void |
executeStaticConstructor(java.lang.Class<? extends _BaseObject_> cls)
Force executing the static constructor now.
|
private static void |
generateInvalidTypeDE()
Generate the invalid type error for ToObject.
|
private static void |
generateInvalidValueDE(java.lang.Class<?> cls)
Generate the invalid value error for ToObject.
|
static java.lang.Class<? extends _BaseObject_> |
getAssignableClass(java.lang.String superName,
java.lang.Class<? extends _BaseObject_> cls)
Resolve the
LegacyClass of super class or interface of the class, register it as needed. |
static LegacyClass |
getClassInstance(java.lang.Class<? extends _BaseObject_> cls)
Get the
LegacyClass instance for the given type. |
static BaseDataType |
getDynamicProperty(character className,
character prop)
Implementation of the DYNAMIC-PROPERTY function (getter).
|
static BaseDataType |
getDynamicProperty(object<? extends _BaseObject_> ref,
character prop)
Implementation of the DYNAMIC-PROPERTY function (getter).
|
static BaseDataType |
getDynamicProperty(object<? extends _BaseObject_> ref,
character prop,
NumberType idx)
Implementation of the DYNAMIC-PROPERTY function (getter).
|
static BaseDataType |
getDynamicProperty(java.lang.String className,
character prop)
Implementation of the DYNAMIC-PROPERTY function (getter).
|
static BaseDataType |
getDynamicProperty(java.lang.String className,
character prop,
NumberType idx)
Implementation of the DYNAMIC-PROPERTY function (getter).
|
static object<? extends LegacyClass> |
getLegacyClass(character cls)
Get the
LegacyClass mapped in FWD by the specified converted class name. |
static object<? extends LegacyClass> |
getLegacyClass(java.lang.Class<? extends _BaseObject_> cls)
Get the
LegacyClass mapped in FWD by the specified converted class. |
static object<? extends LegacyClass> |
getLegacyClass(java.lang.String typeName)
Get the
LegacyClass mapped in FWD by the specified converted class name. |
static java.lang.String |
getLegacyName(java.lang.Class<? extends _BaseObject_> cls)
Resolve the legacy name for this class.
|
static ObjectOps.ObjectHelper |
getObjectHelper()
Get an instance of
ObjectOps.ObjectHelper, which has the context-local instance saved, so API access can
be done without a context-local query. |
static java.lang.Class<? extends _BaseObject_> |
getStaticClass(java.lang.Object instance)
Given a static class pseudo-instance, get its associated legacy class.
|
static java.lang.Object |
getStaticInstance(java.lang.Class<? extends _BaseObject_> cls)
Given a legacy class, get the pseudo-instance associated with the static members.
|
static boolean |
hasDestructors(_BaseObject_ ref)
Checks whether an object has any destructors pushed on stack ready to be executed when the
lifetime of the object ends.
|
static void |
increment(_BaseObject_ ref)
Increment the reference counter for this instance.
|
static void |
increment(object<? extends _BaseObject_> obj)
Increment the reference counter for this object instance.
|
(package private) static void |
increment(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Increment the reference counter for this instance.
|
private static java.lang.Object |
invoke(boolean voidReturn,
object<? extends _BaseObject_> ref,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified instance method in the specified object.
|
private static java.lang.Object |
invoke(boolean voidReturn,
java.lang.String clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(character clsName,
character mthdName)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(character clsName,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(character clsName,
java.lang.String mthdName)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(character clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(object<? extends _BaseObject_> ref,
character mthdName)
Invoke the specified instance method in the specified object.
|
static BaseDataType |
invoke(object<? extends _BaseObject_> ref,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified instance method in the specified object.
|
static BaseDataType |
invoke(object<? extends _BaseObject_> ref,
java.lang.String mthdName)
Invoke the specified instance method in the specified object.
|
static BaseDataType |
invoke(object<? extends _BaseObject_> ref,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified instance method in the specified object.
|
static BaseDataType |
invoke(java.lang.String clsName,
character mthdName)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(java.lang.String clsName,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(java.lang.String clsName,
java.lang.String mthdName)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invoke(java.lang.String clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static BaseDataType |
invokePoly(java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the method lookup is enforced via a type emitted during
conversion.
|
static <T extends _BaseObject_> |
invokePoly(java.lang.Class<T> retType,
java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the return type and the lookup are enforced via types emitted
during conversion.
|
static <T extends _BaseObject_> |
invokePoly(java.lang.Class<T> retType,
object<? extends _BaseObject_> ref,
java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the return type and the lookup are enforced via types emitted
during conversion.
|
static BaseDataType |
invokePoly(object<? extends _BaseObject_> ref,
java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the method lookup is enforced via a type emitted during
conversion.
|
private static BaseDataType |
invokePolyWorker(boolean voidReturn,
java.lang.Class<? extends _BaseObject_> retType,
java.lang.Object referent,
java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the return type and the lookup are enforced via types emitted
during conversion.
|
static void |
invokeStandalone(character clsName,
character mthdName)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(character clsName,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(character clsName,
java.lang.String mthdName)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(character clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(object<? extends _BaseObject_> ref,
character mthdName)
Invoke the specified instance method in the specified object.
|
static void |
invokeStandalone(object<? extends _BaseObject_> ref,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified instance method in the specified object.
|
static void |
invokeStandalone(object<? extends _BaseObject_> ref,
java.lang.String mthdName)
Invoke the specified instance method in the specified object.
|
static void |
invokeStandalone(object<? extends _BaseObject_> ref,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified instance method in the specified object.
|
static void |
invokeStandalone(java.lang.String clsName,
character mthdName)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(java.lang.String clsName,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(java.lang.String clsName,
java.lang.String mthdName)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalone(java.lang.String clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Invoke the specified static method in the specified class.
|
static void |
invokeStandalonePoly(java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the method lookup is enforced via a type emitted during
conversion.
|
static void |
invokeStandalonePoly(object<? extends _BaseObject_> ref,
java.lang.Class<? extends _BaseObject_> targetType,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
Perform a dynamic method call, on which the method lookup is enforced via a type emitted during
conversion.
|
(package private) static boolean |
isInitializing(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Return true if this instance is pending initialization.
|
(package private) static boolean |
isLegacyObject(java.lang.Object ref)
Check if this instance is a legacy object or a pseudo-instance associated with a static
class.
|
static boolean |
isSerializable(_BaseObject_ ref)
Check if the given instance is serializable.
|
static boolean |
isValid(_BaseObject_ ref)
Check if this object is valid.
|
private static java.lang.String |
legacyNameWorker(java.lang.Class<? extends _BaseObject_> cls)
Resolve the legacy name for this class.
|
static void |
load(java.lang.Class<? extends _BaseObject_> cls)
Load the given legacy class.
|
(package private) static boolean |
loadClass(ObjectOps.WorkArea wa,
java.lang.Class<? extends _BaseObject_> cls)
Load the given legacy class.
|
private static boolean |
loadClassInt(ObjectOps.WorkArea wa,
java.lang.Class<? extends _BaseObject_> cls)
Perform recursive loading of all classes, up the hierarchy.
|
private static java.lang.Class<? extends _BaseObject_> |
lookupClassWorker(java.lang.String cname)
Return the converted Java class instance for the given legacy class name.
|
static <T extends _BaseObject_> |
newDynamicInstance(character legacyClsName)
Create a new dynamic object.
|
static <T extends _BaseObject_> |
newDynamicInstance(character legacyClsName,
java.lang.String modes,
java.lang.Object... args)
Create a new dynamic object.
|
static <T extends _BaseObject_> |
newDynamicInstance(java.lang.Class<T> cls,
java.lang.String modes,
java.lang.Object... args)
Create a new dynamic object; this API is emitted for a NEW converted to DYNAMIC-NEW, as the arguments
are POLY.
|
static <T extends _BaseObject_> |
newDynamicInstance(java.lang.String legacyClsName)
Create a new dynamic object.
|
static <T extends _BaseObject_> |
newDynamicInstance(java.lang.String legacyClsName,
java.lang.String modes,
java.lang.Object... args)
Create a new dynamic object.
|
static <T extends _BaseObject_> |
newInstance(java.lang.Class<T> cls)
Create a new object.
|
static <T extends _BaseObject_> |
newInstance(java.lang.Class<T> cls,
boolean bypassConstructor,
java.lang.Object... args)
Create a new object.
|
static <T extends _BaseObject_> |
newInstance(java.lang.Class<T> cls,
java.lang.String modes,
java.lang.Object... args)
Create a new object.
|
static <T extends _BaseObject_> |
newInstanceInternal(java.lang.Class<T> cls,
java.lang.String name,
java.lang.String modes,
boolean bypassConstructor,
java.lang.Object... args)
Create a new object.
|
static <T extends _BaseObject_> |
newInstanceInternal(java.lang.Class<T> cls,
java.lang.String name,
java.lang.String modes,
java.lang.Object... args)
Create a new object.
|
private static <T extends _BaseObject_> |
newInstanceInternal(ObjectOps.WorkArea wa,
T ref,
java.lang.Class<T> cls,
java.lang.String name,
java.lang.String modes,
boolean bypassConstructor,
java.lang.Object... args)
Create a new object.
|
private static <T extends _BaseObject_> |
newInstanceInternal(ObjectOps.WorkArea wa,
T ref,
java.lang.Class<T> cls,
java.lang.String name,
java.lang.String modes,
java.lang.Object... args)
Create a new object.
|
(package private) static void |
pendingAssign(_BaseObject_ ref)
Mark this instance as a pending assignment.
|
(package private) static void |
pendingAssign(ObjectOps.WorkArea wa,
_BaseObject_ ref,
boolean register)
Mark this instance as a pending assignment.
|
private static void |
pendingInitialize(ObjectOps.WorkArea wa,
_BaseObject_ ref)
Mark this instance as a pending initialization.
|
static <T> T |
polyArg(java.lang.Class<T> type,
java.lang.Object res)
Wrapper for an argument resulting from a
invokePoly(java.lang.Class<T>, java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) or invokeStandalonePoly(java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) call; in
this case, the direct Java call must enforce the type at compile time, and the runtime will check if the
returned value is compatible with this type. |
static <T extends _BaseObject_> |
polyObjectArg(java.lang.Class<T> type,
java.lang.Object res)
Wrapper for an argument resulting from a
invokePoly(java.lang.Class<T>, java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) or invokeStandalonePoly(java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) call; in
this case, the direct Java call must enforce the type at compile time, and the runtime will check if the
returned value is compatible with this type. |
static void |
registerClass(java.lang.Class<? extends _BaseObject_> cls,
boolean hierarchy)
Create a mapping between a given legacy class name and the converted Java class instance.
|
static void |
registerClass(java.lang.String cname,
java.lang.Class<? extends _BaseObject_> cls)
Create a mapping between a given legacy class name and the converted Java class instance.
|
private static void |
registerClassWorker(java.lang.String cname,
java.lang.Class<? extends _BaseObject_> cls)
Create a mapping between a given legacy class name and the converted Java class instance.
|
(package private) static void |
registerObject(_BaseObject_ ref)
Register this instance as a local resource.
|
(package private) static void |
registerPending(java.lang.Object... objects)
When an INPUT object variable is initialized in the top-level block via
TypeFactory.object(java.lang.Class<V>),
it needs to be registered as 'pending'. |
(package private) static void |
reRegister(BaseDataType[] oldArray,
BaseDataType[] newArray)
When resizing an legacy object array with dynamic extent, we must re-register the array
reference.
|
static <T extends _BaseObject_> |
resolveClass(java.lang.String cname)
Resolve the associated converted class name for this legacy class.
|
static void |
setDynamicProperty(object<? extends _BaseObject_> ref,
character prop,
NumberType idx,
java.lang.Object val)
Implementation of the DYNAMIC-PROPERTY statement (setter).
|
static void |
setDynamicProperty(object<? extends _BaseObject_> ref,
character prop,
java.lang.Object val)
Implementation of the DYNAMIC-PROPERTY statement (setter).
|
static void |
setDynamicProperty(java.lang.String className,
character prop,
NumberType idx,
java.lang.Object val)
Implementation of the DYNAMIC-PROPERTY statement (setter).
|
static void |
setDynamicProperty(java.lang.String className,
character prop,
java.lang.Object val)
Implementation of the DYNAMIC-PROPERTY statement (setter).
|
static object<? extends _BaseObject_> |
thisObject()
Get the THIS-OBJECT system reference.
|
static logical |
typeOf(object<?> o,
java.lang.Class<?> cls)
Check if the given class is the same or a super-class of the given object.
|
static logical |
typeOf(object<?> o,
java.lang.String cls)
Check if the given class is the same or a super-class of the given object.
|
private static boolean |
validDynamicPropertyArgs(java.lang.Class<? extends _BaseObject_> cls,
character prop,
NumberType idx,
boolean setter)
Validate the property and index for a DYNAMIC-PROPERTY getter or setter.
|
private static boolean |
validDynamicPropertyArgs(object<? extends _BaseObject_> ref,
character prop,
NumberType idx,
boolean setter)
Validate the reference, property and index for a DYNAMIC-PROPERTY getter or setter.
|
private static boolean |
validDynamicPropertyArgs(java.lang.String className,
character prop,
NumberType idx,
boolean setter)
Validate the class name, property and index for a DYNAMIC-PROPERTY getter or setter.
|
private static final java.lang.String DE_SPEC
private static final java.util.Map<java.lang.Class<? extends _BaseObject_>,java.lang.String> legacyNames
private static final java.util.Map<java.lang.String,java.lang.Class<? extends _BaseObject_>> name2cls
private static final java.lang.Object lock
private static final ContextLocal<ObjectOps.WorkArea> local
public static ObjectOps.ObjectHelper getObjectHelper()
ObjectOps.ObjectHelper, which has the context-local instance saved, so API access can
be done without a context-local query.public static void setDynamicProperty(object<? extends _BaseObject_> ref, character prop, java.lang.Object val)
ref - The object reference to which the property belongs.prop - The legacy property name.val - The property value.public static void setDynamicProperty(object<? extends _BaseObject_> ref, character prop, NumberType idx, java.lang.Object val)
ref - The object reference to which the property belongs.prop - The legacy property name (an extent property).idx - The index in the extent property.val - The property value.public static void setDynamicProperty(java.lang.String className,
character prop,
java.lang.Object val)
className - The legacy class to which the property belongs.prop - The legacy property name.val - The property value.public static void setDynamicProperty(java.lang.String className,
character prop,
NumberType idx,
java.lang.Object val)
className - The legacy class to which the property belongs.prop - The legacy property name (an extent property).idx - The index in the extent property.val - The property value.public static BaseDataType getDynamicProperty(object<? extends _BaseObject_> ref, character prop)
ref - The object reference to which the property belongs.prop - The legacy property name.public static BaseDataType getDynamicProperty(object<? extends _BaseObject_> ref, character prop, NumberType idx)
ref - The object reference to which the property belongs.prop - The legacy property name (an extent property).idx - The index in the extent property.public static BaseDataType getDynamicProperty(java.lang.String className, character prop)
className - The legacy class to which the property belongs.prop - The legacy property name.public static BaseDataType getDynamicProperty(character className, character prop)
className - The legacy class to which the property belongs.prop - The legacy property name.public static BaseDataType getDynamicProperty(java.lang.String className, character prop, NumberType idx)
className - The legacy class to which the property belongs.prop - The legacy property name (an extent property).idx - The index in the extent property.public static <T extends _BaseObject_> object<T> polyObjectArg(java.lang.Class<T> type, java.lang.Object res)
invokePoly(java.lang.Class<T>, java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) or invokeStandalonePoly(java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) call; in
this case, the direct Java call must enforce the type at compile time, and the runtime will check if the
returned value is compatible with this type.T - The expected type of this call.type - The expected type of this call.res - The result to check.public static <T> T polyArg(java.lang.Class<T> type,
java.lang.Object res)
invokePoly(java.lang.Class<T>, java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) or invokeStandalonePoly(java.lang.Class<? extends com.goldencode.p2j.oo.lang._BaseObject_>, java.lang.String, java.lang.String, java.lang.Object...) call; in
this case, the direct Java call must enforce the type at compile time, and the runtime will check if the
returned value is compatible with this type.T - The expected type of this call.type - The expected type of this call.res - The result to check.public static <T extends _BaseObject_> object<T> invokePoly(java.lang.Class<T> retType, java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the return type, if is not compatible, FWD will raise a 'Caller compilation ... 12882' ERROR; this is earlier than OE does, but for chained calls, Java will abend if the correct type is not on stack when it tries to invoke the next method, so we need to enforce it early.
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
T - The expected return type.retType - The expected return type. The actual runtime returned type must be the same or a sub-class
of this type.targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.object instance with the specified type.public static BaseDataType invokePoly(java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.BaseDataType type, as this is not emitted as lvalue for chained OO calls.public static void invokeStandalonePoly(java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.public static <T extends _BaseObject_> object<T> invokePoly(java.lang.Class<T> retType, object<? extends _BaseObject_> ref, java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the return type, if is not compatible, FWD will raise a 'Caller compilation ... 12882' ERROR; this is earlier than OE does, but for chained calls, Java will abend if the correct type is not on stack when it tries to invoke the next method, so we need to enforce it early.
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
T - The expected return type.retType - The expected return type. The actual runtime returned type must be the same or a sub-class
of this type.ref - The reference on which the invocation will be performed.targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.object instance with the specified type.public static BaseDataType invokePoly(object<? extends _BaseObject_> ref, java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
ref - The reference on which the invocation will be performed.targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.BaseDataType type, as this is not emitted as lvalue for chained OO calls.public static void invokeStandalonePoly(object<? extends _BaseObject_> ref, java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
ref - The reference on which the invocation will be performed.targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.private static BaseDataType invokePolyWorker(boolean voidReturn, java.lang.Class<? extends _BaseObject_> retType, java.lang.Object referent, java.lang.Class<? extends _BaseObject_> targetType, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
For the return type, if is not compatible, FWD will raise a 'Caller compilation ... 12882' ERROR; this is earlier than OE does, but for chained calls, Java will abend if the correct type is not on stack when it tries to invoke the next method, so we need to enforce it early.
For the method lookup, it will be limited to the target type emitted during conversion, and not the runtime type.
voidReturn - Flag indicating if the method is expected to return a value or not.retType - When set, the expected return type. The actual runtime returned type must be the same or a
sub-class of this type.referent - The reference on which the invocation will be performed. This is either a sub-type of
_BaseObject_ (for static calls), or a _BaseObject_ instance, otherwise.targetType - The target type where the method lookup will be performed.mthdName - The target method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(java.lang.String clsName, java.lang.String mthdName)
clsName - The legacy class name.mthdName - The static method name.public static BaseDataType invoke(character clsName, java.lang.String mthdName)
clsName - The legacy class name.mthdName - The static method name.public static BaseDataType invoke(java.lang.String clsName, character mthdName)
clsName - The legacy class name.mthdName - The static method name.public static BaseDataType invoke(character clsName, character mthdName)
clsName - The legacy class name.mthdName - The static method name.public static BaseDataType invoke(character clsName, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(java.lang.String clsName, character mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(character clsName, character mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(java.lang.String clsName, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(object<? extends _BaseObject_> ref, character mthdName)
ref - The legacy object reference.mthdName - The method name.public static BaseDataType invoke(object<? extends _BaseObject_> ref, java.lang.String mthdName)
ref - The legacy object reference.mthdName - The method name.public static BaseDataType invoke(object<? extends _BaseObject_> ref, character mthdName, java.lang.String modes, java.lang.Object... args)
ref - The legacy object reference.mthdName - The static method name.modes - The argument modes.args - The arguments.public static BaseDataType invoke(object<? extends _BaseObject_> ref, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
ref - The legacy object reference.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(java.lang.String clsName,
java.lang.String mthdName)
clsName - The legacy class name.mthdName - The static method name.public static void invokeStandalone(character clsName, java.lang.String mthdName)
clsName - The legacy class name.mthdName - The static method name.public static void invokeStandalone(java.lang.String clsName,
character mthdName)
clsName - The legacy class name.mthdName - The static method name.public static void invokeStandalone(character clsName, character mthdName)
clsName - The legacy class name.mthdName - The static method name.public static void invokeStandalone(character clsName, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(java.lang.String clsName,
character mthdName,
java.lang.String modes,
java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(character clsName, character mthdName, java.lang.String modes, java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(java.lang.String clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(object<? extends _BaseObject_> ref, character mthdName)
ref - The legacy object reference.mthdName - The static method name.public static void invokeStandalone(object<? extends _BaseObject_> ref, java.lang.String mthdName)
ref - The legacy object reference.mthdName - The static method name.public static void invokeStandalone(object<? extends _BaseObject_> ref, character mthdName, java.lang.String modes, java.lang.Object... args)
ref - The legacy object reference.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void invokeStandalone(object<? extends _BaseObject_> ref, java.lang.String mthdName, java.lang.String modes, java.lang.Object... args)
ref - The legacy object reference.mthdName - The static method name.modes - The argument modes.args - The arguments.public static void delete(object<?> o)
o - The object to be deleted.public static <T extends _BaseObject_> object<T> newDynamicInstance(java.lang.String legacyClsName)
legacyClsName - The legacy class name. This may be qualified or unqualified.object instance.public static <T extends _BaseObject_> object<T> newDynamicInstance(java.lang.Class<T> cls, java.lang.String modes, java.lang.Object... args)
cls - The legacy class.modes - The argument's modes.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newDynamicInstance(java.lang.String legacyClsName, java.lang.String modes, java.lang.Object... args)
legacyClsName - The legacy class name. This may be qualified or unqualified.modes - The argument's modes.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newDynamicInstance(character legacyClsName)
legacyClsName - The legacy class name. This may be qualified or unqualified.object instance.public static <T extends _BaseObject_> object<T> newDynamicInstance(character legacyClsName, java.lang.String modes, java.lang.Object... args)
legacyClsName - The legacy class name. This may be qualified or unqualified.modes - The argument's modes.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newInstance(java.lang.Class<T> cls)
cls - The object's class.object instance.public static <T extends _BaseObject_> object<T> newInstance(java.lang.Class<T> cls, boolean bypassConstructor, java.lang.Object... args)
cls - The object's class.bypassConstructor - Avoid executing the constructor method during initialization if true.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newInstance(java.lang.Class<T> cls, java.lang.String modes, java.lang.Object... args)
cls - The object's class.modes - The argument modes.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newInstanceInternal(java.lang.Class<T> cls, java.lang.String name, java.lang.String modes, java.lang.Object... args)
cls - The object's class.name - The legacy class name. This may be qualified or unqualified.modes - The argument modes.args - The arguments.object instance.public static <T extends _BaseObject_> object<T> newInstanceInternal(java.lang.Class<T> cls, java.lang.String name, java.lang.String modes, boolean bypassConstructor, java.lang.Object... args)
cls - The object's class.name - The legacy class name. This may be qualified or unqualified.modes - The argument modes.bypassConstructor - Avoid executing the constructor method during initialization if true.args - The arguments.object instance.private static <T extends _BaseObject_> ObjectResource newInstanceInternal(ObjectOps.WorkArea wa, T ref, java.lang.Class<T> cls, java.lang.String name, java.lang.String modes, java.lang.Object... args)
wa - The context-local state.ref - The Java reference for this _BaseObject_ instance.cls - The object's class.name - The legacy class name. This may be qualified or unqualified.modes - The argument modes.args - The arguments.object instance.private static <T extends _BaseObject_> ObjectResource newInstanceInternal(ObjectOps.WorkArea wa, T ref, java.lang.Class<T> cls, java.lang.String name, java.lang.String modes, boolean bypassConstructor, java.lang.Object... args)
wa - The context-local state.ref - The Java reference for this _BaseObject_ instance.cls - The object's class.name - The legacy class name. This may be qualified or unqualified.modes - The argument modes.bypassConstructor - Avoid executing the constructor method during initialization if true.args - The arguments.object instance.public static logical typeOf(object<?> o, java.lang.Class<?> cls)
o - The object instance.cls - The type to check.true if the given class is the same or a super-class of the object's
type.public static logical typeOf(object<?> o, java.lang.String cls)
o - The object instance.cls - The type to check.true if the given class is the same or a super-class of the object's
type.public static <T extends _BaseObject_> object<T> cast(BaseDataType val, java.lang.Class<T> cls)
val - The object instance.cls - The type to check.object, then unknown
is returned.public static <T extends _BaseObject_> object<T> cast(object<?> o, java.lang.Class<T> cls)
o - The object instance.cls - The type to check.object instance, if the cast is possible.public static <T extends _BaseObject_> object<T>[] cast(object<?>[] o, java.lang.Class<T> cls)
o - The object array instance.cls - The type to check.object array instance, if the cast is possible.public static object<? extends LegacyEnum> dynamicEnum(java.lang.String cname, int64 value)
cname - The enum class name.value - The enum value.public static <T extends LegacyEnum> object<T> dynamicEnum(character cname, int64 value)
cname - The enum class name.value - The enum value.public static object<? extends LegacyEnum> dynamicEnum(java.lang.String cname, character name)
cname - The enum class name.name - The enum name.public static <T extends LegacyEnum> object<T> dynamicEnum(character cname, character name)
cname - The enum class name.name - The enum name.public static object<? extends LegacyEnum> dynamicEnum(java.lang.String cname, long value)
cname - The enum class name.value - The enum value.public static object<? extends LegacyEnum> dynamicEnum(character cname, long value)
cname - The enum class name.value - The enum value.public static object<? extends LegacyEnum> dynamicEnum(java.lang.String cname, java.lang.String name)
cname - The enum class name.name - The enum name.public static object<? extends LegacyEnum> dynamicEnum(character cname, java.lang.String name)
cname - The enum class name.name - The enum name.public static object<? extends _BaseObject_> dynamicCast(object<?> o, java.lang.String legacyClsName)
o - The object instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object instance, if the cast is possible.public static object<? extends _BaseObject_> dynamicCast(object<?> o, character legacyClsName)
o - The object instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object instance, if the cast is possible.public static object<? extends _BaseObject_> dynamicCast(BaseDataType o, java.lang.String legacyClsName)
o - The object instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object instance, if the cast is possible.public static object<? extends _BaseObject_> dynamicCast(BaseDataType o, character legacyClsName)
o - The object instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object instance, if the cast is possible.public static object<? extends _BaseObject_>[] dynamicCast(object<?>[] o, character legacyClsName)
o - The object array instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object array instance, if the cast is possible.public static object<? extends _BaseObject_>[] dynamicCast(object<?>[] o, java.lang.String legacyClsName)
o - The object array instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object array instance, if the cast is possible.public static object<? extends _BaseObject_>[] dynamicCast(BaseDataType[] o, character legacyClsName)
o - The object array instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object array instance, if the cast is possible.public static object<? extends _BaseObject_>[] dynamicCast(BaseDataType[] o, java.lang.String legacyClsName)
o - The object array instance.legacyClsName - The legacy class name. This may be qualified or unqualified.object array instance, if the cast is possible.public static object<? extends _BaseObject_> thisObject()
public static boolean isValid(_BaseObject_ ref)
ref - The legacy object.true if this object is valid.public static boolean isSerializable(_BaseObject_ ref)
ref - The instance to check.public static ObjectResource asResource(_BaseObject_ ref)
ref - The legacy object.public static ObjectResource asResource(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The ObjectOps.WorkArea instance.ref - The legacy object.public static void load(java.lang.Class<? extends _BaseObject_> cls)
cls - The class to initialize.public static void increment(_BaseObject_ ref)
ref - The legacy instance.public static void increment(object<? extends _BaseObject_> obj)
obj - The legacy object instance.public static void decrement(_BaseObject_ ref)
ref - The legacy instance.public static void decrement(object<? extends _BaseObject_> obj)
obj - The legacy object instance.public static void decrement(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The context-local state.ref - The legacy instance.static void increment(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The context-local state.ref - The legacy instance.static void registerObject(_BaseObject_ ref)
ref - The instance to register.static void registerPending(java.lang.Object... objects)
TypeFactory.object(java.lang.Class<V>),
it needs to be registered as 'pending'. This will defer its registration with the
ObjectOps.WorkArea.definitions until the top-level block starts.objects - The list of object definitions.static void pendingAssign(_BaseObject_ ref)
ref - The legacy instance.static void pendingAssign(ObjectOps.WorkArea wa, _BaseObject_ ref, boolean register)
wa - The ObjectOps.WorkArea instance.ref - The legacy instance.register - Flag indicating if the scopeable support must be registered.private static void pendingInitialize(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The ObjectOps.WorkArea instance.ref - The legacy instance.static void endInitialization(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The ObjectOps.WorkArea instance.ref - The legacy instance.static boolean isInitializing(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The ObjectOps.WorkArea instance.ref - The legacy instance.static boolean isLegacyObject(java.lang.Object ref)
ref - The legacy object.static boolean delete(_BaseObject_ ref)
ref - The object to be deleted.true if the delete was possible (the instance is not on stack).static boolean delete(ObjectOps.WorkArea wa, _BaseObject_ ref)
wa - The context-local state.ref - The object to be deleted.true if the delete was possible (the instance is not on stack).public static boolean hasDestructors(_BaseObject_ ref)
ref - The reference to the object to be tested.true if when the object is deleted at least one destructor will be
executed.static void reRegister(BaseDataType[] oldArray, BaseDataType[] newArray)
oldArray - The old array.newArray - The new array.public static object<? extends LegacyClass> getLegacyClass(java.lang.Class<? extends _BaseObject_> cls)
LegacyClass mapped in FWD by the specified converted class.cls - The converted class.LegacyClass instance.public static object<? extends LegacyClass> getLegacyClass(java.lang.String typeName)
LegacyClass mapped in FWD by the specified converted class name.typeName - The converted class name.LegacyClass instance.public static object<? extends LegacyClass> getLegacyClass(character cls)
LegacyClass mapped in FWD by the specified converted class name.cls - The converted class name.LegacyClass instance.public static java.lang.String getLegacyName(java.lang.Class<? extends _BaseObject_> cls)
cls - The class.public static java.lang.Object getStaticInstance(java.lang.Class<? extends _BaseObject_> cls)
cls - The legacy class.public static java.lang.Class<? extends _BaseObject_> getStaticClass(java.lang.Object instance)
instance - The pseudo-instance for a static class.static void defaultStaticConstructor(java.lang.Class<?> cls)
cls - The legacy class for which the constructor will be executed.static boolean loadClass(ObjectOps.WorkArea wa, java.lang.Class<? extends _BaseObject_> cls)
wa - The context-local state.cls - The class to initialize.true if the initialization completed.private static boolean loadClassInt(ObjectOps.WorkArea wa, java.lang.Class<? extends _BaseObject_> cls)
wa - The context-local state.cls - The class to initialize.true if the initialization completed.public static <T extends _BaseObject_> java.lang.Class<T> resolveClass(java.lang.String cname)
cname - The fully qualified legacy class name.Class or null if it can't be found.public static void registerClass(java.lang.String cname,
java.lang.Class<? extends _BaseObject_> cls)
cname - The fully qualified legacy class name.cls - The converted type.public static void registerClass(java.lang.Class<? extends _BaseObject_> cls, boolean hierarchy)
cls - The converted type.hierarchy - Flag to load the complete class hierarchypublic static java.lang.Class<? extends _BaseObject_> getAssignableClass(java.lang.String superName, java.lang.Class<? extends _BaseObject_> cls)
LegacyClass of super class or interface of the class, register it as needed.superName - name of assignable super class or interfacecls - The converted type.public static LegacyClass getClassInstance(java.lang.Class<? extends _BaseObject_> cls)
LegacyClass instance for the given type.cls - The converted type.private static void executeStaticConstructor(java.lang.Class<? extends _BaseObject_> cls)
cls - The class to check.private static java.lang.Class<? extends _BaseObject_> lookupClassWorker(java.lang.String cname)
cname - The fully qualified legacy class name.private static void registerClassWorker(java.lang.String cname,
java.lang.Class<? extends _BaseObject_> cls)
cname - The fully qualified legacy class name.cls - The converted type.private static java.lang.String legacyNameWorker(java.lang.Class<? extends _BaseObject_> cls)
cls - The class.private static java.lang.Object invoke(boolean voidReturn,
java.lang.String clsName,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
voidReturn - Flag indicating that the method can return void.clsName - The legacy class name.mthdName - The static method name.modes - The argument modes.args - The arguments.private static java.lang.Object invoke(boolean voidReturn,
object<? extends _BaseObject_> ref,
java.lang.String mthdName,
java.lang.String modes,
java.lang.Object... args)
voidReturn - Flag indicating that the method can return void.ref - The legacy object reference.mthdName - The static method name.modes - The argument modes.args - The arguments.private static void generateInvalidTypeDE()
private static void generateInvalidValueDE(java.lang.Class<?> cls)
cls - The enum for which the value is invalid.private static boolean validDynamicPropertyArgs(object<? extends _BaseObject_> ref, character prop, NumberType idx, boolean setter)
ref - The reference to validate against.prop - The property name.idx - The index, non-null only for indexed DYNAMIC-PROPERTY cases.setter - Flag indicating if this is a setter or getter call.true if the arguments are valid.private static boolean validDynamicPropertyArgs(java.lang.String className,
character prop,
NumberType idx,
boolean setter)
className - The class where the property belongs.prop - The property name.idx - The index, non-null only for indexed DYNAMIC-PROPERTY cases.setter - Flag indicating if this is a setter or getter call.true if the arguments are valid.private static boolean validDynamicPropertyArgs(java.lang.Class<? extends _BaseObject_> cls, character prop, NumberType idx, boolean setter)
cls - The class where the property belongs.prop - The property name.idx - The index, non-null only for indexed DYNAMIC-PROPERTY cases.setter - Flag indicating if this is a setter or getter call.true if the arguments are valid.