01: /*
02: * Copyright 2002-2006 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:
21: import org.springframework.beans.factory.BeanDefinitionStoreException;
22:
23: /**
24: * SPI for parsing an XML document that contains Spring bean definitions.
25: * Used by XmlBeanDefinitionReader for actually parsing a DOM document.
26: *
27: * <p>Instantiated per document to parse: Implementations can hold
28: * state in instance variables during the execution of the
29: * <code>registerBeanDefinitions</code> method, for example global
30: * settings that are defined for all bean definitions in the document.
31: *
32: * @author Juergen Hoeller
33: * @author Rob Harrop
34: * @since 18.12.2003
35: * @see XmlBeanDefinitionReader#setDocumentReaderClass
36: */
37: public interface BeanDefinitionDocumentReader {
38:
39: /**
40: * Read bean definitions from the given DOM document,
41: * and register them with the given bean factory.
42: * @param doc the DOM document
43: * @param readerContext the current context of the reader. Includes the resource being parsed
44: * @throws BeanDefinitionStoreException in case of parsing errors
45: */
46: void registerBeanDefinitions(Document doc,
47: XmlReaderContext readerContext)
48: throws BeanDefinitionStoreException;
49:
50: }
|