|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.directive.DirectiveProvider
Utility class to assist in the creation of directives.
Field Summary | |
static java.lang.String |
DIRECTIVE_KEY
|
Constructor Summary | |
DirectiveProvider()
|
Method Summary | |
void |
destroy()
Close down this provider, freeing any allocated resources. |
void |
flush()
Clear any cache this provider may be maintaining |
java.lang.Object |
get(java.lang.String name)
The DirectiveProvider doesn't throw an exception when it can't find the directive -- it just returns null. |
java.lang.String |
getType()
Return an array representing the types this provider serves up |
void |
init(Broker broker,
Settings config)
Initialize this provider based on the specified config. |
void |
registerDescriptor(DirectiveDescriptor dd,
java.lang.String dirName)
Register an org.webmacro.directive.DirectiveDescriptor to be used as if it were a real Directive named dirName . |
void |
registerDirective(java.lang.String dirClassName,
java.lang.String dirName)
Register a new directive class, so that a builder of this type can be retrieved later. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DIRECTIVE_KEY
Constructor Detail |
public DirectiveProvider()
Method Detail |
public final void registerDescriptor(DirectiveDescriptor dd, java.lang.String dirName)
dirName
.
If the specified dirName
is already registered, it is
happily, and silently replaced.
Once registered, one can use this "directive" from a template like so:
#dirName arg1 arg2 argN where the args are dependant on the DirectiveDescriptor
dd
- the DirectiveDescriptordirName
- name of the "directive"public final void registerDirective(java.lang.String dirClassName, java.lang.String dirName) throws IntrospectionException, InitException
IntrospectionException
- something wrong with the class
InitException
- duplicate registrationpublic java.lang.String getType()
Provider
getType
in interface Provider
public void init(Broker broker, Settings config) throws InitException
Provider
init
in interface Provider
InitException
public void destroy()
Provider
destroy
in interface Provider
public java.lang.Object get(java.lang.String name)
get
in interface Provider
public void flush()
Provider
flush
in interface Provider
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |