org.webmacro.directive
Class DirectiveDescriptor
java.lang.Object
org.webmacro.directive.DirectiveDescriptor
- public final class DirectiveDescriptor
- extends java.lang.Object
Each directive needs a DirectiveDescriptor to describe how it
should be parsed and built by the parser. The directive descriptor
identifies the directive's name, the class of the underlying concrete
directive object, a list of directive argument descriptors, and a list
of subdirective descriptors.
If the directive does not specify the class, the directive provider will
fill it in automatically.
The args field is an array of Directive.ArgDescriptor objects. There
are static nested classes within Directive for each type of argument
-- Condition, LValue, RValue, Keyword, Punctuation, Block, LiteralBlock,
and special argument descriptors for OptionalGroup and OptionalChoice.
These allow the directive writer to specify
a flexible syntax for directive arguments.
Each directive can have a set of subdirectives, and each subdirective
can have its own argument list. Subdirectives can be required, optional,
or optional-repeating (multiple subdirectives of the same kind, like
#elseif.) There are constructors for Subdirective in the Directive module
as well.
- Author:
- Brian Goetz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
public java.lang.String name
dirClass
public java.lang.Class dirClass
args
public Directive.ArgDescriptor[] args
subdirectives
public Directive.Subdirective[] subdirectives
valid
public boolean valid
hasBreakingSubdirectives
public boolean hasBreakingSubdirectives
DirectiveDescriptor
public DirectiveDescriptor(java.lang.String name,
java.lang.Class dirClass,
Directive.ArgDescriptor[] args,
Directive.Subdirective[] subdirectives)