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:
- <command> = the name of the command (custom directives are allowed)
- <model> = the name of the model
- <key> = the name of the key within the model
- <data> = any additional data (in any format) that may be associated with the directive
As an example, the following are valid directives:
- Dir::Get_Data.UserData.FirstName
- Dir::Get_Data.UserData.LastName
- Dir::Get_Data.Iterate_Start.UserData..max=50&min=25&foo=bar
- Dir::Get_Data.Iterate_End
- Dir::Custom_Directive.UserData..do=something
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 |
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
TemplateDirective
protected TemplateDirective()
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