KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > core > util > dom > DOMLoader


1 /*
2  * Copyright (C) 2001 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: DOMLoader.java,v 1.8 2004/01/29 18:02:35 christianc Exp $
19  */

20 package org.enhydra.barracuda.core.util.dom;
21
22 import java.io.IOException JavaDoc;
23 import java.util.Locale JavaDoc;
24 import org.w3c.dom.Document JavaDoc;
25
26
27 /**
28  * This interface defines the methods needed to implement a DOMLoader. A dom
29  * loader is used to front various dom factory implementations.
30  *
31  * <p>Note that the behavior of the getDOM() methods depend upon the
32  * backing dom factory implementation(s).
33  * Some dom factories only support loading documents from a
34  * {@link getDOM(Class) class}, others from a
35  * {@link getDOM(String) document path}, while others may support both.
36  * Likewise, dom loader implementations may support one or both. Dom
37  * loader implementations must provide at least one backing dom factory
38  * and should provide a way for runtime configuration of one or more dom
39  * factories.</p>
40  *
41  * <p>Where Implementations do not support a particular getDOM() method, they
42  * should simply throw an IOException and document their lack of support.</p>
43  *
44  * @see DOMFactory
45  */

46 public interface DOMLoader {
47     /**
48      * Get the DOM associated with the provided class, based on the default
49      * locale
50      *
51      * @param clazz the class to be loaded as a Document object
52      * @return the document that most closely corresponds with the requested
53      * class/locale combination
54      * @throws IOException
55      * @see DOMFactory#getInstance(Class)
56      */

57     public Document JavaDoc getDOM(Class JavaDoc clazz) throws IOException JavaDoc;
58     
59     /**
60      * Get the DOM associated with the provided class, based on the specified
61      * locale
62      *
63      * @param clazz the class to be loaded as a Document object
64      * @param locale the target Locale (may be null)
65      * @return the document that most closely corresponds with the requested
66      * class/locale combination
67      * @throws IOException
68      * @see DOMFactory#getInstance(Class)
69      */

70     public Document JavaDoc getDOM(Class JavaDoc clazz, Locale JavaDoc locale) throws IOException JavaDoc;
71     
72     /**
73      * Get the DOM associated with the provided document path, based on the
74      * default locale
75      *
76      * @param docPath the path to the document to be loaded as a Document object
77      * @return the document that most closely corresponds with the requested
78      * docPath/locale combination
79      * @throws IOException
80      * @see DOMFactory#getInstance(String)
81      */

82     public Document JavaDoc getDOM(String JavaDoc docPath) throws IOException JavaDoc;
83     
84     /**
85      * Get the DOM associated with the provided document path, based on the
86      * specified Locale
87      *
88      * @param docPath the path to the document to be loaded as a Document object
89      * @param locale the target Locale (may be null)
90      * @return the document that most closely corresponds with the requested
91      * docPath/locale combination
92      * @throws IOException
93      * @see DOMFactory#getInstance(String)
94      */

95     public Document JavaDoc getDOM(String JavaDoc docPath, Locale JavaDoc locale) throws IOException JavaDoc;
96 }
97
Popular Tags