Class JavaModule

    • Constructor Detail

      • JavaModule

        public JavaModule()
        Used by QDLLoader
      • JavaModule

        public JavaModule​(URI uri)
      • JavaModule

        protected JavaModule​(URI namespace,
                             String alias)
        Deprecated.
        alias is no longer needed. Just use the namespace only constructor
        Used by the factory method Module.newInstance(State)
        Parameters:
        namespace -
        alias -
    • Method Detail

      • isExternal

        public boolean isExternal()
        Description copied from class: Module
        This returns true only if the module is from another language than a QDL module.
        Overrides:
        isExternal in class Module
        Returns:
      • getClassname

        public String getClassname()
      • setClassName

        public void setClassName​(String className)
      • getLoaderClassName

        public String getLoaderClassName()
      • setLoaderClassName

        public void setLoaderClassName​(String loaderClassName)
      • init

        public void init​(State state)
        This is critical in that it puts all the functions and variables (with their correct alias) in to the state for this module. Normally this is called when module_import is invoked on each module, so generally you do not need to call this ever. It is, however, what makes any module work.
        Parameters:
        state -
      • init

        public void init​(State state,
                         boolean doVariables)
      • 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 class Module
        Throws:
        Throwable
      • deserializeStates

        public void deserializeStates​(net.sf.json.JSONObject jsonObject,
                                      SerializationState serializationState)
                               throws Throwable
        This should centralize deserializing the state for a Java module. Hence this is public and should be called whenever this as needed.
        Parameters:
        jsonObject -
        serializationState -
        Throws:
        Throwable
      • createDefaultDocs

        public List<String> createDefaultDocs()
        Creates the documentation from the first of each line of every function. Use this or override as needed.
        Returns:
      • getDescription

        public List<String> getDescription()
        The createDefaultDocs() will create basic documentation for functions and such, and is called automatically during module init(State), but the actual description of this module -- if any -- is done here. Override and return your description.
        Returns:
      • setMetaClass

        public void setMetaClass​(QDLMetaModule metaClass)
      • hasMetaClass

        public boolean hasMetaClass()