com.samskivert.xml
Class ValidatedSetNextRule

java.lang.Object
  extended by org.apache.commons.digester.Rule
      extended by com.samskivert.xml.ValidatedSetNextRule

public class ValidatedSetNextRule
extends org.apache.commons.digester.Rule

Like the SetNextRule except that the object on the top of the stack is validated before the set next method is called. If the object is determined not to be valid, the set next method will not be called (and the assumption is that the validator will have emitted some useful error message indicating to the user why the object was invalid).


Nested Class Summary
static interface ValidatedSetNextRule.Validator
          An implementor if this interface will be used to determine whether the object on the top of the stack is valid before it is "set next"ed.
 
Field Summary
protected  String _methodName
           
protected  Class<?> _paramType
           
protected  ValidatedSetNextRule.Validator _validator
           
 
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
 
Constructor Summary
ValidatedSetNextRule(String methodName, Class<?> paramType, ValidatedSetNextRule.Validator validator)
          Constructs a set method rule for the specified method with the specified parameter type.
ValidatedSetNextRule(String methodName, ValidatedSetNextRule.Validator validator)
          Constructs a set method rule for the specified method.
 
Method Summary
 void end(String namespace, String name)
           
 String toString()
          Render a printable version of this rule.
 
Methods inherited from class org.apache.commons.digester.Rule
begin, begin, body, body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_methodName

protected String _methodName

_paramType

protected Class<?> _paramType

_validator

protected ValidatedSetNextRule.Validator _validator
Constructor Detail

ValidatedSetNextRule

public ValidatedSetNextRule(String methodName,
                            ValidatedSetNextRule.Validator validator)
Constructs a set method rule for the specified method.


ValidatedSetNextRule

public ValidatedSetNextRule(String methodName,
                            Class<?> paramType,
                            ValidatedSetNextRule.Validator validator)
Constructs a set method rule for the specified method with the specified parameter type.

Method Detail

end

public void end(String namespace,
                String name)
         throws Exception
Overrides:
end in class org.apache.commons.digester.Rule
Throws:
Exception

toString

public String toString()
Render a printable version of this rule.

Overrides:
toString in class Object


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.