jodd.decora.parser
Class DecoraTag

java.lang.Object
  extended by jodd.decora.parser.DecoraTag

public class DecoraTag
extends java.lang.Object

Decora tag, defined by the name and its position in decorator file.


Constructor Summary
DecoraTag(java.lang.String name, java.lang.String id, int start, int end)
           
DecoraTag(java.lang.String name, java.lang.String id, int start, int end, int defaultValueStart, int defaultValueLength)
           
 
Method Summary
 DecoraTag duplicate()
          Duplicates static content of the class, for caching purposes.
 void endRegion(int regionEnd, int tagLen)
          Ends region definition by setting the region length.
 int getDefaultValueLength()
          Returns the length of Decora default value if exist.
 int getDefaultValueStart()
          Returns start index of Decora default value if exist.
 int getEndIndex()
          Returns end index of Decora tag in decorator file.
 java.lang.String getName()
          Returns decora tag name.
 int getRegionLength()
          Returns region length.
 int getRegionStart()
          Returns start index of the region in the page.
 int getRegionTagEnd()
           
 int getRegionTagStart()
           
 int getStartIndex()
          Returns start index of Decora tag in decorator file.
 boolean hasDefaultValue()
          Returns true if Decora tag has default value.
 boolean isMatchedTag(Tag tag)
          Returns true if provided tag matches decorator tag.
 boolean isRegionDefined()
          Returns true if region is fully defined.
 boolean isRegionStarted()
          Returns true if region definition is started.
 boolean isRegionUndefined()
          Returns true if region is undefined.
 void startRegion(int start, int tagLen)
          Starts defining region by setting the start index and reset region length to zero.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecoraTag

public DecoraTag(java.lang.String name,
                 java.lang.String id,
                 int start,
                 int end)

DecoraTag

public DecoraTag(java.lang.String name,
                 java.lang.String id,
                 int start,
                 int end,
                 int defaultValueStart,
                 int defaultValueLength)
Method Detail

duplicate

public DecoraTag duplicate()
Duplicates static content of the class, for caching purposes. If a decorator is static content, it does not have to be parsed all over again. Instead, just store parsed list of DecoraTags and duplicate it.


getName

public java.lang.String getName()
Returns decora tag name.


getStartIndex

public int getStartIndex()
Returns start index of Decora tag in decorator file.


getEndIndex

public int getEndIndex()
Returns end index of Decora tag in decorator file.


getDefaultValueStart

public int getDefaultValueStart()
Returns start index of Decora default value if exist. Returns -1 if default value is not specified.


getDefaultValueLength

public int getDefaultValueLength()
Returns the length of Decora default value if exist. Returns 0 if default value is not specified.


hasDefaultValue

public boolean hasDefaultValue()
Returns true if Decora tag has default value.


isMatchedTag

public boolean isMatchedTag(Tag tag)
Returns true if provided tag matches decorator tag.


isRegionDefined

public boolean isRegionDefined()
Returns true if region is fully defined. Returns false if region is either started or undefined.


isRegionStarted

public boolean isRegionStarted()
Returns true if region definition is started. Region start is known, but not yet the end.


isRegionUndefined

public boolean isRegionUndefined()
Returns true if region is undefined. Returns false if region is either started or defined.


startRegion

public void startRegion(int start,
                        int tagLen)
Starts defining region by setting the start index and reset region length to zero.


endRegion

public void endRegion(int regionEnd,
                      int tagLen)
Ends region definition by setting the region length.


getRegionStart

public int getRegionStart()
Returns start index of the region in the page.


getRegionLength

public int getRegionLength()
Returns region length.


getRegionTagStart

public int getRegionTagStart()

getRegionTagEnd

public int getRegionTagEnd()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2011 Jodd Team