KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > resolver > ComponentSpecificationResolver


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.resolver;
16
17 import org.apache.hivemind.Location;
18 import org.apache.tapestry.INamespace;
19 import org.apache.tapestry.IRequestCycle;
20 import org.apache.tapestry.spec.IComponentSpecification;
21
22 /**
23  * Service interface for locating component specifications.
24  *
25  * @author Howard Lewis Ship
26  * @since 4.0
27  */

28 public interface ComponentSpecificationResolver
29 {
30     /**
31      * Passed the namespace of a container (to resolve the type in) and the type to resolve,
32      * performs the processing. A "bare type" (without a library prefix) may be in the
33      * containerNamespace, or the framework namespace (a search occurs in that order).
34      *
35      * @param cycle
36      * current request cycle
37      * @param containerNamespace
38      * namespace that may contain a library referenced in the type
39      * @param type
40      * the component specification to find, either a simple name, or prefixed with a
41      * library id (defined for the container namespace)
42      * @see #getNamespace()
43      * @see #getSpecification()
44      */

45     public void resolve(IRequestCycle cycle, INamespace containerNamespace, String JavaDoc type,
46             Location location);
47
48     /**
49      * Like
50      * {@link #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, org.apache.tapestry.ILocation)},
51      * but used when the type has already been parsed into a library id and a simple type.
52      *
53      * @param cycle
54      * current request cycle
55      * @param containerNamespace
56      * namespace that may contain a library referenced in the type
57      * @param libraryId
58      * the library id within the container namespace, or null
59      * @param type
60      * the component specification to find as a simple name (without a library prefix)
61      * @param location
62      * of reference to be resolved
63      * @throws ApplicationRuntimeException
64      * if the type cannot be resolved
65      */

66     public void resolve(IRequestCycle cycle, INamespace containerNamespace, String JavaDoc libraryId,
67             String JavaDoc type, Location location);
68
69     /**
70      * The specification resolved by the resolve() method.
71      */

72     public IComponentSpecification getSpecification();
73
74     /**
75      * The namespace containing the resolved component.
76      */

77     public INamespace getNamespace();
78
79     /**
80      * Returns the unqualified type of the component (i.e., with any namespace prefix stripped off).
81      */

82     public String JavaDoc getType();
83 }
Popular Tags