KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > serializers > encoding > UnknownCharset


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.serializers.encoding;
17
18 /**
19  * The <code>Charset</code> implementation provided by this factory
20  * for the unknown charset.
21  *
22  * @author <a HREF="mailto:pier@apache.org">Pier Fumagalli</a>, February 2003
23  * @version CVS $Id: UnknownCharset.java 30932 2004-07-29 17:35:38Z vgritsenko $
24  */

25 public class UnknownCharset implements Charset {
26
27     /**
28      * Create a new instance of this <code>UnknownCharset</code>.
29      */

30     public UnknownCharset() {
31         super();
32     }
33
34     /**
35      * Return the primary name of this <code>Charset</code>
36      */

37     public String JavaDoc getName() {
38         return(null);
39     }
40
41     /**
42      * Return all alias names for this <code>Charset</code>
43      */

44     public String JavaDoc[] getAliases() {
45         return(new String JavaDoc[0]);
46     }
47
48     /**
49      * Check if the specified character by representable in this specifiec
50      * <code>Charset</code> instance.
51      * <p>
52      * This implementation always returns <b>true</b>.
53      * </p>
54      */

55     public boolean allows(char c) {
56         return(true);
57     }
58
59     /**
60      * Compare two <code>Charset</code> instances for equality.
61      */

62     public boolean equals(Object JavaDoc object) {
63         return(object instanceof UnknownCharset);
64     }
65
66     /**
67      * Compare an object to this <code>Charset</code> instances for equality.
68      */

69     public boolean equals(Charset charset) {
70         return(charset instanceof UnknownCharset);
71     }
72 }
73
Popular Tags