01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.jetspeed.rewriter.rules;
18:
19: /**
20: * Rule
21: *
22: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
23: * @version $Id: Rule.java 516448 2007-03-09 16:25:47Z ate $
24: */
25: public interface Rule extends Identified {
26: /**
27: * Flag indicating whether to use the Base URL for this rewriter.
28: * The default setting is true, use the rewriter's Base URL.
29: *
30: * @return true if this rule uses the Base URL
31: */
32: boolean getUseBase();
33:
34: /**
35: * Flag indicating whether to use the Base URL for this rewriter.
36: * The default setting is true, use the rewriter's Base URL.
37: *
38: * @param true if this rule uses the Base URL
39: */
40: void setUseBase(boolean flag);
41:
42: /**
43: * Suffix string to append to the rewritten URL.
44: *
45: * @return the value of the suffix string.
46: */
47: String getSuffix();
48:
49: /**
50: * Suffix string to append to the rewritten URL.
51: *
52: * @param the value of the suffix string.
53: */
54: void setSuffix(String suffix);
55:
56: /**
57: * Flag indicating whether to rewrite links as popups.
58: * The default setting is false, do not rewrite as a popup.
59: *
60: * @return true if this rule rewrites links as popups
61: */
62: boolean getPopup();
63:
64: /**
65: * Flag indicating whether to rewrite links as popups.
66: * The default setting is false, do not rewrite as a popup.
67: *
68: * @param true if this rule rewrites links as popups
69: */
70: void setPopup(boolean flag);
71:
72: /**
73: * Checks to see if a URL should be rewritten or not.
74: *
75: * @param url
76: */
77: boolean shouldRewrite(String url);
78:
79: }
|