1 /** 2 * org/ozone-db/xml/XMLElementFactory.java 3 * 4 * The contents of this file are subject to the OpenXML Public 5 * License Version 1.0; you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at 7 * http://www.openxml.org/license.html 8 * 9 * 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 */ 25 26 package org.ozoneDB.xml; 27 28 import org.w3c.dom.*; 29 30 31 /** 32 * Defines an element factory for constructing new elements. An application 33 * document may elect to use this factory to create user elements derived 34 * from the class {@link XMLElement}. This is an alternative to the simple 35 * tag name to class mapping that is supported by {@link XMLDocument}. 36 * <P> 37 * The {@link #createElement} will be called to create any element and may 38 * behave in one of three manners: 39 * <UL> 40 * <LI>Create and return a new element from a class that extends {@link 41 * XMLElement} 42 * <LI>Return null and an element will be created from {@link XMLElement} 43 * <LI>Throw an exception to indicate that elements of this type are not 44 * supported in this document (this behavior is highly discouraged) 45 * </UL> 46 * 47 * 48 * @version $Revision: 1.1 $ $Date: 2003/11/02 17:26:13 $ 49 * @author <a HREF="mailto:arkin@trendline.co.il">Assaf Arkin</a> 50 * @see XMLDocument#useElementFactory 51 * @see XMLElement 52 * @deprecated Alternative API will be introduced in OpenXML 1.1 53 */ 54 public interface XMLElementFactory { 55 56 57 /** 58 * Called to create an element with the specified tag name. Returned element 59 * is of class derived from {@link XMLElement}. If null is returned, an 60 * element of type {@link XMLElement} will be created. 61 * <P> 62 * When creating a new element, the parameters <TT>owner</TT> and 63 * <TT>tagName</TT> must be passed as is to the {@link XMLElement} 64 * constructor. 65 * 66 * @param owner The owner document 67 * @param tagName The element tag name 68 * @return New element or null 69 */ 70 public XMLElement createElement( XMLDocument owner, String tagName ); 71 72 } 73