org.peaseplate.internal.designator
Class MessageDesignator

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

public class MessageDesignator
extends java.lang.Object
implements Designator


Nested Class Summary
static class MessageDesignator.MessageCommand
           
 
Field Summary
static java.lang.String NAME
           
 
Constructor Summary
MessageDesignator()
           
 
Method Summary
 Chunk compile(TemplateEngine engine, CompileContext context, Token token)
           
 java.lang.String getKeyword()
          Returns the keyword of the designator.
 boolean isBlockExpansion()
           
 boolean isBlockHead()
           
 boolean isBlockTail()
           
 boolean isEmpty()
          If this method returns true it indicates that the code fragment does not contain code and does not need to get compiled (e.g.
 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

MessageDesignator

public MessageDesignator()
Method Detail

getKeyword

public java.lang.String getKeyword()
Description copied from interface: Designator
Returns the keyword of the designator. The keyword must be unique within the TemplateEngine. The following characters are allowed: any letter, any digit, '.', '_', '-' and '/'.

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

isEmpty

public boolean isEmpty()
Description copied from interface: Designator
If this method returns true it indicates that the code fragment does not contain code and does not need to get compiled (e.g. ${end}, ${else}, ${break},...).

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.