How to get attribute names and values available within Java (extension)

How to get attribute names and values available within Java (extension)

  
I made an extension having the object-type set as input parameter. In outsystems I used the ToObject() function to cast a record (with several attrbutes) as an object into the extension. Then I retrieved the name of the imported class and used Java-reflection classes to specifically read the available methods (29) and fields (1) of this class. Unfortunately there doesn't seem to be an appropriate class-method to retrieve either the attribute names or -values from the imported object. Is there any (other) way to retrieve the information I'm looking for?

Java-extension reflection output result:
CLASS: class osarvale.records.RCTestRecord
METHOD: public static void osarvale.records.RCTestRecord.ensureInitialized()
METHOD: public osarvale.entities.ENTestEntityRecord osarvale.records.RCTestRecord.toStructure()
METHOD: public void osarvale.records.RCTestRecord.setChangedAttributes(java.util.BitSet)
METHOD: public java.util.BitSet osarvale.records.RCTestRecord.getChangedAttributes()
METHOD: public java.util.BitSet[] osarvale.records.RCTestRecord.getDefaultOptimizedValues()
METHOD: public void osarvale.records.RCTestRecord.setAllOptimizedAttributes(java.util.BitSet[])
METHOD: public java.util.BitSet[] osarvale.records.RCTestRecord.getAllOptimizedAttributes()
METHOD: public boolean osarvale.records.RCTestRecord.equals(osarvale.records.RCTestRecord)
METHOD: public boolean osarvale.records.RCTestRecord.equals(java.lang.Object)
METHOD: public int osarvale.records.RCTestRecord.hashCode()
METHOD: public void osarvale.records.RCTestRecord.readDB(outsystems.hubedition.util.OSResultSet)
METHOD: public void osarvale.records.RCTestRecord.readIM(osarvale.records.RCTestRecord) throws java.lang.Exception
METHOD: public void osarvale.records.RCTestRecord.recursiveReset() throws java.lang.Exception
METHOD: public void osarvale.records.RCTestRecord.internalRecursiveSave() throws java.lang.Exception
METHOD: public boolean osarvale.records.RCTestRecord.changedAttributeGet(outsystems.objectkeys.GlobalObjectKey) throws java.lang.Exception
METHOD: public boolean osarvale.records.RCTestRecord.optimizedAttributeGet(outsystems.objectkeys.GlobalObjectKey) throws java.lang.Exception
METHOD: public outsystems.hubedition.runtimeplatform.db.IRecord osarvale.records.RCTestRecord.duplicate() throws java.lang.Exception
METHOD: public void osarvale.records.RCTestRecord.toXml(java.lang.Object,org.w3c.dom.Element,java.lang.String,int)
METHOD: public void osarvale.records.RCTestRecord.evaluateFields(outsystems.hubedition.runtimeplatform.VarValue,java.lang.Object,java.lang.String,java.lang.String) throws java.lang.reflect.InvocationTargetException,java.lang.IllegalAccessException,java.lang.IllegalArgumentException
METHOD: public java.lang.Object osarvale.records.RCTestRecord.clone() throws java.lang.CloneNotSupportedException
METHOD: public outsystems.hubedition.runtimeplatform.ISimpleRecord osarvale.records.RCTestRecord.elementGet(outsystems.objectkeys.GlobalObjectKey,int) throws java.lang.Exception
METHOD: public void osarvale.records.RCTestRecord.fillFromOther(outsystems.hubedition.runtimeplatform.db.IRecord) throws java.lang.Exception
METHOD: public final native java.lang.Class java.lang.Object.getClass()
METHOD: public java.lang.String java.lang.Object.toString()
METHOD: public final native void java.lang.Object.notify()
METHOD: public final native void java.lang.Object.notifyAll()
METHOD: public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
METHOD: public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
METHOD: public final void java.lang.Object.wait() throws java.lang.InterruptedException
FIELD: public osarvale.entities.ENTestEntityRecord osarvale.records.RCTestRecord.ssENTest
FIELDTYPENAME: osarvale.entities.ENTestEntityRecord /NROFTYPEPARAMS: 0 /NROFCLSSS: 0
Hello Bas,

What are you trying to do in your extension? Perhaps there is a better approach than reflecting object parameters.

Best regards,
Ricardo Silva