Class EglPersistentTemplate

    • Field Detail

      • outputRoot

        protected final URI outputRoot
      • outputRootPath

        protected final String outputRootPath
    • Method Detail

      • store

        public void store​(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​(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​(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 File generate​(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
      • doGenerate

        protected abstract void doGenerate​(File file,
                                           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​(String message)