Package org.qdl_lang.extensions
Interface QDLMetaModule
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
Crypto
,DynamoDB
,HTTPClient
,QDLCLITools
,QDLConvert
,QDLDB
,QDLMail
,StatefulExample
public interface QDLMetaModule extends Serializable
One way to make a Java module is to have a super class and have each method or variable defined as non-static inner classes. These then can share state between them. This interface should be implemented for those classes in order to ensure compatibility with the system. It has no methods and is a marker interface.A typical basic
Let us say you wrote a module that has read a configuration file and named configuration. Stash those in a JSON object, along with any other state you need to reconstruct, which will be returned inserializeToJSON()
and when the module is deserialized, these values can be reset fromdeserializeFromJSON(JSONObject)
. Then you can have a flag that checks if the configuration is active and if not, re-read the configuration. This allows you to seamlessly have your classes be saved by the system.Created by Jeff Gaynor
on 10/4/21 at 6:58 AM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deserializeFromJSON(net.sf.json.JSONObject json)
net.sf.json.JSONObject
serializeToJSON()
Send back a serialization of internal state for this object.
-
-
-
Method Detail
-
serializeToJSON
net.sf.json.JSONObject serializeToJSON()
Send back a serialization of internal state for this object. This allows for the state you choose to be serialized and then reloaded.NOTE
There is no canonical form for this. Set it how you will and deserialize it accordingly.- Returns:
-
deserializeFromJSON
void deserializeFromJSON(net.sf.json.JSONObject json)
-
-