|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.util.FileEncoding
public final class FileEncoding
Represents a text file encoding as expected to be used by TFS, which can be represented solely by a "code page" integer (normal code page numbers with a few TFS-specific numbers reserved for binary files, etc.). These instances are light-weight.
A FileEncoding
is equal to (equals(Object)
) another
FileEncoding
if and only if its code page number matches.
Field Summary | |
---|---|
protected static int |
AUTO_DETECT_SPECIAL_VALUE
|
static FileEncoding |
AUTOMATICALLY_DETECT
The file described by this encoding object should have its encoding detected some time in the future and thereafter this value be ignored. |
static FileEncoding |
BINARY
This will be treated as a byte stream, and not interpreted as text. |
static FileEncoding |
DEFAULT_TEXT
The file described by this encoding object should have its encoding detected to be the default text encoding for this platform some time in the future and thereafter this value be ignored. |
static java.lang.String |
ENCODING_ERROR_MESSAGE_FORMAT
|
protected static int |
TEXT_SPECIAL_VALUE
|
static FileEncoding |
UTF_16
UTF-16, little-endian (the Windows convention for non-endian-explicit names, which is the opposite of Java; see the note in CodePageMapping ). |
static FileEncoding |
UTF_16BE
UTF-16, big-endian. |
static FileEncoding |
UTF_32
UTF-32, little-endian (the Windows convention for non-endian-explicit names, which is the opposite of Java; see the note in CodePageMapping ). |
static FileEncoding |
UTF_32BE
UTF-32, big-endian. |
static FileEncoding |
UTF_8
UTF-8. |
Constructor Summary | |
---|---|
FileEncoding(int codePage)
Construct a file encoding that represents the given code page. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
getCodePage()
Gets the code page number that corresponds to this FileEncoding instance. |
static FileEncoding |
getDefaultTextEncoding()
Gets the default text encoding for this platform, usually so we can assume newly found files are this encoding if they're not marked by BOM. |
java.lang.String |
getName()
Gets a pretty name to display to the user for this encoding. |
java.lang.String |
getName(java.util.Locale locale)
Gets a pretty name to display to the user for this encoding. |
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int AUTO_DETECT_SPECIAL_VALUE
-9999
protected static final int TEXT_SPECIAL_VALUE
-9998
public static final java.lang.String ENCODING_ERROR_MESSAGE_FORMAT
public static final FileEncoding BINARY
public static final FileEncoding AUTOMATICALLY_DETECT
public static final FileEncoding DEFAULT_TEXT
public static final FileEncoding UTF_8
public static final FileEncoding UTF_16
CodePageMapping
).
public static final FileEncoding UTF_16BE
public static final FileEncoding UTF_32
CodePageMapping
).
public static final FileEncoding UTF_32BE
Constructor Detail |
---|
public FileEncoding(int codePage)
codePage
- the code page this encoding represents.Method Detail |
---|
public static FileEncoding getDefaultTextEncoding()
Charset
for this
platform (only available on Java 5). If it's set, we try to convert that
to a defined FileEncoding
, and if that succeeds we return that
value.
FileEncoding
. If that succeeds, we
return that value. This value will almost always be set on all platforms
and able to be converted to a code page, so most searches end here.
FileEncoding
that wraps that exact value.
FileEncoding
for IBM1047,
the default EBCDIC code page for recent versions of z/OS.
FileEncoding
for UTF-8, which covers
ASCII and ISO-8859-1 character sets, which covers generic Unix.
public java.lang.String toString()
toString
in class java.lang.Object
public int getCodePage()
public java.lang.String getName()
public java.lang.String getName(java.util.Locale locale)
locale
- the locale to use when finding localized encoding names (not
null).
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |