commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/xml ValidationHandler.java
Date Thu, 07 Feb 2002 05:03:38 GMT
dion        02/02/06 21:03:38

  Modified:    latka/src/java/org/apache/commons/latka/xml
                        ValidationHandler.java
  Log:
  More javadoc
  
  Revision  Changes    Path
  1.6       +79 -48    jakarta-commons/latka/src/java/org/apache/commons/latka/xml/ValidationHandler.java
  
  Index: ValidationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/xml/ValidationHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ValidationHandler.java	23 Aug 2001 16:24:27 -0000	1.5
  +++ ValidationHandler.java	7 Feb 2002 05:03:38 -0000	1.6
  @@ -72,55 +72,86 @@
   import org.xml.sax.SAXParseException;
   import org.xml.sax.XMLReader;
   
  +/**
  + * A base class for validation tags
  + *
  + * @author Morgan Delagrange
  + * @author dIon Gillard
  + * @version $Id: ValidationHandler.java,v 1.6 2002/02/07 05:03:38 dion Exp $
  + */
   public abstract class ValidationHandler extends BasicDelegateHandler {
   
  -  private Response _response = null;
  -  private LatkaEventListener _listener = null;
  -  private String _tagName = null;
  -
  -  /**
  -   * Called by the ValidationFactory.
  -   * 
  -   * @param reader
  -   * @param response
  -   * @param _listener
  -   */
  -  void init(XMLReader reader, Response response,
  -                         LatkaEventListener listener, String tagName) {
  -    super.init(reader);
  -    _response = response;
  -    _listener = listener;
  -    _tagName = tagName;
  -  }
  -
  -  public Response getResponse() {
  -    return _response;
  -  }
  -
  -  public void validate(Validator validator) {
  -    log.debug("performing custom validation");
  -    log.debug("validator = " + validator);
  -    log.debug("response = " + _response);
  -    try {
  -      validator.validate(_response);
  -    } catch (ValidationException e) {
  -      _listener.requestFailed(new RequestFailedEvent(_response.getRequest(),_response,e));
  -    }
  -
  -    log.debug("custom validation complete");
  -    release();
  -  }
  +    /** the response being validated */
  +    private Response _response = null;
  +    /** the listener handling request success/failure etc */
  +    private LatkaEventListener _listener = null;
  +    /** name of the validating tag */
  +    private String _tagName = null;
  +
  +    /**
  +     * Called by the ValidationFactory.
  +     *
  +     * @param listener supplier of information about the suite/progress
  +     * @param tagName name of the validating tag
  +     * @param reader xml to process 
  +     * @param response response to validate
  +     */
  +    void init(XMLReader reader, Response response, LatkaEventListener listener,
  +              String tagName) {
  +        super.init(reader);
  +        _response = response;
  +        _listener = listener;
  +        _tagName = tagName;
  +    }
  +
  +    /**
  +     * the response being validated
  +     * @return the response being validated
  +     */
  +    public Response getResponse() {
  +        return _response;
  +    }
  +
  +    /**
  +     * validate the response using the validator provided
  +     * @param validator the object that performs validation
  +     */
  +    public void validate(Validator validator) {
  +        log.debug("performing custom validation");
  +        log.debug("validator = " + validator);
  +        log.debug("response = " + _response);
  +        try {
  +            validator.validate(_response);
  +        } catch (ValidationException e) {
  +            _listener.requestFailed(
  +                new RequestFailedEvent(_response.getRequest(), _response, e));
  +        }
  +
  +        log.debug("custom validation complete");
  +        release();
  +    }
     
  -  public String getTagName() {
  -    return _tagName;
  -  }
  -
  -  public void error(SAXParseException e) throws SAXException {
  -    throw e;
  -  }
  -
  -  public void warning(SAXParseException e) throws SAXException {
  -    throw e;
  -  }
  +    /**
  +     * @return  the name of the tag
  +     */
  +    public String getTagName() {
  +        return _tagName;
  +    }
  +
  +    /**
  +     * @param e error that has occurred
  +     * @throws SAXException to indicate the error has occurred
  +     */
  +    public void error(SAXParseException e) throws SAXException {
  +        throw e;
  +    }
  +
  +    /**
  +     * @param e error that has occurred
  +     * @throws SAXException to indicate the error has occurred
  +     */
  +    public void warning(SAXParseException e) throws SAXException {
  +        throw e;
  +    }
   
  -}
  +}
  \ No newline at end of file
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message