org.peaseplate.internal.designator
Class WithEachDesignator

java.lang.Object
  extended by org.peaseplate.internal.designator.WithEachDesignator
All Implemented Interfaces:
Designator

public class WithEachDesignator
extends java.lang.Object
implements Designator

The designator for the "with-each" keyword. Expects the code chunk to contain a expression that returns an object or null.

Author:
Manfred HANTSCHEL

Field Summary
static java.lang.String NAME
           
 
Constructor Summary
WithEachDesignator()
           
 
Method Summary
 Chunk compile(TemplateEngine engine, CompileContext context, Token token)
           
 java.lang.String getKeyword()
          The keyword of this designator is "with-each".
 boolean isBlockExpansion()
           
 boolean isBlockHead()
           
 boolean isBlockTail()
           
 boolean isEmpty()
          The designator is not empty.
 boolean isExpandableBlock()
           
 boolean isVisible()
          Returns true if the chunk generated by the designator is visible, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

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

WithEachDesignator

public WithEachDesignator()
Method Detail

getKeyword

public java.lang.String getKeyword()
The keyword of this designator is "with-each".

Specified by:
getKeyword in interface Designator
Returns:
the keyword of the designator, not null
See Also:
Designator.getKeyword()

isEmpty

public boolean isEmpty()
The designator is not empty.

Specified by:
isEmpty in interface Designator
Returns:
true if empty, false otherwise
See Also:
Designator.isEmpty()

isBlockHead

public boolean isBlockHead()
Specified by:
isBlockHead in interface Designator
See Also:
Designator.isBlockHead()

isBlockTail

public boolean isBlockTail()
Specified by:
isBlockTail in interface Designator
See Also:
Designator.isBlockTail()

isExpandableBlock

public boolean isExpandableBlock()
Specified by:
isExpandableBlock in interface Designator
See Also:
Designator.isExpandableBlock()

isBlockExpansion

public boolean isBlockExpansion()
Specified by:
isBlockExpansion in interface Designator
See Also:
Designator.isBlockExpansion()

isVisible

public boolean isVisible()
Description copied from interface: Designator
Returns true if the chunk generated by the designator is visible, false otherwise. If the chunk can generate visible output, this method returns true. A content chunk with only white spaces in it, is by definition not visible. This method cannot compute this, since is does not get the source. Handle ContentDesignator separately.

Specified by:
isVisible in interface Designator
Returns:
true if visible, false otherwise
See Also:
Designator.isVisible()

compile

public Chunk compile(TemplateEngine engine,
                     CompileContext context,
                     Token token)
              throws TemplateException
Specified by:
compile in interface Designator
Throws:
TemplateException
See Also:
Designator.compile(org.peaseplate.TemplateEngine, org.peaseplate.internal.model.CompileContext, org.peaseplate.internal.parser.Token)


Copyright © 2008. All Rights Reserved.