org.webmacro.directive
Class DirectiveProvider

java.lang.Object
  |
  +--org.webmacro.directive.DirectiveProvider
All Implemented Interfaces:
Provider

public final class DirectiveProvider
extends java.lang.Object
implements Provider

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)
          Get the object associated with the specified query
 DirectiveDescriptor getDescriptor(java.lang.String directiveName)
          Create a builder for the named directive
 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 register(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

DIRECTIVE_KEY

public static final java.lang.String DIRECTIVE_KEY
Constructor Detail

DirectiveProvider

public DirectiveProvider()
Method Detail

register

public final void register(java.lang.String dirClassName,
                           java.lang.String dirName)
                    throws IntrospectionException,
                           InitException
Register a new directive class, so that a builder of this type can be retrieved later.
Throws:
IntrospectionException - something wrong with the class
InitException - duplicate registration

getDescriptor

public final DirectiveDescriptor getDescriptor(java.lang.String directiveName)
                                        throws java.lang.ClassNotFoundException
Create a builder for the named directive

getType

public java.lang.String getType()
Description copied from interface: Provider
Return an array representing the types this provider serves up
Specified by:
getType in interface Provider

init

public void init(Broker broker,
                 Settings config)
          throws InitException
Description copied from interface: Provider
Initialize this provider based on the specified config.
Specified by:
init in interface Provider

destroy

public void destroy()
Description copied from interface: Provider
Close down this provider, freeing any allocated resources.
Specified by:
destroy in interface Provider

get

public java.lang.Object get(java.lang.String name)
                     throws NotFoundException
Description copied from interface: Provider
Get the object associated with the specified query
Specified by:
get in interface Provider

flush

public void flush()
Description copied from interface: Provider
Clear any cache this provider may be maintaining
Specified by:
flush in interface Provider