KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > SourceInspector


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
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 package org.apache.cocoon.components.source;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.apache.cocoon.components.source.helpers.SourceProperty;
20 import org.apache.excalibur.source.Source;
21 import org.apache.excalibur.source.SourceException;
22 import org.apache.excalibur.source.SourceValidity;
23
24 /**
25  * A source inspector exposes source properties.
26  *
27  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels</a>
28  * @author <a HREF="mailto:unico@apache.org">Unico Hommes</a>
29  * @version CVS $Id: SourceInspector.java 30932 2004-07-29 17:35:38Z vgritsenko $
30  */

31 public interface SourceInspector extends Component {
32
33     public final static String JavaDoc ROLE = "org.apache.cocoon.components.source.SourceInspector";
34
35     /**
36      * Gets the SourceProperty associated with the given Source identified
37      * by the requested namespace and name.
38      *
39      * @param source the source for which to compute the property
40      * @param namespace the namespace of the property
41      * @param name the name of the property
42      * @return the SourceProperty associated with the Source, <code>null</code>
43      * if the inspector does not provide this property.
44      * @throws SourceException
45      */

46     public SourceProperty getSourceProperty(Source source, String JavaDoc namespace, String JavaDoc name)
47         throws SourceException;
48
49     /**
50      * Gets all the SourceProperties associated with the given Source.
51      *
52      * @param source the Source for wich to compute the property.
53      * @return the collection of all SourceProperties that could be computed
54      * by this SourceInspector.
55      * @throws SourceException
56      */

57     public SourceProperty[] getSourceProperties(Source source) throws SourceException;
58     
59     /**
60      * Check if this inspector handles the property of the given type.
61      *
62      * @param namespace the namespace of the property
63      * @param name the name of the property
64      * @return <code>true</code> if this inspector handles properties of the given type
65      * else <code>false</code>.
66      */

67     public boolean handlesProperty(String JavaDoc namespace, String JavaDoc name);
68     
69     /**
70      * Get the validity object that describes the validity state
71      * of the properties belonging to the given source.
72      *
73      * @param source the Source for which to calculate the validity
74      * its properties, <code>null</code> if the source properties
75      * are not cacheable.
76      */

77     public SourceValidity getValidity(Source source);
78 }
79
80
Popular Tags