org.peaseplate.internal.designator
Class MacroDesignator

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

public class MacroDesignator
extends java.lang.Object
implements Designator

The designator for the "macro" keyword. Expects the code chunk to contain an identifier eventually followed by a list of identifiers. Macro = Identifier ["." Identifier] ["(" Command {"," Command} ")"]

Author:
Manfred HANTSCHEL

Field Summary
static java.lang.String NAME
           
 
Constructor Summary
MacroDesignator()
           
 
Method Summary
 Chunk compile(TemplateEngine engine, CompileContext context, Token token)
           
 java.lang.String getKeyword()
          The keyword of this designator is "macro".
 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

MacroDesignator

public MacroDesignator()
Method Detail

getKeyword

public java.lang.String getKeyword()
The keyword of this designator is "macro".

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.