Package org.qdl_lang.module
Class QDLModule
- java.lang.Object
-
- org.qdl_lang.module.Module
-
- org.qdl_lang.module.QDLModule
-
- All Implemented Interfaces:
Serializable
,Cloneable
,XThing
public class QDLModule extends Module
Created by Jeff Gaynor
on 4/1/20 at 11:30 AM- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.qdl_lang.module.Module
FDOC_CONVERT
-
-
Constructor Summary
Constructors Constructor Description QDLModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deserializeFromJSON(net.sf.json.JSONObject json, SerializationState serializationState)
Deserializes a JSON object into the current module.List<String>
getDocumentation()
String
getFilePath()
List<String>
getListByTag()
Documentation resides in the module definition, so it is loaded here at parse time.ModuleStatement
getModuleStatement()
List<String>
getSource()
Module
newInstance(State state)
Modules are effectively templates.void
readExtraXMLElements(XMLEvent xe, XMLEventReader xer)
This passes in the current start event so you can add your own event loop and cases.net.sf.json.JSONObject
serializeToJSON(SerializationState serializationState)
The result of this is a json objectvoid
setDocumentation(List<String> documentation)
void
setFilePath(String filePath)
void
setModuleStatement(ModuleStatement moduleStatement)
void
writeExtraXMLElements(XMLStreamWriter xsw)
Write extra elements.-
Methods inherited from class org.qdl_lang.module.Module
fromJSON, fromXML, fromXML, getAlias, getId, getInheritMode, getKey, getListByTag, getMTKey, getName, getNamespace, getParentInstanceAlias, getParentInstanceID, getParentTemplateID, getState, isExternal, isTemplate, isUsed, readExtraXMLAttributes, setAlias, setId, setInheritanceMode, setNamespace, setParentInstanceAlias, setParentInstanceID, setParentTemplateID, setState, setTemplate, setupModule, setUsed, toJSON, toString, toXML, toXML, toXML2, writeExtraXMLAttributes
-
-
-
-
Method Detail
-
getFilePath
public String getFilePath()
-
setFilePath
public void setFilePath(String filePath)
-
getModuleStatement
public ModuleStatement getModuleStatement()
-
setModuleStatement
public void setModuleStatement(ModuleStatement moduleStatement)
-
newInstance
public Module newInstance(State state)
Description copied from class:Module
Modules are effectively templates. This passes in the state of the parser at the point a new module is required and the contract is to create a new instance of this module with the state. Note that the state passed in may have nothing to do with the state here. You are creating a new module for the given state using this as a template.
All implementations should gracefully handle a null state with the assumption that the full state will be set later. This is because of bootstrapping networks of modules during deserialization.- Specified by:
newInstance
in classModule
- Returns:
-
writeExtraXMLElements
public void writeExtraXMLElements(XMLStreamWriter xsw) throws XMLStreamException
Description copied from class:Module
Write extra elements. You must control for the opening and closing tags. These are inserted right after the state element.- Overrides:
writeExtraXMLElements
in classModule
- Throws:
XMLStreamException
-
serializeToJSON
public net.sf.json.JSONObject serializeToJSON(SerializationState serializationState) throws Throwable
Description copied from class:Module
The result of this is a json object- Overrides:
serializeToJSON
in classModule
- Returns:
- Throws:
Throwable
-
deserializeFromJSON
public void deserializeFromJSON(net.sf.json.JSONObject json, SerializationState serializationState) throws Throwable
Description copied from class:Module
Deserializes a JSON object into the current module. You must check the type in the json object o know which class (e.g.,JavaModule
to instantiate first.- Overrides:
deserializeFromJSON
in classModule
- Throws:
Throwable
-
readExtraXMLElements
public void readExtraXMLElements(XMLEvent xe, XMLEventReader xer) throws XMLStreamException
Description copied from class:Module
This passes in the current start event so you can add your own event loop and cases. Note you need have only a switch on the tag names you want.- Overrides:
readExtraXMLElements
in classModule
- Throws:
XMLStreamException
-
getListByTag
public List<String> getListByTag()
Documentation resides in the module definition, so it is loaded here at parse time.- Specified by:
getListByTag
in classModule
- Returns:
-
setDocumentation
public void setDocumentation(List<String> documentation)
- Specified by:
setDocumentation
in classModule
-
getDocumentation
public List<String> getDocumentation()
- Specified by:
getDocumentation
in classModule
-
-