All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.xolite.XMLObjectFactory Maven / Gradle / Ivy

Go to download

This project provides a lightweight framework to serialize/deserialize (or marshall/unmarshall) java objects into XML. The implementation is based on standard SAX (Simple Api for Xml) but it follows a original approach based on the strong data encapsulation paradigm of Object Oriented (OO) programming.

The newest version!
/*-------------------------------------------------------------------------
 Copyright 2006 Olivier Berlanger

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 -------------------------------------------------------------------------*/
package net.sf.xolite;


/**
 * Interface for a factory able to create Objects corresponding to a given XML element (or attribute).
 */
public interface XMLObjectFactory {


    /**
     * Create an object corresponding to the XML element of the given name.
     * 
     * @param namespaceUri
     *            the namespace URI of the XML element.
     * @param localName
     *            the local name of the XML element.
     * @param parser
     *            The current XML event parser, it is only used to have a locator of the current line in case of exception. (you
     *            can pass null if you don't need line reporting).
     * @exception XMLParseException
     *                if the object is not defined or cannot be instantiated.
     */
    public XMLSerializable createObject(String namespaceUri, String localName, XMLEventParser parser) throws XMLParseException;


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy