Class TemplateParseUtil.Template
- java.lang.Object
-
- org.sakaiproject.entitybroker.util.TemplateParseUtil.Template
-
- Direct Known Subclasses:
TemplateParseUtil.PreProcessedTemplate
- Enclosing class:
- TemplateParseUtil
public static class TemplateParseUtil.Template extends Object
Represents a parseable template (which is basically a key and the template string), the array which defines the set of template keys isTemplateParseUtil.PARSE_TEMPLATE_KEYS
Rules for parse templates: 1) "{","}", andTemplateParseUtil.SEPARATORare special characters and must be used as indicated only 2) Must begin with aTemplateParseUtil.SEPARATOR, must not end with aTemplateParseUtil.SEPARATOR3) must begin with "/{prefix}" (use theTemplateParseUtil.SEPARATORandTemplateParseUtil.PREFIXconstants) 3) each {var} can only be used once in a template 4) {var} can never touch each other (i.e /{var1}{var2}/{id} is invalid) 5) each {var} can only have the chars fromTemplateParseUtil.VALID_VAR_CHARS6) parse templates can only have the chars fromTemplateParseUtil.VALID_TEMPLATE_CHARS7) Empty braces ({}) cannot appear in the template- Author:
- Aaron Zeckoski (aaron@caret.cam.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description booleanincomingindicates the template is an incoming template if true, outgoing template if falseStringtemplatethe template itselfStringtemplateKeythe template key, from the set of template keysTemplateParseUtil.PARSE_TEMPLATE_KEYS, or make one up for your own templates, should be unique for this set of templates
-
-
-
Field Detail
-
templateKey
public String templateKey
the template key, from the set of template keysTemplateParseUtil.PARSE_TEMPLATE_KEYS, or make one up for your own templates, should be unique for this set of templates
-
template
public String template
the template itself
-
incoming
public boolean incoming
indicates the template is an incoming template if true, outgoing template if false
-
-
Constructor Detail
-
Template
public Template(String templateKey, String template)
Used to create a template for loading, defaults to an incoming template- Parameters:
templateKey- template identifier, from the set of template keysTemplateParseUtil.PARSE_TEMPLATE_KEYS, must be unique for this set of templatestemplate- the parseable template
-
Template
public Template(String templateKey, String template, boolean incoming)
Used to create a template for loading- Parameters:
templateKey- template identifier, from the set of template keysTemplateParseUtil.PARSE_TEMPLATE_KEYS, must be unique for this set of templatestemplate- the parseable templateincoming- if true then this is an incoming template, otherwise it is an outgoing one
-
-