|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.directive.Directive
Directive is an abstract class which directives can extend. Nested within Directive (as static classes) are a host of classes used for building directive argument lists. Directives are Macros, so they must implement the Macro interface. For convenience, an implementation of evaluate() (written in terms of write()) is provided in the base class.) Directives must implement the following static method: public DirectiveDescriptor getDescriptor(); It is expected that all directives will build a copy of their descriptor statically, using the various XxxArg() constructors, and return a reference to that from getDescriptor().
Nested Class Summary | |
static class |
Directive.ArgDescriptor
ArgDescriptor is the base class for all the different types of argument descriptors, like ConditionalArg, KeywordArg, RValueArg, etc. |
static class |
Directive.AssignmentArg
Assignment. |
static class |
Directive.BlockArg
Block argument type. |
static class |
Directive.ConditionArg
Condition argument type. |
static class |
Directive.ExactlyOneChoice
The ExactlyOneChoice indicates that exactly one of several optional groups can be accepted, only once. |
static class |
Directive.FormalArgListArg
Argument list. |
static class |
Directive.KeywordArg
Keyword argument type. |
static class |
Directive.LiteralBlockArg
Literal block argument type. |
static class |
Directive.LValueArg
LValue argument type. |
static class |
Directive.NameArg
Implements an argument as a simple name. |
static class |
Directive.NotSimpleVariableBuildException
Utility exception used by directives to signal that an argument that was supposed to be a simple Variable (only one term) is not. |
static class |
Directive.NotVariableBuildException
Utility exception used by directives to signal that an argument that was supposed to be a Variable is not a variable. |
static class |
Directive.OptionalGroup
Optional group. |
static class |
Directive.OptionalRepeatingSubdirective
Optional repeating subdirective. |
static class |
Directive.OptionalSubdirective
Optional subdirective. |
static class |
Directive.OptionChoice
The OptionChoice indicates that several optional groups can be accepted in any order. |
static class |
Directive.QuotedStringArg
Quoted string argument type. |
static class |
Directive.RValueArg
RValue argument type. |
static class |
Directive.SingleOptionChoice
The SingleOptionChoice indicates that zero or one of several optional groups can be accepted, but only once. |
static class |
Directive.StringArg
String argument type. |
static class |
Directive.Subdirective
Subdirectives are like directives, except that they do not have their own class. |
Field Summary | |
static int |
ArgType_ARGLIST
|
static int |
ArgType_ASSIGN
|
static int |
ArgType_BLOCK
|
static int |
ArgType_CHOICE
|
static int |
ArgType_CONDITION
|
static int |
ArgType_GROUP
|
static int |
ArgType_KEYWORD
|
static int |
ArgType_LITBLOCK
|
static int |
ArgType_LVALUE
|
static int |
ArgType_NAME
|
static int |
ArgType_QUOTEDSTRING
|
static int |
ArgType_RVALUE
|
static int |
ArgType_STRING
|
static int |
ArgType_SUBDIRECTIVE
|
Constructor Summary | |
Directive()
|
Method Summary | |
void |
accept(TemplateVisitor v)
|
abstract java.lang.Object |
build(DirectiveBuilder b,
BuildContext bc)
Directives must implement a build() method. |
java.lang.Object |
evaluate(Context context)
same as out but returns a String |
protected static java.lang.String |
getWarningText(java.lang.String warning,
Context context)
Convenience method for directives to write HTML warnings into the output stream. |
protected static void |
writeWarning(java.lang.String warning,
Context context,
FastWriter writer)
Convenience method for directives to write HTML warnings into the output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.webmacro.Macro |
write |
Field Detail |
public static final int ArgType_CONDITION
public static final int ArgType_LVALUE
public static final int ArgType_RVALUE
public static final int ArgType_KEYWORD
public static final int ArgType_ASSIGN
public static final int ArgType_BLOCK
public static final int ArgType_LITBLOCK
public static final int ArgType_SUBDIRECTIVE
public static final int ArgType_QUOTEDSTRING
public static final int ArgType_STRING
public static final int ArgType_NAME
public static final int ArgType_ARGLIST
public static final int ArgType_GROUP
public static final int ArgType_CHOICE
Constructor Detail |
public Directive()
Method Detail |
public abstract java.lang.Object build(DirectiveBuilder b, BuildContext bc) throws BuildException
BuildException
public java.lang.Object evaluate(Context context) throws PropertyException
Macro
evaluate
in interface Macro
PropertyException
- if required data was missing from contextprotected static java.lang.String getWarningText(java.lang.String warning, Context context) throws java.io.IOException, PropertyException
java.io.IOException
PropertyException
protected static void writeWarning(java.lang.String warning, Context context, FastWriter writer) throws java.io.IOException, PropertyException
This method also outputs the same warning message to a log named "directive"
java.io.IOException
PropertyException
public void accept(TemplateVisitor v)
accept
in interface Visitable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |