Package org.restlet.data
Class CharacterSet
java.lang.Object
org.restlet.data.Metadata
org.restlet.data.CharacterSet
Metadata used to specify the character set of textual representations.
- Author:
- Jerome Louvel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CharacterSetAll character sets acceptable.static final CharacterSetThe default character set of the JVM.static final CharacterSetThe ISO/IEC 8859-1 (Latin 1) character set.static final CharacterSetThe ISO/IEC 8859-10 (Latin 6) character set.static final CharacterSetThe ISO/IEC 8859-2 (Latin 2) character set.static final CharacterSetThe ISO/IEC 8859-3 (Latin 3) character set.static final CharacterSetThe ISO/IEC 8859-4 (Latin 4) character set.static final CharacterSetThe ISO/IEC 8859-5 (Cyrillic) character set.static final CharacterSetThe ISO/IEC 8859-6 (Arabic) character set.static final CharacterSetThe ISO/IEC 8859-7 (Greek) character set.static final CharacterSetThe ISO/IEC 8859-8 (Hebrew) character set.static final CharacterSetThe ISO/IEC 8859-9 (Latin 5) character set.static final CharacterSetThe Macintosh ("Mac OS Roman") character set.static final CharacterSetThe US-ASCII character set.static final CharacterSetThe UTF-16 character set.static final CharacterSetThe UTF-8 character set.static final CharacterSetThe Windows-1252 ('ANSI') character set. -
Constructor Summary
ConstructorsConstructorDescriptionCharacterSet(String name) Constructor.CharacterSet(String name, String description) Constructor.CharacterSet(Charset charset) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the parent metadata if available or null.inthashCode()booleanIndicates if a given character set is included in the current one.Returns the NIO charset matching the character set name.static CharacterSetReturns the character set associated to a name.Methods inherited from class org.restlet.data.Metadata
getDescription, getName, isCompatible, toString
-
Field Details
-
ALL
All character sets acceptable. -
ISO_8859_1
The ISO/IEC 8859-1 (Latin 1) character set.- See Also:
-
ISO_8859_2
The ISO/IEC 8859-2 (Latin 2) character set.- See Also:
-
ISO_8859_3
The ISO/IEC 8859-3 (Latin 3) character set.- See Also:
-
ISO_8859_4
The ISO/IEC 8859-4 (Latin 4) character set.- See Also:
-
ISO_8859_5
The ISO/IEC 8859-5 (Cyrillic) character set.- See Also:
-
ISO_8859_6
The ISO/IEC 8859-6 (Arabic) character set.- See Also:
-
ISO_8859_7
The ISO/IEC 8859-7 (Greek) character set.- See Also:
-
ISO_8859_8
The ISO/IEC 8859-8 (Hebrew) character set.- See Also:
-
ISO_8859_9
The ISO/IEC 8859-9 (Latin 5) character set.- See Also:
-
ISO_8859_10
The ISO/IEC 8859-10 (Latin 6) character set.- See Also:
-
MACINTOSH
The Macintosh ("Mac OS Roman") character set.- See Also:
-
US_ASCII
The US-ASCII character set.- See Also:
-
UTF_16
The UTF-16 character set.- See Also:
-
UTF_8
The UTF-8 character set.- See Also:
-
WINDOWS_1252
The Windows-1252 ('ANSI') character set.- See Also:
-
DEFAULT
The default character set of the JVM.- See Also:
-
-
Constructor Details
-
CharacterSet
Constructor.- Parameters:
charset- The character set.
-
CharacterSet
Constructor.- Parameters:
name- The name.
-
CharacterSet
Constructor.- Parameters:
name- The name.description- The description.
-
-
Method Details
-
valueOf
Returns the character set associated to a name. If an existing constant exists then it is returned, otherwise a new instance is created.- Parameters:
name- The name.- Returns:
- The associated character set.
-
equals
-
getParent
Description copied from class:MetadataReturns the parent metadata if available or null. -
hashCode
public int hashCode() -
includes
Indicates if a given character set is included in the current one. The test is true if both character sets are equal or if the given character set is within the range of the current one. For example, ALL includes all character sets. A null character set is considered as included into the current one.Examples:
- ALL.includes(UTF_16) returns true
- UTF_16.includes(ALL) returns false
-
toCharset
Returns the NIO charset matching the character set name.- Returns:
- The NIO charset.
-