org.sakaiproject.entitybroker.util
Class TemplateParseUtil.Template

java.lang.Object
  extended by 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 is TemplateParseUtil.PARSE_TEMPLATE_KEYS
Rules for parse templates: 1) "{","}", and TemplateParseUtil.SEPARATOR are special characters and must be used as indicated only 2) Must begin with a TemplateParseUtil.SEPARATOR, must not end with a TemplateParseUtil.SEPARATOR 3) must begin with "/{prefix}" (use the TemplateParseUtil.SEPARATOR and TemplateParseUtil.PREFIX constants) 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 from TemplateParseUtil.VALID_VAR_CHARS 6) parse templates can only have the chars from TemplateParseUtil.VALID_TEMPLATE_CHARS 7) Empty braces ({}) cannot appear in the template

Author:
Aaron Zeckoski (aaron@caret.cam.ac.uk)

Field Summary
 boolean incoming
          indicates the template is an incoming template if true, outgoing template if false
 String template
          the template itself
 String templateKey
          the template key, from the set of template keys TemplateParseUtil.PARSE_TEMPLATE_KEYS, or make one up for your own templates, should be unique for this set of templates
 
Constructor Summary
TemplateParseUtil.Template(String templateKey, String template)
          Used to create a template for loading, defaults to an incoming template
TemplateParseUtil.Template(String templateKey, String template, boolean incoming)
          Used to create a template for loading
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateKey

public String templateKey
the template key, from the set of template keys TemplateParseUtil.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

TemplateParseUtil.Template

public TemplateParseUtil.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 keys TemplateParseUtil.PARSE_TEMPLATE_KEYS, must be unique for this set of templates
template - the parseable template

TemplateParseUtil.Template

public TemplateParseUtil.Template(String templateKey,
                                  String template,
                                  boolean incoming)
Used to create a template for loading

Parameters:
templateKey - template identifier, from the set of template keys TemplateParseUtil.PARSE_TEMPLATE_KEYS, must be unique for this set of templates
template - the parseable template
incoming - if true then this is an incoming template, otherwise it is an outgoing one
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2007-2012 Sakai Project. All Rights Reserved.