Class TImpl<C extends IComponent<C>>

    • Constructor Detail

      • TImpl

        public TImpl​(C context)
    • Method Detail

      • append

        public void append​(String s)
        Description copied from interface: T
        Append a string to the current buffer.
        Specified by:
        append in interface T
        Parameters:
        s - the string value to append
      • body

        public String body()
        Description copied from interface: T
        Clear the current buffer and return the contents as a String.
        Specified by:
        body in interface T
        Returns:
        the contents of the buffer
      • clear

        public void clear()
        Description copied from interface: T
        Clear the current buffer
        Specified by:
        clear in interface T
      • emit

        public void emit​(String file)
                  throws XtumlException
        Description copied from interface: T
        Clear the current buffer and emit the contents to a file specified by file.
        Specified by:
        emit in interface T
        Parameters:
        file - the name of the output file relative to the configured output directory
        Throws:
        XtumlException - if the file cannot be opened for writing
        See Also:
        T.set_output_directory(java.lang.String)
      • include

        public void include​(String file,
                            Object... symbols)
                     throws XtumlException
        Description copied from interface: T
        Include an RSL template. The in-scope variables in the location where invoked will be captured and passed as the list of symbols.
        Specified by:
        include in interface T
        Parameters:
        file - the template file to include relative to the root template directory
        symbols - the list of symbols to pass to the template. When invoked from OAL, this list is composed by capturing all in-scope variables in the context where it was invoked.
        Throws:
        XtumlException - if an error occurs during template evaluation
      • pop_buffer

        public void pop_buffer()
        Description copied from interface: T
        Remove the current buffer and replace it with the next buffer on the buffer stack.
        Specified by:
        pop_buffer in interface T
      • push_buffer

        public void push_buffer()
        Description copied from interface: T
        Store the current buffer on the buffer stack and replace it with a new buffer.
        Specified by:
        push_buffer in interface T
      • set_output_directory

        public void set_output_directory​(String dir)
        Description copied from interface: T
        Set the root directory for emitting files.
        Specified by:
        set_output_directory in interface T
        Parameters:
        dir - the root location for template output
      • sub

        public String sub​(String format,
                          String s)
                   throws XtumlException
        Description copied from interface: T
        Perform a format substitution. The following format characters are supported:
        • u (upper) - make all characters upper case
        • c (capitalize) - make the first character of each word capitalized and all other characters of a word lowercase
        • l (lower) - make all characters lowercase
        • _ (underscore) - change all whitespace characters to underscore characters
        • r (remove) - remove all whitespace
        • o (corba) - make the first word all lowercase, make the first character of each following word capitalized and all other characters of the words lowercase. Characters other than a-Z a-z 0-9 are ignored
        • t (pass-through)
        Each character in the format parameter will be evaluated as a format character sequentially left to right.
        Specified by:
        sub in interface T
        Parameters:
        format - the string of format characters representing operations to perform
        s - the string to format
        Returns:
        a formatted string
        Throws:
        XtumlException - if an invalid format character is passed