|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--kawigi.template.Template
Represents the template of a class that can be extended by a template. It's probably best to think of this as a template template. Even though it doesn't literally define a template for a template, it's the template for how a template is interpreted (in fact, it interprets the real templates). This class is JavaBean compliant, so that it can be serialized by java's XMLEncoder (and deserialized by java's XMLDecoder). Of course, the XMLEncoder has some serious issues with the complicated system of classloaders involved TopCoder plugins, so I don't actually use it.
| Field Summary | |
protected java.lang.String |
methodName
Represents the method that should be overridden by this template. |
protected java.lang.String[] |
parameters
A list of parameters to the method that is overridden by the template. |
protected java.lang.String |
templateName
The name of the template, which should be the name of the class extended by this template. |
| Constructor Summary | |
Template()
Constructs a new Template object with initially null properties. |
|
Template(java.lang.String templateName,
java.lang.String methodName,
java.lang.String[] parameters)
Constructs a new Template object with the given values. |
|
| Method Summary | |
protected java.lang.String |
encode(java.lang.String startString)
Encodes a string to escape new lines, tabs, carriage returns, single and double quotes, and forward slashes. |
java.lang.String |
getMethodName()
Accessor for methodName. |
java.lang.String[] |
getMethodParameters()
Accessor for parameters |
java.lang.String |
getName()
Accessor for templateName. |
void |
insert(java.io.File directory,
java.util.List lines,
java.util.Set methodsUsed,
java.util.List tagLibs,
java.lang.String templateCode)
Does the main actual translation of template code into java code. |
protected kawigi.template.MethodInfo |
locateMethod(java.util.List tagLibs,
java.lang.String tagName)
Resolves the name of the tag in the list of tag libraries. |
static kawigi.template.Template |
readKTT(java.io.File folder,
java.lang.String filename)
Reads a .ktt file from disk, deserializing it from XML. |
void |
setMethodName(java.lang.String name)
Mutator for methodName. |
void |
setMethodParameters(java.lang.String[] parameters)
Mutator for parameters. |
void |
setName(java.lang.String name)
Mutator for templatename. |
java.lang.String[] |
translateCode(java.io.File directory,
java.lang.String templateCode,
java.lang.String className)
Translates the KawigiEdit Template (KET) code into java code implementing the template. |
void |
translateFile(java.io.File folder,
java.lang.String templateClass)
Opens |
void |
write(java.io.File folder)
Writes the given template to disk at |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String templateName
protected java.lang.String methodName
protected java.lang.String[] parameters
| Constructor Detail |
public Template(java.lang.String templateName,
java.lang.String methodName,
java.lang.String[] parameters)
public Template()
| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getMethodName()
public void setMethodName(java.lang.String name)
public java.lang.String[] getMethodParameters()
public void setMethodParameters(java.lang.String[] parameters)
public void write(java.io.File folder)
public java.lang.String[] translateCode(java.io.File directory,
java.lang.String templateCode,
java.lang.String className)
throws TemplateSyntaxException
TemplateSyntaxException
public void insert(java.io.File directory,
java.util.List lines,
java.util.Set methodsUsed,
java.util.List tagLibs,
java.lang.String templateCode)
throws TemplateSyntaxException
TemplateSyntaxException
protected kawigi.template.MethodInfo locateMethod(java.util.List tagLibs,
java.lang.String tagName)
public void translateFile(java.io.File folder,
java.lang.String templateClass)
throws java.io.IOException,
TemplateSyntaxException
java.io.IOException
TemplateSyntaxExceptionprotected java.lang.String encode(java.lang.String startString)
public static kawigi.template.Template readKTT(java.io.File folder,
java.lang.String filename)
throws java.io.IOException,
TemplateSyntaxException
java.io.IOException
TemplateSyntaxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||