/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* 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
*
*
* 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.
*/
/**
* This class wraps DOM entity resolver to XNI entity resolver.
*
* @see LSResourceResolver
*
* @author Gopal Sharma, SUN MicroSystems Inc.
* @author Elena Litani, IBM
* @author Ramesh Mandava, Sun Microsystems
*/
public class DOMEntityResolverWrapper
implements XMLEntityResolver {
//
// Data
//
/** XML 1.0 type constant according to DOM L3 LS CR spec "http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107" */
/** XML Schema constant according to DOM L3 LS CR spec "http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107" */
/** The DOM entity resolver. */
//
// Constructors
//
/** Default constructor. */
public DOMEntityResolverWrapper() {}
/** Wraps the specified DOM entity resolver. */
} // LSResourceResolver
//
// Public methods
//
/** Sets the DOM entity resolver. */
} // setEntityResolver(LSResourceResolver)
/** Returns the DOM entity resolver. */
return fEntityResolver;
} // getEntityResolver():LSResourceResolver
//
// XMLEntityResolver methods
//
/**
* Resolves an external parsed entity. If the entity cannot be
* resolved, this method should return null.
*
* @param resourceIdentifier description of the resource to be revsoved
* @throws XNIException Thrown on general error.
* @throws IOException Thrown if resolved entity stream cannot be
* opened or some other i/o error occurs.
*/
throws XNIException, IOException {
// resolve entity using DOM entity resolver
if (fEntityResolver != null) {
// For entity resolution the type of the resource would be XML TYPE
// DOM L3 LS spec mention only the XML 1.0 recommendation right now
null,
null,
null,
null,
null)
if (inputSource != null) {
/**
* An LSParser looks at inputs specified in LSInput in
* the following order: characterStream, byteStream,
* stringData, systemId, publicId.
*/
if (charStream != null) {
}
else if (byteStream != null) {
}
}
return xmlInputSource;
}
}
// unable to resolve entity
return null;
} // resolveEntity(String,String,String):XMLInputSource
/** Determines the type of resource being resolved **/
if (resourceIdentifier instanceof XMLGrammarDescription) {
return XSD_TYPE;
}
}
return XML_TYPE;
} // getType(XMLResourceIdentifier):String
} // DOMEntityResolverWrapper