View Javadoc

1   package org.lcsim.util.xml;
2   
3   import org.jdom.Element;
4   import org.jdom.JDOMException;
5   
6   /**
7    * An interface that must be implemented by all element factories.
8    * 
9    * By providing their own implementation of ElementFactory users can cause custom classes to be
10   * created by the reader.
11   * @author tonyj
12   * @version $Id: ElementFactory.java,v 1.1 2005/07/15 02:54:58 jeremy Exp $
13   */
14  public interface ElementFactory
15  {
16     <T> T createElement(Class<T> c, Element node, String type) throws JDOMException, ElementCreationException;
17     public static class ElementCreationException extends Exception
18     {
19        ElementCreationException(String message)
20        {
21           super(message);
22        }
23        ElementCreationException(String message, Throwable cause)
24        {
25           super(message,cause);
26        }
27     }
28  }