01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.util;
06:
07: import com.opensymphony.workflow.InvalidWorkflowDescriptorException;
08:
09: /**
10: * Abstact base class for elements that can be validated.
11: *
12: * @author <a href="mailto:vorburger@users.sourceforge.net">Michael Vorburger</a>
13: * @version $Revision: 1.2 $
14: */
15: public interface Validatable {
16: //~ Methods ////////////////////////////////////////////////////////////////
17:
18: /**
19: * Validate this element, and propagate validation to all contained sub-elements.
20: * Should throw an InvalidWorkflowDescriptorException with details in message if the element
21: * is invalid. Validity checks should be checks that cannot be encapsulated in the DTD.
22: *
23: * Validation has to be called explicitly on writting, a writeXML() does not validate implicitly;
24: * it *IS* thus possible to write invalid descriptor files. This could be useful for e.g.
25: * a graphical workflow definition editor which would like to write incomplete definitions.
26: * Validation *IS* performed on loading a workflow definition.
27: *
28: * @see com.opensymphony.workflow.loader.WorkflowLoader#load
29: * @throws InvalidWorkflowDescriptorException
30: */
31: public void validate() throws InvalidWorkflowDescriptorException;
32: }
|