Class TImpl<C extends IComponent<C>>
- java.lang.Object
-
- io.ciera.runtime.summit.util.Utility<C>
-
- io.ciera.runtime.template.util.impl.TImpl<C>
-
- All Implemented Interfaces:
IActionHome<C>,T
public class TImpl<C extends IComponent<C>> extends Utility<C> implements T
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String s)Append a string to the current buffer.Stringbody()Clear the current buffer and return the contents as a String.voidclear()Clear the current buffervoidemit(String file)Clear the current buffer and emit the contents to a file specified byfile.voidinclude(String file, Object... symbols)Include an RSL template.voidpop_buffer()Remove the current buffer and replace it with the next buffer on the buffer stack.voidpush_buffer()Store the current buffer on the buffer stack and replace it with a new buffer.voidset_output_directory(String dir)Set the root directory for emitting files.Stringsub(String format, String s)Perform a format substitution.-
Methods inherited from class io.ciera.runtime.summit.util.Utility
context, getRunContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ciera.runtime.summit.application.IActionHome
warn
-
-
-
-
Constructor Detail
-
TImpl
public TImpl(C context)
-
-
Method Detail
-
append
public void append(String s)
Description copied from interface:TAppend a string to the current buffer.
-
body
public String body()
Description copied from interface:TClear the current buffer and return the contents as a String.
-
clear
public void clear()
Description copied from interface:TClear the current buffer
-
emit
public void emit(String file) throws XtumlException
Description copied from interface:TClear the current buffer and emit the contents to a file specified byfile.- Specified by:
emitin interfaceT- 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:TInclude an RSL template. The in-scope variables in the location where invoked will be captured and passed as the list ofsymbols.- Specified by:
includein interfaceT- Parameters:
file- the template file to include relative to the root template directorysymbols- 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:TRemove the current buffer and replace it with the next buffer on the buffer stack.- Specified by:
pop_bufferin interfaceT
-
push_buffer
public void push_buffer()
Description copied from interface:TStore the current buffer on the buffer stack and replace it with a new buffer.- Specified by:
push_bufferin interfaceT
-
set_output_directory
public void set_output_directory(String dir)
Description copied from interface:TSet the root directory for emitting files.- Specified by:
set_output_directoryin interfaceT- Parameters:
dir- the root location for template output
-
sub
public String sub(String format, String s) throws XtumlException
Description copied from interface:TPerform a format substitution. The following format characters are supported:u(upper) - make all characters upper casec(capitalize) - make the first character of each word capitalized and all other characters of a word lowercasel(lower) - make all characters lowercase_(underscore) - change all whitespace characters to underscore charactersr(remove) - remove all whitespaceo(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 ignoredt(pass-through)
formatparameter will be evaluated as a format character sequentially left to right.- Specified by:
subin interfaceT- Parameters:
format- the string of format characters representing operations to performs- the string to format- Returns:
- a formatted string
- Throws:
XtumlException- if an invalid format character is passed
-
-