Class EglPersistentTemplate

    • Field Detail

      • outputRoot

        protected final java.net.URI outputRoot
      • outputRootPath

        protected final java.lang.String outputRootPath
    • Constructor Detail

      • EglPersistentTemplate

        public EglPersistentTemplate​(EglTemplateSpecification spec,
                                     IEglContext context,
                                     java.net.URI outputRoot)
                              throws java.lang.Exception
        Parameters:
        spec -
        context -
        outputRoot -
        Throws:
        java.lang.Exception
        Since:
        1.6
      • EglPersistentTemplate

        public EglPersistentTemplate​(EglTemplateSpecification spec,
                                     IEglContext context,
                                     java.net.URI outputRoot,
                                     java.lang.String outputRootPath)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • store

        public void store​(java.lang.String path)
                   throws EglRuntimeException
        Deprecated.
        Use generate(path) instead, or generate(path, false, false), if you really know what you are doing :-)
        This processes the template and stores the result in the given file, provided that this file does not exist yet. This method is here for backward compatibility only.
        Parameters:
        path -
        Throws:
        EglRuntimeException
      • store

        public void store​(java.lang.String path,
                          boolean overwrite)
                   throws EglRuntimeException
        Deprecated.
        Use generate(path) instead, or generate(path, overwrite, false), if you really know what you are doing :-)
        This processes the template and stores the result in the given file. If overwrite is false, an existing file will prevent the result from being written. If overwrite is true, any existing file will be overwritten, not respecting protected regions. This method is here for backward compatibility only.
        Parameters:
        path -
        overwrite -
        Throws:
        EglRuntimeException
      • generate

        public final void generate​(java.lang.String path)
                            throws EglRuntimeException
        The preferred way of generating code from a persistent template, this stores the generation result in the given file, maintaining any protected regions.
        Parameters:
        path -
        Throws:
        EglRuntimeException
      • generate

        public java.io.File generate​(java.lang.String path,
                                     boolean overwrite,
                                     boolean merge)
                              throws EglRuntimeException
        Fully parameterised version of generate, usually only used internally. Setting overwrite to false implies merge is ignored.
        Parameters:
        path -
        overwrite -
        merge -
        Returns:
        The output file.
        Throws:
        EglRuntimeException
      • name

        protected java.lang.String name​(java.lang.String path)
      • doGenerate

        protected abstract void doGenerate​(java.io.File file,
                                           java.lang.String targetName,
                                           boolean overwrite,
                                           boolean merge)
                                    throws EglRuntimeException
        Store result of processing template in the given file. Subclasses should override to implement the specific semantics of 'storing' to a file. The result of processing the template will be available from EglTemplate.contents.
        Parameters:
        path -
        targetName -
        overwrite -
        merge -
        Throws:
        EglRuntimeException
      • addMessage

        protected void addMessage​(java.lang.String message)