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