KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > PropertyProvider


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/PropertyProvider.java,v 1.3 2004/07/28 09:35:11 ib Exp $
3  * $Revision: 1.3 $
4  * $Date: 2004/07/28 09:35:11 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23 package org.apache.slide.search;
24
25 // import list
26
import org.apache.slide.common.SlideException;
27
28 import org.apache.slide.content.NodeProperty;
29
30 import java.util.Iterator JavaDoc;
31
32 /**
33  * If a PropertyProvider is passed to {@link org.apache.slide.search.Search#createSearchQuery
34  * Search.createSearchQuery()}, the Search helper must not access any of the properties
35  * {@link #isSupportedProperty supported by this PropertyProvider} directly (e.g.
36  * by using the Content helper) but instead use {@link #getProperty getProperty()}
37  * on this provider to retrieve it.
38  *
39  * @version $Revision: 1.3 $
40  *
41  **/

42 public interface PropertyProvider {
43     
44     /**
45      * Returns <code>true</code> if this PropertyProvider can provide the NodeProperty
46      * specified by <code>propertyNamespace</code> and <code>propertyName</code>
47      * for the resource with the given <code>resourceUri</code>.
48      *
49      * @param resourceUri the URI of the resource.
50      * @param propertyName the name of the property.
51      * @param propertyNamespace the namespace of the property.
52      *
53      * @return <code>true</code> if this PropertyProvider can provide the NodeProperty.
54      *
55      * @throws SlideException
56      */

57     public boolean isSupportedProperty(String JavaDoc resourceUri, String JavaDoc propertyName, String JavaDoc propertyNamespace) throws SlideException;
58
59
60     /**
61      * Returns an Iterator of PropertyName of all properties supported by this
62      * PropertyProvider.
63      *
64      * @param resourceUri the URI of the resource for which to return
65      * the supported PropertyNames.
66      *
67      * @return an Iterator of PropertyName.
68      *
69      * @throws SlideException
70      */

71     public Iterator JavaDoc getSupportedPropertiesNames(String JavaDoc resourceUri) throws SlideException;
72     
73     /**
74      * If the property specified by <code>propertyNamespace</code> and
75      * <code>propertyName</code> is {@link #isSupportedProperty supported
76      * by this PropertyProvider}, the NodeProperty of the resource located
77      * at the given <code>resourceUri</code> will be returned. Otherwise
78      * <code>null</code> is returned.
79      *
80      * @param resourceUri the URI of the resource for which to return
81      * the NodeProperty.
82      * @param propertyName the name of the property to return.
83      * @param propertyNamespace the namespace of the property to return.
84      *
85      * @return the requested NodeProperty if it is supported, otherwise
86      * <code>null</code>.
87      *
88      * @throws SlideException
89      */

90     public NodeProperty getProperty(String JavaDoc resourceUri, String JavaDoc propertyName, String JavaDoc propertyNamespace) throws SlideException;
91     
92     /**
93      * Returns an Iterator of all NodeProperties supported by this PropertyProvider.
94      *
95      * @param resourceUri the URI of the resource for which to return
96      * the supported properties.
97      *
98      * @return all NodeProperties supported by this provider.
99      *
100      * @throws SlideException
101      */

102     public Iterator JavaDoc getSupportedProperties(String JavaDoc resourceUri) throws SlideException;
103     
104
105 }
106
107
Popular Tags