|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.codec.CodecUtilities
Contains utility methods providing
operations.CODEC
Nonstandard CODECs, that is, CODECs that are not included
in the JPT, must be installed using
the
method of this class.installCodec
Encoding and decoding operations must be performed through the methods of this class, and not directly through the methods of an instance of any particular CODEC.
The only change in 2.4.0 is to the documentation of the
method decode. All code in this class is the
same as before.
Codec| Field Summary | |
private static Hashtable |
codecs
The table of installed codecs. |
| Constructor Summary | |
CodecUtilities()
|
|
| Method Summary | |
private static boolean |
areCodecsInstalled()
Returns whether or not the standard CODECs have been installed. |
static String[] |
decode(String data)
Decodes the given encoded data String
into its (possibly encoded) component parts,
using the CODEC identified within the data
by its unique prefix. |
static String |
encode(String[] data)
Encodes the given array of (possibly encoded) data Strings
into a single encoded data String
using the default CODEC. |
static String |
encode(String[] data,
String codecID)
Encodes the given array of (possibly encoded) data Strings
into a single encoded data String
using the installed CODEC
with the given unique identifier. |
static String |
encode(Stringable[] data)
Encodes the given array of Stringable objects
into an encoded data String
using the default CODEC. |
static String |
encode(Stringable[] data,
String codecID)
Encodes the given array of Stringable objects
into a single encoded data String
using the installed CODEC
with the given unique identifier. |
static String |
getDefaultCodec()
Returns the unique identifier for the default installed CODEC. |
static void |
installCodec(Codec c)
Installs the given CODEC in the table of available CODECs. |
private static void |
installStandardCodecs()
Installs the standard CODECs for the JPT. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static Hashtable codecs
| Constructor Detail |
public CodecUtilities()
| Method Detail |
public static String[] decode(String data)
Decodes the given encoded data String
into its (possibly encoded) component parts,
using the CODEC identified within the data
by its unique prefix.
Throws JPTError if an error occurs.
Class JPTError extends the Java class
Error which implements the interface
Throwable.
As of 2.4.0, this method is called by the method
Strings.decode which rather than throw
an error, returns a null array in case
of an error. It is recommended that this method be
called directly only if the caller specifically
wants to know what specific JPTError
may have occured in an error situation. The method
Strings.decode is definitely easier to
use.
data - a data String to be decoded
Stringsencode(String[]),
encode(String[], String),
encode(Stringable[]),
encode(Stringable[], String)public static String encode(String[] data)
Strings
into a single encoded data String
using the default CODEC.
data - an array of data Strings
to be encoded
Stringdecode(String),
encode(String[], String),
encode(Stringable[]),
encode(Stringable[], String)
public static String encode(String[] data,
String codecID)
Strings
into a single encoded data String
using the installed CODEC
with the given unique identifier.
data - an array of data Strings
to be encodedcodecID - the unique identifier for the desired CODEC
Stringdecode(String),
encode(String[]),
encode(Stringable[]),
encode(Stringable[], String)public static String encode(Stringable[] data)
Stringable objects
into an encoded data String
using the default CODEC.
data - an array of objects to be encoded
Stringdecode(String),
encode(String[]),
encode(String[], String),
encode(Stringable[], String)
public static String encode(Stringable[] data,
String codecID)
Stringable objects
into a single encoded data String
using the installed CODEC
with the given unique identifier.
data - an array of objects to be encodedcodecID - the unique identifier for the desired CODEC
Stringdecode(String),
encode(String[]),
encode(String[], String),
encode(Stringable[])public static String getDefaultCodec()
encode(String[], String),
encode(Stringable[], String)public static void installCodec(Codec c)
c - the desired CODEC object to installprivate static boolean areCodecsInstalled()
installStandardCodecs()private static void installStandardCodecs()
areCodecsInstalled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||