org.webmacro.directive
Class CommentDirective

java.lang.Object
  extended byorg.webmacro.directive.Directive
      extended byorg.webmacro.directive.CommentDirective
All Implemented Interfaces:
Macro, Visitable

public class CommentDirective
extends Directive

Allows a template writer to make a block comment.


Nested Class Summary
 
Nested classes inherited from class org.webmacro.directive.Directive
Directive.ArgDescriptor, Directive.AssignmentArg, Directive.BlockArg, Directive.ConditionArg, Directive.ExactlyOneChoice, Directive.FormalArgListArg, Directive.KeywordArg, Directive.LiteralBlockArg, Directive.LValueArg, Directive.NameArg, Directive.NotSimpleVariableBuildException, Directive.NotVariableBuildException, Directive.OptionalGroup, Directive.OptionalRepeatingSubdirective, Directive.OptionalSubdirective, Directive.OptionChoice, Directive.QuotedStringArg, Directive.RValueArg, Directive.SingleOptionChoice, Directive.StringArg, Directive.Subdirective
 
Field Summary
 
Fields inherited from class org.webmacro.directive.Directive
ArgType_ARGLIST, ArgType_ASSIGN, ArgType_BLOCK, ArgType_CHOICE, ArgType_CONDITION, ArgType_GROUP, ArgType_KEYWORD, ArgType_LITBLOCK, ArgType_LVALUE, ArgType_NAME, ArgType_QUOTEDSTRING, ArgType_RVALUE, ArgType_STRING, ArgType_SUBDIRECTIVE
 
Constructor Summary
CommentDirective()
           
 
Method Summary
 void accept(TemplateVisitor v)
           
 java.lang.Object build(DirectiveBuilder builder, BuildContext bc)
          Directives must implement a build() method.
static DirectiveDescriptor getDescriptor()
           
 void write(FastWriter out, Context context)
          Interpret the directive and write it out, using the values in the supplied context as appropriate.
 
Methods inherited from class org.webmacro.directive.Directive
evaluate, getWarningText, writeWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentDirective

public CommentDirective()
Method Detail

getDescriptor

public static DirectiveDescriptor getDescriptor()

build

public java.lang.Object build(DirectiveBuilder builder,
                              BuildContext bc)
                       throws BuildException
Description copied from class: Directive
Directives must implement a build() method. The build method should examine the directive arguments (available through the DirectiveBuilder) and return a macro describing the built directive. In most cases, build() will just set up the directive's private fields and return 'this', but in some cases, no macro needs be returned (such as directives with only side effects on the build context) or some other macro may be returned (such as in the case of "#if (true) { }" -- no IfDirective object need be returned, just return the block.)

Specified by:
build in class Directive
Throws:
BuildException

write

public void write(FastWriter out,
                  Context context)
           throws PropertyException,
                  java.io.IOException
Description copied from interface: Macro
Interpret the directive and write it out, using the values in the supplied context as appropriate.

Throws:
java.io.IOException - if we could not successfully write to out
PropertyException - if required data was missing from context

accept

public void accept(TemplateVisitor v)
Specified by:
accept in interface Visitable
Overrides:
accept in class Directive


Copyright © 1999-2006 WebMacro. All Rights Reserved.