01: /**
02: * org/ozone-db/xml/XMLElementFactory.java
03: *
04: * The contents of this file are subject to the OpenXML Public
05: * License Version 1.0; you may not use this file except in compliance
06: * with the License. You may obtain a copy of the License at
07: * http://www.openxml.org/license.html
08: *
09: * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
10: * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
11: * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
12: * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
13: * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
14: * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
15: *
16: * The Initial Developer of this code under the License is Assaf Arkin.
17: * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
18: * All Rights Reserved.
19: */
20:
21: /**
22: * Changes for Persistent DOM running with ozone are
23: * Copyright 1999 by SMB GmbH. All rights reserved.
24: */package org.ozoneDB.xml;
25:
26: import org.w3c.dom.*;
27:
28: /**
29: * Defines an element factory for constructing new elements. An application
30: * document may elect to use this factory to create user elements derived
31: * from the class {@link XMLElement}. This is an alternative to the simple
32: * tag name to class mapping that is supported by {@link XMLDocument}.
33: * <P>
34: * The {@link #createElement} will be called to create any element and may
35: * behave in one of three manners:
36: * <UL>
37: * <LI>Create and return a new element from a class that extends {@link
38: * XMLElement}
39: * <LI>Return null and an element will be created from {@link XMLElement}
40: * <LI>Throw an exception to indicate that elements of this type are not
41: * supported in this document (this behavior is highly discouraged)
42: * </UL>
43: *
44: *
45: * @version $Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
46: * @author <a href="mailto:arkin@trendline.co.il">Assaf Arkin</a>
47: * @see XMLDocument#useElementFactory
48: * @see XMLElement
49: * @deprecated Alternative API will be introduced in OpenXML 1.1
50: */
51: public interface XMLElementFactory {
52:
53: /**
54: * Called to create an element with the specified tag name. Returned element
55: * is of class derived from {@link XMLElement}. If null is returned, an
56: * element of type {@link XMLElement} will be created.
57: * <P>
58: * When creating a new element, the parameters <TT>owner</TT> and
59: * <TT>tagName</TT> must be passed as is to the {@link XMLElement}
60: * constructor.
61: *
62: * @param owner The owner document
63: * @param tagName The element tag name
64: * @return New element or null
65: */
66: public XMLElement createElement(XMLDocument owner, String tagName);
67:
68: }
|