Package org.qdl_lang.module
Class QDLModule
- java.lang.Object
-
- org.qdl_lang.expressions.module.Module
-
- org.qdl_lang.expressions.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 List<String>createDefaultDocs()voiddeserializeFromJSON(net.sf.json.JSONObject json, SerializationState serializationState)Deserializes a JSON object into the current module.List<String>getDocumentation()StringgetFilePath()List<String>getListByTag()Documentation resides in the module definition, so it is loaded here at parse time.ModuleStatementgetModuleStatement()List<String>getSource()ModulenewInstance(State state)Modules are effectively templates.voidreadExtraXMLElements(XMLEvent xe, XMLEventReader xer)This passes in the current start event so you can add your own event loop and cases.net.sf.json.JSONObjectserializeToJSON(SerializationState serializationState)The result of this is a json objectvoidsetDocumentation(List<String> documentation)voidsetFilePath(String filePath)voidsetModuleStatement(ModuleStatement moduleStatement)voidwriteExtraXMLElements(XMLStreamWriter xsw)Write extra elements.-
Methods inherited from class org.qdl_lang.module.Module
fromJSON, fromXML, fromXML, getAlias, getDescription, getId, getInheritMode, getKey, getListByTag, getMTKey, getName, getNamespace, getParentInstanceAlias, getParentInstanceID, getParentTemplateID, getState, isExternal, isTemplate, isUsed, readExtraXMLAttributes, setAlias, setDescription, 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:ModuleModules 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:
newInstancein classModule- Returns:
-
writeExtraXMLElements
public void writeExtraXMLElements(XMLStreamWriter xsw) throws XMLStreamException
Description copied from class:ModuleWrite extra elements. You must control for the opening and closing tags. These are inserted right after the state element.- Overrides:
writeExtraXMLElementsin classModule- Throws:
XMLStreamException
-
serializeToJSON
public net.sf.json.JSONObject serializeToJSON(SerializationState serializationState) throws Throwable
Description copied from class:ModuleThe result of this is a json object- Overrides:
serializeToJSONin classModule- Returns:
- Throws:
Throwable
-
deserializeFromJSON
public void deserializeFromJSON(net.sf.json.JSONObject json, SerializationState serializationState) throws ThrowableDescription copied from class:ModuleDeserializes a JSON object into the current module. You must check the type in the json object o know which class (e.g.,JavaModuleto instantiate first.- Overrides:
deserializeFromJSONin classModule- Throws:
Throwable
-
readExtraXMLElements
public void readExtraXMLElements(XMLEvent xe, XMLEventReader xer) throws XMLStreamException
Description copied from class:ModuleThis 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:
readExtraXMLElementsin classModule- Throws:
XMLStreamException
-
getListByTag
public List<String> getListByTag()
Documentation resides in the module definition, so it is loaded here at parse time.- Specified by:
getListByTagin classModule- Returns:
-
setDocumentation
public void setDocumentation(List<String> documentation)
- Specified by:
setDocumentationin classModule
-
getDocumentation
public List<String> getDocumentation()
- Specified by:
getDocumentationin classModule
-
createDefaultDocs
public List<String> createDefaultDocs()
- Specified by:
createDefaultDocsin classModule
-
-