jodd.decora.parser
Class DecoratorTagVisitor

java.lang.Object
  extended by jodd.lagarto.EmptyTagVisitor
      extended by jodd.decora.parser.DecoratorTagVisitor
All Implemented Interfaces:
TagVisitor

public class DecoratorTagVisitor
extends EmptyTagVisitor

Visitor that detect Decora tags in the decorator. Therefore, it determines decora tags position inside decorator file.

If decorator content is static, array of decora tags can be cached adn duplicated to skip parsing decorator again.


Field Summary
protected  int closingTagDeepLevel
           
protected  java.lang.String closingTagName
           
protected  java.lang.String decoraIdName
           
protected  int decoraTagDefaultValueEnd
           
protected  int decoraTagDefaultValueStart
           
protected  int decoraTagEnd
           
protected  java.lang.String decoraTagName
           
protected  java.util.LinkedList<DecoraTag> decoraTags
           
protected  int decoraTagStart
           
 
Constructor Summary
DecoratorTagVisitor()
           
 
Method Summary
protected  void checkNestedDecoraTags()
          Check if decora tag is currently defined and throws an exception on nested tags.
protected  void defineDecoraTag()
          Defines decora tag position inside decorator content.
 DecoraTag[] getDecoraTags()
          Returns an array of founded Decora tags.
protected  void onDecoraTag(Tag tag)
          Handle decora tags.
protected  void onIdAttrEnd(Tag tag)
           
protected  void onIdAttrStart(Tag tag)
          Handle open and empty ID attribute tags.
 void tag(Tag tag)
          Invoked on tag (open, close or empty).
 
Methods inherited from class jodd.lagarto.EmptyTagVisitor
cdata, comment, condComment, doctype, end, error, script, start, style, text, xml, xmp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoraTags

protected java.util.LinkedList<DecoraTag> decoraTags

decoraTagName

protected java.lang.String decoraTagName

decoraIdName

protected java.lang.String decoraIdName

decoraTagStart

protected int decoraTagStart

decoraTagEnd

protected int decoraTagEnd

decoraTagDefaultValueStart

protected int decoraTagDefaultValueStart

decoraTagDefaultValueEnd

protected int decoraTagDefaultValueEnd

closingTagName

protected java.lang.String closingTagName

closingTagDeepLevel

protected int closingTagDeepLevel
Constructor Detail

DecoratorTagVisitor

public DecoratorTagVisitor()
Method Detail

getDecoraTags

public DecoraTag[] getDecoraTags()
Returns an array of founded Decora tags.


tag

public void tag(Tag tag)
Description copied from interface: TagVisitor
Invoked on tag (open, close or empty).

Warning: the passed tag instance should not be kept beyond this method as the parser reuse it!

Specified by:
tag in interface TagVisitor
Overrides:
tag in class EmptyTagVisitor

onDecoraTag

protected void onDecoraTag(Tag tag)
Handle decora tags.


onIdAttrStart

protected void onIdAttrStart(Tag tag)
Handle open and empty ID attribute tags.


onIdAttrEnd

protected void onIdAttrEnd(Tag tag)

defineDecoraTag

protected void defineDecoraTag()
Defines decora tag position inside decorator content. Resets current decora tag tracking.


checkNestedDecoraTags

protected void checkNestedDecoraTags()
Check if decora tag is currently defined and throws an exception on nested tags.



Copyright © 2003-2011 Jodd Team