API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.view. JOTViewParser View Source
Author(s)
Since
Version
Serial
Hierarchy
 Object
      JOTViewParser
Implements
Subclasses
Description
public class JOTViewParser
  This is the main parser that takes a View object and a Template and spits out HTML code to the browser.
See also:   
Constructors
public JOTViewParser ()
Methods
Hide/Show inherited methods
pack-privatestatic String do1LineBlocks (String template, JOTViewParserData view) throws Exception
  Deal with 1liner blocks
pack-privatestatic String do1LineTags (String template, JOTViewParserData view)
  Same as doTags but for 1liner tags
pack-privatestatic String doBlocks (String template, JOTViewParserData view, String templateRoot) throws Exception
  Deal with jot:block tags ie: make sthen visible or not, replace their content etc ...
pack-privatestatic String doIfs (String template, JOTViewParserData view, String templateRoot) throws Exception
pack-privatestatic String doIncludes (String template, JOTViewParserData view, String templateRoot) throws Exception
pack-privatestatic String doLoops (String template, JOTViewParserData view, String templateRoot) throws Exception
  Process loops Loopable variabale must be of 1 of those types: - Collection: AbstractCollection, AbstractList, AbstractSet, ArrayList, BeanContextServicesSupport, BeanContextSupport, HashSet, LinkedHashSet, LinkedList, TreeSet, Vector - Object[] - Hashtable() (keys are ignored)
pack-privatestatic String doRangeLoops (String template, JOTViewParserData view, String templateRoot) throws Exception
publicstatic String doRemoveTags (String template)
  Removes the tags
pack-privatestatic String doTags (String template, JOTViewParserData view, String templateRoot) throws Exception
  Handle the tags that are marked with a jotid property ie: makes them invisible, replace their content, replace some of the tag properties etc ...
pack-privatestatic String doUrls (String template, JOTViewParserData view)
process URL's
pack-privatestatic String doVariables (String template, JOTViewParserData view) throws Exception
  Replaces the template variables par their values
pack-privatestatic String doVariables2 (String template, JOTViewParserData view) throws Exception
pack-privatestatic Object evaluateObject (JOTViewParserData view, Object parent, String call) throws Exception
  Once a variable is split into individual objects/fields, we call this to get each "piece" value
publicstatic JOTPair findMatchingClosingTag (int pos, String template, Pattern openTag, Pattern closeTag)
  Find the matching(balanced) closing html tag to the tag provided Note that if the HTML is broken (unbalanced tags) this might break.
pack-privatestatic Vector getVariableHash (String varName) throws Exception
  Parse a template variable into pieces ie: toto.tata.titi().tutu becomes [toto,tata,titi,tutu]
pack-privatestatic Object getVariableValue (JOTViewParserData view, Vector varHash, Object obj, String defaultVal) throws Exception
  Evaluate a template variable and finds its value
pack-privatestatic Field lookForField (Object obj, String field)
  Try to find a public Field with the given name in the object or null if it is not defined in the object
protectedstatic Method lookForMethod (Object obj, String method, Object values)
  Try to find a Method of the given name in the object or null if it is not defined in the object
publicstatic void main (String args)
  For testing purposes.
publicstatic String parse (JOTViewParserData view, String template, String templateRoot) throws Exception
  Parse the whole template file as a String.
publicstatic String parseTemplate (JOTViewParserData view, String templateRoot, String templateFile) throws Exception
  Parse a whole template file
pack-privatestatic String replaceFlags (String openingTag, Hashtable flags, boolean oneLiner)
  Replaces the flags in the HTML, such as "DISABLED" or "CHECKED"
pack-privatestatic String replaceTagProperties (String openingTag, Hashtable tagProperties, boolean oneLiner)
  Replaces an html tag properties with the ones provided ie: change the value of the class property in ...
publicstatic void safeAppendReplacement (Matcher m, StringBuffer sb, String replacement)
  Standard java appendReplacement() use the $sign to do block replace stuff.
publicstatic void setPostProcessor (JOTViewParserInterface postprocessor)
  set your own custom preprocessor
publicstatic void setPreProcessor (JOTViewParserInterface preprocessor)
Fields
Hide/Show inherited fields
protectedfinalstatic Pattern BLOCK_PATTERN
protectedfinalstatic Pattern BLOCK_PATTERN_1LINE
protectedfinalstatic Pattern CLOSE_BLOCK_PATTERN
protectedfinalstatic String CLOSE_BLOCK_STRING = ""
protectedfinalstatic Pattern CLOSE_IF_PATTERN
protectedfinalstatic String CLOSE_IF_STRING = ""
protectedfinalstatic Pattern CLOSE_LOOP_PATTERN
protectedfinalstatic String CLOSE_LOOP_STRING = ""
protectedfinalstatic String COUNTER_NAME = "cpt"
protectedfinalstatic Pattern FORM_PATTERN
protectedfinalstatic Pattern GENERIC_LOOP_PATTERN
protectedfinalstatic Pattern IF_PATTERN
protectedfinalstatic Pattern INCLUDE_PATTERN
protectedfinalstatic Pattern LOOP_PATTERN
protectedfinalstatic String LOOP_STACK = "__JOT_LOOP_STACK"
protectedfinalstatic String MISSING_VALUE = "MISSING_VALUE !"
protectedfinalstatic Pattern OPEN_BLOCK_PATTERN
protectedfinalstatic Pattern OPEN_IF_PATTERN
protectedfinalstatic Pattern OPEN_TAG_JOTCLASS_PATTERN
protectedfinalstatic Pattern OPEN_TAG_JOTID_PATTERN
protectedfinalstatic Pattern OPEN_TAG_PATTERN
protectedfinalstatic Pattern PARAMS_PATTERN
publicfinalstatic int PATTERN_FLAGS = "170"
protectedfinalstatic Pattern RANGE_LOOP_PATTERN
protectedfinalstatic Pattern REMOVE_PATTERN
protectedfinalstatic Pattern TAG_PATTERN
protectedfinalstatic Pattern TAG_PATTERN_1LINE
protectedfinalstatic Pattern URL_PATTERN
protectedfinalstatic Pattern VAR_MEMBER_PATTERN
protectedfinalstatic Pattern VAR_PATTERN
protectedfinalstatic Pattern VAR_PATTERN2
protectedfinalstatic Pattern WIDGET_PATTERN
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar