KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > beans > factory > parsing > ImportDefinition


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.parsing;
18
19 import org.springframework.beans.BeanMetadataElement;
20 import org.springframework.util.Assert;
21
22 /**
23  * Representation of an import that has been processed during the parsing process.
24  *
25  * @author Juergen Hoeller
26  * @since 2.0
27  * @see ReaderEventListener#importProcessed(ImportDefinition)
28  */

29 public class ImportDefinition implements BeanMetadataElement {
30
31     private final String JavaDoc importedResource;
32
33     private final Object JavaDoc source;
34
35
36     /**
37      * Create a new ImportDefinition.
38      * @param importedResource the location of the imported resource
39      */

40     public ImportDefinition(String JavaDoc importedResource) {
41         this(importedResource, null);
42     }
43
44     /**
45      * Create a new ImportDefinition.
46      * @param importedResource the location of the imported resource
47      * @param source the source object (may be <code>null</code>)
48      */

49     public ImportDefinition(String JavaDoc importedResource, Object JavaDoc source) {
50         Assert.notNull(importedResource, "Imported resource must not be null");
51         this.importedResource = importedResource;
52         this.source = source;
53     }
54
55
56     /**
57      * Return the location of the imported resource.
58      */

59     public String JavaDoc getImportedResource() {
60         return importedResource;
61     }
62
63     public Object JavaDoc getSource() {
64         return source;
65     }
66
67 }
68
Popular Tags