org.restlet.data
Class CharacterSet

java.lang.Object
  extended by org.restlet.data.Metadata
      extended by org.restlet.data.CharacterSet

public final class CharacterSet
extends Metadata

Metadata used to specify the character set of textual representations.

Author:
Jerome Louvel

Field Summary
static CharacterSet ALL
          All character sets acceptable.
static CharacterSet DEFAULT
          The default character set of the JVM.
static CharacterSet ISO_8859_1
          The ISO/IEC 8859-1 (Latin 1) character set.
static CharacterSet ISO_8859_10
          The ISO/IEC 8859-10 (Latin 6) character set.
static CharacterSet ISO_8859_2
          The ISO/IEC 8859-2 (Latin 2) character set.
static CharacterSet ISO_8859_3
          The ISO/IEC 8859-3 (Latin 3) character set.
static CharacterSet ISO_8859_4
          The ISO/IEC 8859-4 (Latin 4) character set.
static CharacterSet ISO_8859_5
          The ISO/IEC 8859-5 (Cyrillic) character set.
static CharacterSet ISO_8859_6
          The ISO/IEC 8859-6 (Arabic) character set.
static CharacterSet ISO_8859_7
          The ISO/IEC 8859-7 (Greek) character set.
static CharacterSet ISO_8859_8
          The ISO/IEC 8859-8 (Hebrew) character set.
static CharacterSet ISO_8859_9
          The ISO/IEC 8859-9 (Latin 5) character set.
static CharacterSet MACINTOSH
          The Macintosh ("Mac OS Roman") character set.
static CharacterSet US_ASCII
          The US-ASCII character set.
static CharacterSet UTF_16
          The UTF-16 character set.
static CharacterSet UTF_8
          The UTF-8 character set.
static CharacterSet WINDOWS_1252
          The Windows-1252 ('ANSI') character set.
 
Constructor Summary
CharacterSet(Charset charset)
          Constructor.
CharacterSet(String name)
          Constructor.
CharacterSet(String name, String description)
          Constructor.
 
Method Summary
 boolean equals(Object object)
          
 Metadata getParent()
          Returns the parent metadata if available or null.
 int hashCode()
          
 boolean includes(Metadata included)
          Indicates if a given character set is included in the current one.
 Charset toCharset()
          Returns the NIO charset matching the character set name.
static CharacterSet valueOf(String name)
          Returns the character set associated to a name.
 
Methods inherited from class org.restlet.data.Metadata
getDescription, getName, isCompatible, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final CharacterSet ALL
All character sets acceptable.


ISO_8859_1

public static final CharacterSet ISO_8859_1
The ISO/IEC 8859-1 (Latin 1) character set.

See Also:
Wikipedia page

ISO_8859_2

public static final CharacterSet ISO_8859_2
The ISO/IEC 8859-2 (Latin 2) character set.

See Also:
Wikipedia page

ISO_8859_3

public static final CharacterSet ISO_8859_3
The ISO/IEC 8859-3 (Latin 3) character set.

See Also:
Wikipedia page

ISO_8859_4

public static final CharacterSet ISO_8859_4
The ISO/IEC 8859-4 (Latin 4) character set.

See Also:
Wikipedia page

ISO_8859_5

public static final CharacterSet ISO_8859_5
The ISO/IEC 8859-5 (Cyrillic) character set.

See Also:
Wikipedia page

ISO_8859_6

public static final CharacterSet ISO_8859_6
The ISO/IEC 8859-6 (Arabic) character set.

See Also:
Wikipedia page

ISO_8859_7

public static final CharacterSet ISO_8859_7
The ISO/IEC 8859-7 (Greek) character set.

See Also:
Wikipedia page

ISO_8859_8

public static final CharacterSet ISO_8859_8
The ISO/IEC 8859-8 (Hebrew) character set.

See Also:
Wikipedia page

ISO_8859_9

public static final CharacterSet ISO_8859_9
The ISO/IEC 8859-9 (Latin 5) character set.

See Also:
Wikipedia page

ISO_8859_10

public static final CharacterSet ISO_8859_10
The ISO/IEC 8859-10 (Latin 6) character set.

See Also:
Wikipedia page

MACINTOSH

public static final CharacterSet MACINTOSH
The Macintosh ("Mac OS Roman") character set.

See Also:
Wikipedia page

US_ASCII

public static final CharacterSet US_ASCII
The US-ASCII character set.

See Also:
Wikipedia page

UTF_16

public static final CharacterSet UTF_16
The UTF-16 character set.

See Also:
Wikipedia page

UTF_8

public static final CharacterSet UTF_8
The UTF-8 character set.

See Also:
Wikipedia page

WINDOWS_1252

public static final CharacterSet WINDOWS_1252
The Windows-1252 ('ANSI') character set.

See Also:
Wikipedia page

DEFAULT

public static final CharacterSet DEFAULT
The default character set of the JVM.

See Also:
Charset.defaultCharset()
Constructor Detail

CharacterSet

public CharacterSet(Charset charset)
Constructor.

Parameters:
charset - The character set.

CharacterSet

public CharacterSet(String name)
Constructor.

Parameters:
name - The name.

CharacterSet

public CharacterSet(String name,
                    String description)
Constructor.

Parameters:
name - The name.
description - The description.
Method Detail

valueOf

public static CharacterSet valueOf(String name)
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

public boolean equals(Object object)

Overrides:
equals in class Metadata

getParent

public Metadata getParent()
Description copied from class: Metadata
Returns the parent metadata if available or null.

Specified by:
getParent in class Metadata
Returns:
The parent metadata.

hashCode

public int hashCode()

Overrides:
hashCode in class Metadata

includes

public boolean includes(Metadata included)
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:

Specified by:
includes in class Metadata
Parameters:
included - The character set to test for inclusion.
Returns:
True if the given character set is included in the current one.
See Also:
Metadata.isCompatible(Metadata)

toCharset

public Charset toCharset()
Returns the NIO charset matching the character set name.

Returns:
The NIO charset.


Copyright © 2005-2013 Restlet.