01: // Copyright 2006 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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.services;
16:
17: /**
18: * Used to configure the {@link ComponentClassResolver}, to allow it to map prefixes to library
19: * root packages (the application namespace is a special case of this). In each case, a prefix on
20: * the path is mapped to a package. Prefixes should start with a character and end with a slash, as
21: * in "core". The root package name should have two sub-packages: "pages" to contain named pages,
22: * and "components" to contain named components.
23: *
24: *
25: */
26: public final class LibraryMapping {
27: private final String _pathPrefix;
28:
29: private final String _rootPackage;
30:
31: public LibraryMapping(String pathPrefix, String rootPackage) {
32: _pathPrefix = pathPrefix;
33: _rootPackage = rootPackage;
34: }
35:
36: public String getPathPrefix() {
37: return _pathPrefix;
38: }
39:
40: public String getRootPackage() {
41: return _rootPackage;
42: }
43:
44: @Override
45: public String toString() {
46: return String.format("LibraryMapping[%s, %s]", _pathPrefix,
47: _rootPackage);
48: }
49: }
|