|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensor.xmldata.util.StringListCodec
public class StringListCodec
Provides an encoder for transforming a List instance containing strings into a single string (suitable for transmission via SOAP) and a decoder for reconstructing the List on the other side. Individual strings must be less than MAX_STRING_LENGTH, and the number of strings in the list must be less than MAX_NUM_STRINGS. Throws an exception if these maxima are exceeded, or if the List to be decoded contains a non-String element, or if the String to be decoded is not correctly formatted for decoding, or if the decoded string is not completely consumed by the decoding process.
Field Summary | |
---|---|
static int |
MAX_NUM_STRINGS
The maximum number of strings that can be encoded. |
static int |
MAX_STRING_LENGTH
The maximum length of any individual string to be encoded. |
Constructor Summary | |
---|---|
StringListCodec()
|
Method Summary | |
---|---|
static java.util.List<java.lang.String> |
decode(java.lang.String encodedString)
Decodes the passed string, returning a List of strings. |
static java.lang.String |
encode(java.util.List<java.lang.String> stringList)
Encodes the passed list of strings into a single string and returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_STRING_LENGTH
public static final int MAX_NUM_STRINGS
Constructor Detail |
---|
public StringListCodec()
Method Detail |
---|
public static java.lang.String encode(java.util.List<java.lang.String> stringList) throws StringListCodecException
stringList
- a List
value
String
value
StringListCodecException
- If the list contains a non-String, or if the number of
strings in the list exceeds MAX_NUM_STRINGS, or if the length of any individual
string exceeds MAX_STRING_LENGTH.public static java.util.List<java.lang.String> decode(java.lang.String encodedString) throws StringListCodecException
encodedString
- The encoded list of strings.
StringListCodecException
- If the passed encodedString is not encoded properly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |