01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.beans.factory.xml;
18:
19: import org.w3c.dom.Document;
20: import org.xml.sax.EntityResolver;
21: import org.xml.sax.ErrorHandler;
22: import org.xml.sax.InputSource;
23:
24: /**
25: * Strategy interface for loading an XML {@link Document}.
26: *
27: * @author Rob Harrop
28: * @since 2.0
29: * @see DefaultDocumentLoader
30: */
31: public interface DocumentLoader {
32:
33: /**
34: * Load a {@link Document document} from the supplied {@link InputSource source}.
35: * @param inputSource the source of the document that is to be loaded
36: * @param entityResolver the resolver that is to be used to resolve any entities
37: * @param errorHandler used to report any errors during document loading
38: * @param validationMode the type of validation ({@link XmlBeanDefinitionReader#VALIDATION_NONE none}, {@link XmlBeanDefinitionReader#VALIDATION_DTD DTD}, or {@link XmlBeanDefinitionReader#VALIDATION_XSD XSD})
39: * @param namespaceAware <code>true</code> if the loading is provide support for XML namespaces
40: * @return the loaded {@link Document document}
41: * @throws Exception if an error occurs
42: */
43: Document loadDocument(InputSource inputSource,
44: EntityResolver entityResolver, ErrorHandler errorHandler,
45: int validationMode, boolean namespaceAware)
46: throws Exception;
47:
48: }
|