KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > core > urls > URIContext


1 /*
2  * Copyright 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  * $Header:$
17  */

18 package org.apache.beehive.netui.core.urls;
19
20 /**
21  * A JavaBean that encapsulates the data needed to write out
22  * a string form of a MutableURI.
23  */

24 public class URIContext
25 {
26     /** Character encoding used for the URI. */
27     private boolean _useAmpEntity = true;
28
29     /**
30      * Constructs a <code>URIContext</code>.
31      */

32     public URIContext()
33     {
34     }
35
36     /**
37      * Indicate that the query of the URI should be written using the
38      * &quot;&amp;amp;&quot; entity, rather than the '&amp;' character,
39      * to separate parameters.
40      *
41      * @return true if a URI should have the &quot;&amp;amp;&quot; entity
42      * separating query parameters. Otherwise, false indicates that
43      * it is OK to use the '&amp;' character.
44      */

45     public boolean useAmpEntity()
46     {
47         return _useAmpEntity;
48     }
49
50     /**
51      * Set the flag indicating that the query of the URI should be written
52      * with the &quot;&amp;amp;&quot; entity, rather than the '&amp;' character,
53      * to separate parameters.
54      *
55      * @param useAmpEntity defines whether or not to use the &quot;&amp;amp;&quot; entity
56      */

57     public void setUseAmpEntity( boolean useAmpEntity )
58     {
59         _useAmpEntity = useAmpEntity;
60     }
61
62 }
63
Popular Tags