Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2005 Ralf Joachim
*
* 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 org.exolab.castor.mapping;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.castor.core.util.Messages;
import org.castor.mapping.MappingSource;
import org.exolab.castor.mapping.xml.MappingRoot;
import org.exolab.castor.net.util.URIUtils;
import org.exolab.castor.util.DTDResolver;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* Utility class for loading mapping files and providing them to the XML marshaller, JDO engine etc.
* The mapping file can be loaded from a URL, input stream or SAX InputSource.
*
* Multiple mapping files can be loaded with the same Mapping object. When loading master
* mapping files that include other mapping files it might be convenient to use {@link #setBaseURL}
* or {@link #setEntityResolver}.
*
* If the desired class loader is different than the one used by Castor (e.g. if Castor is installed
* as a Java extension), the Mapping object can be constructed with the proper class
* loader.
*
* The following example loads two mapping files:
*
*
*
* @author Assaf Arkin
* @author Ralf Joachim
* @version $Revision$ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
*/
public final class Mapping {
// --------------------------------------------------------------------------
/**
* The Jakarta Commons Logging instance
* used for all logging.
*/
private static final Log LOG = LogFactory.getLog(Mapping.class);
private static final String DEFAULT_SOURCE_TYPE = "CastorXmlMapping";
/** List of mapping sources to resolve. */
private final List _mappings = new ArrayList<>();
/** Set of processed systemID's. */
private final Set