public class LegacyClass extends BaseObject
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<? extends _BaseObject_> |
cls
The converted Java class.
|
private java.lang.Boolean |
hasStatics
Flag (when resolved) indicating if this or any super-class has static members or methods.
|
private static CentralLogger |
LOG
Logger
|
private java.lang.String |
typeName
The legacy class name.
|
| Constructor and Description |
|---|
LegacyClass(java.lang.String typeName,
java.lang.Class<? extends _BaseObject_> cls)
Create a new legacy class object.
|
| Modifier and Type | Method and Description |
|---|---|
private java.util.List<java.lang.reflect.Method> |
_getMethods(Flags flags,
java.lang.Class<?> clazz)
Get the list of 4gl methods(annotated) filtered as per given flags.
|
boolean |
_isA(object<? extends LegacyClass> ref) |
object<? extends LegacyConstructor> |
getConstructor(object<? extends Flags> _flags,
object<? extends ParameterList> _parms) |
object<? extends LegacyConstructor> |
getConstructor(object<? extends ParameterList> _parms) |
object<? extends LegacyConstructor>[] |
getConstructors() |
object<? extends LegacyConstructor>[] |
getConstructors(object<? extends Flags> _flags) |
character |
getEnumName(int64 value)
Obtain the name of the enum(s) specified by this value.
|
character |
getEnumName(long value)
Obtain the name of the enum(s) specified by this value.
|
character |
getEnumNames()
Returns a comma-separated text list of the names of all predefined enums in this legacy class, in
the order of their values.
|
int64 |
getEnumValue(character name)
Obtain the value of the named enum.
|
int64 |
getEnumValue(java.lang.String name)
Obtain the value of the named enum.
|
character |
getEnumValues()
Returns a comma-separated text list of the values of all predefined enums in this legacy class, in
the order of their values.
|
object<? extends Event> |
getEvent(character _name) |
object<? extends Event> |
getEvent(character _name,
object<? extends Flags> _flags) |
object<? extends Event>[] |
getEvents() |
object<? extends Event>[] |
getEvents(object<? extends Flags> _flags) |
private InternalEntry |
getGetterInternalEntry(object<? extends _BaseObject_> instance,
character propName,
java.lang.Object idx)
Helper function that gets the internal entry which contains the GET method for a given
property name of a class instance.
|
object<? extends LegacyClass>[] |
getInterfaces()
Resolve the interfaces implemented by this class or any super class or super-interface.
|
java.lang.Class<? extends _BaseObject_> |
getJavaClass() |
static object<LegacyClass> |
getLegacyClass(character typeName)
Resolve the legacy class from the given name.
|
static object<? extends LegacyClass> |
getLegacyClass(object<? extends _BaseObject_> obj) |
static object<LegacyClass> |
getLegacyClass(java.lang.String typeName)
Resolve the legacy class from the given name.
|
object<? extends Legacy4GLMethod> |
getMethod(character _methodName,
object<? extends Flags> _flags,
object<? extends ParameterList> _params) |
object<? extends Legacy4GLMethod> |
getMethod(character _methodName,
object<? extends ParameterList> _parms) |
object<? extends Legacy4GLMethod>[] |
getMethods() |
object<? extends Legacy4GLMethod>[] |
getMethods(object<? extends Flags> flags) |
character |
getPackage()
Obtains the package name of the object.
|
object<? extends Property>[] |
getProperties() |
object<? extends Property>[] |
getProperties(object<? extends Flags> _flags) |
object<? extends Property> |
getProperty(character _name) |
object<? extends Property> |
getProperty(character _name,
object<? extends Flags> _flags) |
BaseDataType |
getPropertyValue(character propName)
Resolve the static property with the given name.
|
BaseDataType |
getPropertyValue(character propName,
java.lang.Object idx)
Resolve the static array property value, with the given index and name.
|
BaseDataType |
getPropertyValue(object<? extends _BaseObject_> instance,
character propName)
Resolve the instance property value, with the given name.
|
BaseDataType |
getPropertyValue(object<? extends _BaseObject_> instance,
character propName,
java.lang.Object idx)
Resolve the instance array property value, with the given index and name.
|
private BaseDataType |
getPropertyValueImpl(object<? extends _BaseObject_> instance,
character propName,
java.lang.Object idx)
Helper function used to handle GetPropertyValue, which returns a class property
based on the property's name.
|
object<LegacyClass> |
getSuperClass()
Obtains the parent class of the object.
|
java.lang.Class<? extends _BaseObject_> |
getType()
Get the converted
type. |
character |
getTypeName()
Obtains the fully qualified name (package and class) of the object.
|
object<? extends Variable> |
getVariable(character _name) |
object<? extends Variable> |
getVariable(character _name,
object<? extends Flags> _flags) |
object<? extends Variable>[] |
getVariables() |
object<? extends Variable>[] |
getVariables(object<? extends Flags> _flags) |
logical |
hasStatics()
Check if this or any of the super-classes has static members.
|
private boolean |
hasStaticsInt()
Check if this type has any static members or methods.
|
logical |
hasWidgetPool()
Check if this class has a USE-WIDGET-POOL option.
|
BaseDataType |
invoke(character method)
Invoke the specified static method in this class.
|
BaseDataType |
invoke(character method,
object<? extends ParameterList> parms)
Invoke the specified static method in this class.
|
BaseDataType |
invoke(object<? extends _BaseObject_> ref,
character method)
Invoke the specified instance method in the specified object.
|
BaseDataType |
invoke(object<? extends _BaseObject_> ref,
character method,
object<? extends ParameterList> parms)
Invoke the specified instance method in the specified object.
|
static void |
invokeImpl(ParameterList opl,
java.lang.Runnable task)
Perform the actual invocation.
|
void |
invokeStandalone(character method)
Invoke the specified static method in this class.
|
void |
invokeStandalone(character method,
object<? extends ParameterList> parms)
Invoke the specified static method in this class.
|
void |
invokeStandalone(object<? extends _BaseObject_> ref,
character method)
Invoke the specified instance method in the specified object.
|
void |
invokeStandalone(object<? extends _BaseObject_> ref,
character method,
object<? extends ParameterList> parms)
Invoke the specified instance method in the specified object.
|
logical |
isA(character type)
Check if this type is the same as or a sub-class of the given type.
|
logical |
isA(object<? extends LegacyClass> ref)
Check if this type is the same as or a sub-class of the given type.
|
boolean |
isA(java.lang.String type) |
logical |
isAbstract()
Check if this is an abstract class.
|
logical |
isEnum()
Report if this class is a subclass of
LegacyEnum. |
logical |
isFinal()
Check if this is a final class.
|
logical |
isFlagsEnum()
Report if this class is a subclass of
FlagsEnum. |
logical |
isGeneric() |
logical |
isIndexed() |
logical |
isInterface()
Check if this is an interface.
|
logical |
isSerializable() |
private boolean |
isValidEnum()
Check if the class of this instance is an enum and raise an error 18110 if the class is not an enum.
|
logical |
legacyEquals(object<? extends _BaseObject_> other)
Check if this reference matches the given one.
|
object<? extends _BaseObject_> |
new_()
Create a new instance from this class, using the implicit constructor.
|
object<? extends _BaseObject_> |
new_(object<? extends ParameterList> parms)
Create a new instance from this class, using the specified constructor.
|
void |
setPropertyValue(character _pname,
integer _index,
java.lang.Object _value) |
void |
setPropertyValue(character _pname,
java.lang.Object _value) |
void |
setPropertyValue(object<? extends _BaseObject_> _objRef,
character _pname,
integer _index,
java.lang.Object _value) |
void |
setPropertyValue(object<? extends _BaseObject_> _objRef,
character _pname,
java.lang.Object _value) |
__isValidInternal__, __lang_BaseObject_constructor__, __setValidInternal__, assertNotNull, assertNotNull, getLegacyClass, getNextSibling, getPrevSibling, legacyClone, toLegacyStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisTrackedprivate final java.lang.String typeName
private final java.lang.Class<? extends _BaseObject_> cls
private java.lang.Boolean hasStatics
private static final CentralLogger LOG
public LegacyClass(java.lang.String typeName,
java.lang.Class<? extends _BaseObject_> cls)
typeName - The qualified legacy class name.cls - The converted type.public BaseDataType getPropertyValue(character propName)
propName - The property name.public BaseDataType getPropertyValue(character propName, java.lang.Object idx)
propName - The property name.idx - The index.public BaseDataType getPropertyValue(object<? extends _BaseObject_> instance, character propName)
instance - The instance.propName - The property name.public BaseDataType getPropertyValue(object<? extends _BaseObject_> instance, character propName, java.lang.Object idx)
instance - The instance.propName - The property name.idx - The index.public static object<LegacyClass> getLegacyClass(character typeName)
typeName - The qualified legacy class name.public static object<? extends LegacyClass> getLegacyClass(object<? extends _BaseObject_> obj)
public static object<LegacyClass> getLegacyClass(java.lang.String typeName)
typeName - The qualified legacy class name.public character getPackage()
public object<LegacyClass> getSuperClass()
public character getTypeName()
public character getEnumNames()
ErrorConditionException - When called for a class that is not a subclass of LegacyEnum or FlagsEnum.public character getEnumValues()
ErrorConditionException - When called for a class that is not a subclass of LegacyEnum or FlagsEnum.public int64 getEnumValue(character name)
name - The enum name to lookup.ErrorConditionException - If the given name is unknown value.public int64 getEnumValue(java.lang.String name)
name - The enum name to lookup.ErrorConditionException - If the given name is unknown value.public character getEnumName(int64 value)
isFlagSet). If there is no exact
match or for flag enums there is no single enum that is a subset, then unknown value is returned.
If multiple enums match (flag enums case), then each of the names will be returned in a comma-separated list.
value - The enum value to lookup.ErrorConditionException - If the given input value is the unknown value.public character getEnumName(long value)
isFlagSet). If there is no exact
match or for flag enums there is no single enum that is a subset, then unknown value is returned.
If multiple enums match (flag enums case), then each of the names will be returned in a comma-separated list.
value - The enum value to lookup.ErrorConditionException - If the given input value is the unknown value.public logical isEnum()
LegacyEnum.true if this is a subclass of LegacyEnum.public logical isFlagsEnum()
FlagsEnum.true if this is a subclass of FlagsEnum.public java.lang.Class<? extends _BaseObject_> getType()
type.public logical isInterface()
public logical isFinal()
public logical isGeneric()
public logical isIndexed()
public logical isSerializable()
public logical isAbstract()
public logical hasStatics()
public logical hasWidgetPool()
public logical isA(character type)
type - The type to check.public boolean isA(java.lang.String type)
public logical isA(object<? extends LegacyClass> ref)
ref - The type to check.public boolean _isA(object<? extends LegacyClass> ref)
public object<? extends _BaseObject_> new_()
public object<? extends _BaseObject_> new_(object<? extends ParameterList> parms)
public void invokeStandalone(character method)
method - The static method name.public void invokeStandalone(character method, object<? extends ParameterList> parms)
method - The static method name.parms - The parameter list.public BaseDataType invoke(character method)
method - The static method name.public void invokeStandalone(object<? extends _BaseObject_> ref, character method)
ref - The legacy object reference.method - The method name.public void invokeStandalone(object<? extends _BaseObject_> ref, character method, object<? extends ParameterList> parms)
ref - The legacy object reference.method - The method name.parms - The parameter list.public BaseDataType invoke(character method, object<? extends ParameterList> parms)
method - The static method name.parms - The parameter list.public BaseDataType invoke(object<? extends _BaseObject_> ref, character method)
ref - The legacy object reference.method - The method name.public BaseDataType invoke(object<? extends _BaseObject_> ref, character method, object<? extends ParameterList> parms)
ref - The legacy object reference.method - The method name.parms - The parameter list.public static void invokeImpl(ParameterList opl, java.lang.Runnable task)
new_().opl - The ParameterList reference.task - The task to execute, to perform the actual invoke.private boolean hasStaticsInt()
private boolean isValidEnum()
true if this is a valid enum class.ErrorConditionException - When called for a class that is not a subclass of LegacyEnum or FlagsEnum.public logical legacyEquals(object<? extends _BaseObject_> other)
BaseObjectlegacyEquals in interface _BaseObject_legacyEquals in class BaseObjectother - The other reference.true if the other reference is not unknown value and if the reference
is the same as this object's reference.public object<? extends LegacyConstructor> getConstructor(object<? extends ParameterList> _parms)
public object<? extends LegacyConstructor> getConstructor(object<? extends Flags> _flags, object<? extends ParameterList> _parms)
public object<? extends LegacyConstructor>[] getConstructors()
public object<? extends LegacyConstructor>[] getConstructors(object<? extends Flags> _flags)
public object<? extends LegacyClass>[] getInterfaces()
LegacyClass instances for each interface of this class.public object<? extends Legacy4GLMethod> getMethod(character _methodName, object<? extends ParameterList> _parms)
public object<? extends Legacy4GLMethod> getMethod(character _methodName, object<? extends Flags> _flags, object<? extends ParameterList> _params)
public object<? extends Legacy4GLMethod>[] getMethods()
public object<? extends Legacy4GLMethod>[] getMethods(object<? extends Flags> flags)
public object<? extends Property> getProperty(character _name, object<? extends Flags> _flags)
public object<? extends Variable> getVariable(character _name, object<? extends Flags> _flags)
public void setPropertyValue(character _pname, java.lang.Object _value)
public void setPropertyValue(character _pname, integer _index, java.lang.Object _value)
public void setPropertyValue(object<? extends _BaseObject_> _objRef, character _pname, java.lang.Object _value)
public void setPropertyValue(object<? extends _BaseObject_> _objRef, character _pname, integer _index, java.lang.Object _value)
public java.lang.Class<? extends _BaseObject_> getJavaClass()
private java.util.List<java.lang.reflect.Method> _getMethods(Flags flags, java.lang.Class<?> clazz)
flags - The flags enum to filter the returned methods.clazz - The Java class to collect methods from.private InternalEntry getGetterInternalEntry(object<? extends _BaseObject_> instance, character propName, java.lang.Object idx)
instance - The instance.propName - The property name.idx - The index.private BaseDataType getPropertyValueImpl(object<? extends _BaseObject_> instance, character propName, java.lang.Object idx)
instance - The instance. It is passed as null when called by the static GetPropertyValue overloads.propName - The name of the property.idx - The index parameter. It is always null when called with the non indexed overload of
GetPropertyValue.