1 /*------------------------------------------------------------------------- 2 Copyright 2006 Olivier Berlanger 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 -------------------------------------------------------------------------*/ 16 package net.sf.xolite; 17 18 19 /** 20 * Interface for a factory able to create Objects corresponding to a given XML element (or attribute). 21 */ 22 public interface XMLObjectFactory { 23 24 25 /** 26 * Create an object corresponding to the XML element of the given name. 27 * 28 * @param namespaceUri 29 * the namespace URI of the XML element. 30 * @param localName 31 * the local name of the XML element. 32 * @param parser 33 * The current XML event parser, it is only used to have a locator of the current line in case of exception. (you 34 * can pass null if you don't need line reporting). 35 * @exception XMLParseException 36 * if the object is not defined or cannot be instantiated. 37 */ 38 public XMLSerializable createObject(String namespaceUri, String localName, XMLEventParser parser) throws XMLParseException; 39 40 41 }