org.codehaus.groovy.grails.web.taglib
Class GroovyUnlessTag

java.lang.Object
  extended by org.codehaus.groovy.grails.web.taglib.GroovySyntaxTag
      extended by org.codehaus.groovy.grails.web.taglib.GroovyUnlessTag
All Implemented Interfaces:
GrailsTag

public class GroovyUnlessTag
extends GroovySyntaxTag


Field Summary
static java.lang.String TAG_NAME
           
 
Fields inherited from class org.codehaus.groovy.grails.web.taglib.GroovySyntaxTag
ATTRIBUTE_IN, ATTRIBUTE_VAR, attributes, ATTRIBUTES_STATUS, foreachRenamedIt, out, parser, tagContext
 
Constructor Summary
GroovyUnlessTag()
           
 
Method Summary
protected  java.lang.String attributeValueOrNull(java.lang.String attributeName)
           
 void doEndTag()
          process the end tag
 void doStartTag()
          Process the start tag
 java.lang.String getName()
           
 boolean isAllowPrecedingContent()
          Tags must return the correct value to indicate whether or not non-whitespace content is permitted before this tag.
 boolean isKeepPrecedingWhiteSpace()
          Tags must return the correct value to indicate whether or not whitespace before this tag should be kept in the output.
protected  void outputStartTag(java.lang.String envExpression, java.lang.String testExpression)
           
 
Methods inherited from class org.codehaus.groovy.grails.web.taglib.GroovySyntaxTag
calculateExpression, doEachMethod, endEachMethod, getForeachRenamedIt, init, setAttribute, setAttributes, setWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
See Also:
Constant Field Values
Constructor Detail

GroovyUnlessTag

public GroovyUnlessTag()
Method Detail

outputStartTag

protected void outputStartTag(java.lang.String envExpression,
                              java.lang.String testExpression)

getName

public java.lang.String getName()
Returns:
The name of the tag

doStartTag

public void doStartTag()
Description copied from interface: GrailsTag
Process the start tag


doEndTag

public void doEndTag()
Description copied from interface: GrailsTag
process the end tag


attributeValueOrNull

protected java.lang.String attributeValueOrNull(java.lang.String attributeName)

isKeepPrecedingWhiteSpace

public boolean isKeepPrecedingWhiteSpace()
Description copied from class: GroovySyntaxTag

Tags must return the correct value to indicate whether or not whitespace before this tag should be kept in the output.

This is for tags that must follow other tags, such as g:else or g:elseif that do not allow content between them and the previous tag, and need to swallow the whitespace between them.

Specified by:
isKeepPrecedingWhiteSpace in class GroovySyntaxTag
Returns:
true if any whitespace immediately before the tag should be kept in the output - false if it is to be discarded

isAllowPrecedingContent

public boolean isAllowPrecedingContent()
Description copied from class: GroovySyntaxTag

Tags must return the correct value to indicate whether or not non-whitespace content is permitted before this tag.

This is for tags that must follow other tags, such as g:else or g:elseif that do not allow content between them and the previous tag. It is simply used as a safety mechanism to trap incorrect usage of tags.

TODO rework this and combine with isKeepPrecedingWhiteSpace as really they are used in the same situations

Specified by:
isAllowPrecedingContent in class GroovySyntaxTag
Returns:
true if any content is allowed immediately before the tag - false if it is an error to have such content before it