|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jtds.jdbc.CharsetInfo
Loads and stores information about character sets. Static fields and methods are concerned with loading, storing and retrieval of all character set information, while non-static fields and methods describe a particular character set (Java charset name and whether it's a multi-byte charset).
Note: Only one CharsetInfo
instance exists per charset.
This allows simple equality comparisons between instances retrieved with any
of the get
methods.
Field Summary | |
private java.lang.String |
charset
The Java character set name. |
private static java.util.HashMap |
charsets
Server charset to Java charset map. |
private static java.lang.String |
CHARSETS_RESOURCE_NAME
Name of the Charsets.properties resource. |
private static java.util.HashMap |
lcidToCharsetMap
Locale id to Java charset map. |
private static CharsetInfo[] |
sortToCharsetMap
Sort order to Java charset map. |
private boolean |
wideChars
Indicates whether current charset is wide (ie multi-byte). |
Constructor Summary | |
CharsetInfo(java.lang.String descriptor)
Constructs a CharsetInfo object from a character set
descriptor of the form: charset preceded by a numeric value indicating
whether it's a multibyte character set (>1) or not (1) and a vertical
bar (|), eg "1|Cp1252" or "2|MS936". |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getCharset()
Retrieves the charset name. |
static CharsetInfo |
getCharset(byte[] collation)
Retrieves the CharsetInfo instance asociated with the
specified collation. |
static CharsetInfo |
getCharset(java.lang.String serverCharset)
Retrieves the CharsetInfo instance asociated with the
specified server charset. |
static CharsetInfo |
getCharsetForLCID(int lcid)
Retrieves the CharsetInfo instance asociated with the
specified LCID. |
static CharsetInfo |
getCharsetForSortOrder(int sortOrder)
Retrieves the CharsetInfo instance asociated with the
specified sort order. |
int |
hashCode()
|
boolean |
isWideChars()
Retrieves whether the caracter set is wide (ie multi-byte). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.lang.String CHARSETS_RESOURCE_NAME
Charsets.properties
resource.
private static final java.util.HashMap charsets
private static final java.util.HashMap lcidToCharsetMap
private static final CharsetInfo[] sortToCharsetMap
private final java.lang.String charset
private final boolean wideChars
Constructor Detail |
public CharsetInfo(java.lang.String descriptor)
CharsetInfo
object from a character set
descriptor of the form: charset preceded by a numeric value indicating
whether it's a multibyte character set (>1) or not (1) and a vertical
bar (|), eg "1|Cp1252" or "2|MS936".
descriptor
- the charset descriptorMethod Detail |
public static CharsetInfo getCharset(java.lang.String serverCharset)
CharsetInfo
instance asociated with the
specified server charset.
serverCharset
- the server-specific character set name
CharsetInfo
public static CharsetInfo getCharsetForLCID(int lcid)
CharsetInfo
instance asociated with the
specified LCID.
lcid
- the server LCID
CharsetInfo
public static CharsetInfo getCharsetForSortOrder(int sortOrder)
CharsetInfo
instance asociated with the
specified sort order.
sortOrder
- the server sort order
CharsetInfo
public static CharsetInfo getCharset(byte[] collation) throws java.sql.SQLException
CharsetInfo
instance asociated with the
specified collation.
collation
- the server LCID
CharsetInfo
java.sql.SQLException
public java.lang.String getCharset()
public boolean isWideChars()
public boolean equals(java.lang.Object o)
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |