org.enhydra.barracuda.core.comp
Class TemplateDirective

java.lang.Object
  |
  +--org.enhydra.barracuda.core.comp.TemplateDirective

public class TemplateDirective
extends java.lang.Object

This class defines a TemplateDirective. A TemplateDirective is created from a string (usually in the HTML class attribute) and takes the form Dir::<command>.<model>.<key>.<props>... where:

As an example, the following are valid directives:


Field Summary
protected  java.lang.String cmd
           
static java.lang.String DISCARD
           
static java.lang.String GET_DATA
           
static java.lang.String ITERATE_END
           
static java.lang.String ITERATE_NEXT
           
static java.lang.String ITERATE_START
           
protected  java.lang.String keyData
           
protected  java.lang.String keyName
           
protected  java.lang.String modelName
           
static java.lang.String SET_ATTR
           
 
Constructor Summary
protected TemplateDirective()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
static java.util.List getAllInstances(java.lang.String sourceStr)
          Given a space delimited string of directive commands, convert each segment into a TemplateDirective and return all the valid directives in a List.
 java.lang.String getCommand()
           
static TemplateDirective getInstance(java.lang.String sourceStr)
          Given a string of the form Dir::<command>.
 java.lang.String getKeyData()
           
 java.lang.String getKeyName()
           
 java.lang.String getModelName()
           
static void main(java.lang.String[] args)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ITERATE_START

public static final java.lang.String ITERATE_START
See Also:
Constant Field Values

ITERATE_NEXT

public static final java.lang.String ITERATE_NEXT
See Also:
Constant Field Values

ITERATE_END

public static final java.lang.String ITERATE_END
See Also:
Constant Field Values

GET_DATA

public static final java.lang.String GET_DATA
See Also:
Constant Field Values

SET_ATTR

public static final java.lang.String SET_ATTR
See Also:
Constant Field Values

DISCARD

public static final java.lang.String DISCARD
See Also:
Constant Field Values

cmd

protected java.lang.String cmd

modelName

protected java.lang.String modelName

keyName

protected java.lang.String keyName

keyData

protected java.lang.String keyData
Constructor Detail

TemplateDirective

protected TemplateDirective()
Method Detail

getCommand

public java.lang.String getCommand()

getModelName

public java.lang.String getModelName()

getKeyName

public java.lang.String getKeyName()

getKeyData

public java.lang.String getKeyData()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAllInstances

public static java.util.List getAllInstances(java.lang.String sourceStr)
Given a space delimited string of directive commands, convert each segment into a TemplateDirective and return all the valid directives in a List. Invalid directives are silently ignored.

Parameters:
sourceStr - a space delimited string of directive commands
Returns:
a List of TemplateDirectives

getInstance

public static TemplateDirective getInstance(java.lang.String sourceStr)
                                     throws InvalidDirectiveException
Given a string of the form Dir::<command>.<model>.<key>.<props>... convert it into a TemplateDirective and return that object.

Parameters:
sourceStr - a space delimited string of directive commands
Returns:
the corresponding TemplateDirectives
Throws:
InvalidDirectiveException - if the String cannot be converted

main

public static void main(java.lang.String[] args)


Copyright © 2001 Enhydra.org