com.threerings.cast.tools.xml
Class ActionRuleSet

java.lang.Object
  extended by org.apache.commons.digester.RuleSetBase
      extended by com.threerings.cast.tools.xml.ActionRuleSet
All Implemented Interfaces:
org.apache.commons.digester.RuleSet

public class ActionRuleSet
extends org.apache.commons.digester.RuleSetBase

The action rule set is used to parse the attributes of an action sequence instance.


Field Summary
protected  String _prefix
          The prefix at which me match our actions.
static String ACTION_PATH
          The component of the digester path that is appended by the action rule set to match a action.
 
Fields inherited from class org.apache.commons.digester.RuleSetBase
namespaceURI
 
Constructor Summary
ActionRuleSet()
           
 
Method Summary
 void addRuleInstances(org.apache.commons.digester.Digester digester)
          Adds the necessary rules to the digester to parse our actions.
 void setPrefix(String prefix)
          Instructs the action rule set to match actions with the supplied prefix.
static String validate(ActionSequence seq)
          Validates that all necessary fields have been parsed and set in this action sequence object and are valid.
 
Methods inherited from class org.apache.commons.digester.RuleSetBase
getNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_PATH

public static final String ACTION_PATH
The component of the digester path that is appended by the action rule set to match a action. This is appended to whatever prefix is provided to the action rule set to obtain the complete XML path to a matched action.

See Also:
Constant Field Values

_prefix

protected String _prefix
The prefix at which me match our actions.

Constructor Detail

ActionRuleSet

public ActionRuleSet()
Method Detail

setPrefix

public void setPrefix(String prefix)
Instructs the action rule set to match actions with the supplied prefix. For example, passing a prefix of actions will match actions in the following XML file:
 <actions>
   <action>
     // ...
   </action>
 </actions>
 
This must be called before adding the ruleset to a digester.


addRuleInstances

public void addRuleInstances(org.apache.commons.digester.Digester digester)
Adds the necessary rules to the digester to parse our actions.

Specified by:
addRuleInstances in interface org.apache.commons.digester.RuleSet
Specified by:
addRuleInstances in class org.apache.commons.digester.RuleSetBase

validate

public static String validate(ActionSequence seq)
Validates that all necessary fields have been parsed and set in this action sequence object and are valid.

Returns:
null if the sequence is valid, a string explaining the invalidity if it is not.