| java.lang.Object com.sun.kvem.midp.pim.formats.FormatSupport
FormatSupport | public class FormatSupport (Code) | | Supporting methods for interpreting vCard and vCalendar encodings.
|
Inner Class :public static class DataElement | |
Field Summary | |
final public static String | BASE64 Code name of the Base64 binary encoding. | final public static char | DAILY Repeat rule daily frequency char representation. | final public static char | DAY_IN_MONTH Repeat rule day-in-month char representation. | final public static char | DAY_IN_YEAR Repeat rule day-in-year char representation. | final public static char | MONTHLY Repeat rule monthly frequency char representation. | final public static char | MONTH_IN_YEAR Repeat rule month-in-year char representation. | final public static String | PLAIN_TEXT Code name of plain text binary encoding. | final public static String | QUOTED_PRINTABLE Code name of the Quoted-Printable binary encoding. | final public static String | UTF8 Name of default character encoding. | final public static char | WEEKLY Repeat rule weekly frequency char representation. | final public static char | WEEK_IN_MONTH Repeat rule week-in-month char representation. | final public static char | YEARLY Repeat rule yearly frequency char representation. |
Method Summary | |
public static boolean | contains(int[] a, int value) Checks to see if a sorted array of integers contains a given integer. | public static String | convertString(String data, String encoding, String charset) Converts a string from the given UTF-8 plain text encoding to the
specified encoding. | public static String | getAttributeValue(String[] attributes, String key, String defaultValue) Gets an attribute of the form (key)(value), if one exists in the supplied
attributes list.
Parameters: attributes - an array of attributes Parameters: key - the attribute key (e.g. | public static String | getCharSet(String[] attributes) Gets the character set specified by the given property attributes. | public static String | getEncoding(String[] attributes) Gets the encoding used for a value with the given attributes. | public static String | join(String[] elements, String separator) Joins the elements of a string array together into a single string. | public static byte[] | parseBinary(String[] attributes, String data) Interpret a vCard or vCalendar data element as a byte array, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a class toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. | public static DataElement | parseObjectLine(String line) Extracts data from a vCard or vCalendar line. | public static String | parseString(String[] attributes, String data) Interpret a vCard or vCalendar data element as a string, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a class toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. | public static String[] | parseStringArray(String[] attributes, String data) Interpret a vCard or vCalendar data element as a string array, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a call toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. | public static void | sort(int[] a) Sorts an array of integers. | public static String[] | split(String data, char separatorChar, int startingPoint, boolean skipFirstIfEmpty) Parses a separated list of strings into a string array. | public static String[] | split(String data, char separatorChar, int startingPoint) Parses a separated list of strings into a string array. |
BASE64 | final public static String BASE64(Code) | | Code name of the Base64 binary encoding.
|
DAILY | final public static char DAILY(Code) | | Repeat rule daily frequency char representation.
|
DAY_IN_MONTH | final public static char DAY_IN_MONTH(Code) | | Repeat rule day-in-month char representation.
|
DAY_IN_YEAR | final public static char DAY_IN_YEAR(Code) | | Repeat rule day-in-year char representation.
|
MONTHLY | final public static char MONTHLY(Code) | | Repeat rule monthly frequency char representation.
|
MONTH_IN_YEAR | final public static char MONTH_IN_YEAR(Code) | | Repeat rule month-in-year char representation.
|
PLAIN_TEXT | final public static String PLAIN_TEXT(Code) | | Code name of plain text binary encoding.
|
QUOTED_PRINTABLE | final public static String QUOTED_PRINTABLE(Code) | | Code name of the Quoted-Printable binary encoding.
|
UTF8 | final public static String UTF8(Code) | | Name of default character encoding.
|
WEEKLY | final public static char WEEKLY(Code) | | Repeat rule weekly frequency char representation.
|
WEEK_IN_MONTH | final public static char WEEK_IN_MONTH(Code) | | Repeat rule week-in-month char representation.
|
YEARLY | final public static char YEARLY(Code) | | Repeat rule yearly frequency char representation.
|
contains | public static boolean contains(int[] a, int value)(Code) | | Checks to see if a sorted array of integers contains a given integer.
Parameters: a - input array to be checked Parameters: value - to be checked int the array true if the value is found int the array |
convertString | public static String convertString(String data, String encoding, String charset)(Code) | | Converts a string from the given UTF-8 plain text encoding to the
specified encoding.
Parameters: data - input data to be converted Parameters: encoding - input data encoding Parameters: charset - output encoding encoded string |
getAttributeValue | public static String getAttributeValue(String[] attributes, String key, String defaultValue)(Code) | | Gets an attribute of the form (key)(value), if one exists in the supplied
attributes list.
Parameters: attributes - an array of attributes Parameters: key - the attribute key (e.g. "CHARSET=") Parameters: defaultValue - a default value to be returned if no matchingattribute is found. the value of the requested attribute, or defaultValue if theattribute is not present. |
getCharSet | public static String getCharSet(String[] attributes)(Code) | | Gets the character set specified by the given property attributes.
The default is UTF-8, unless the attributes contain a CHARSET= entry.
Parameters: attributes - an array of vCard or vCalendar property attributes the encoding specified by the attributes |
getEncoding | public static String getEncoding(String[] attributes)(Code) | | Gets the encoding used for a value with the given attributes.
Parameters: attributes - an array of attributes either VCardSupport.QUOTED_PRINTABLE, VCardSupport.BASE64or VCardSupport.PLAIN_TEXT |
join | public static String join(String[] elements, String separator)(Code) | | Joins the elements of a string array together into a single string.
Parameters: elements - the string array Parameters: separator - the string to be included between each pair ofsuccessive elements a string containing, alternately, elements of the string arrayand the separator string |
parseBinary | public static byte[] parseBinary(String[] attributes, String data)(Code) | | Interpret a vCard or vCalendar data element as a byte array, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a class toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. the decoded binary data |
parseString | public static String parseString(String[] attributes, String data)(Code) | | Interpret a vCard or vCalendar data element as a string, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a class toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. the decoded string data |
parseStringArray | public static String[] parseStringArray(String[] attributes, String data)(Code) | | Interpret a vCard or vCalendar data element as a string array, taking
into account any encoding parameters specified in the attribute array.
Parameters: attributes - An array of attributes obtained from a call toparseObjectLine. Parameters: data - The string data of a vCard or vCalendar object line,obtained from a call to parseObjectLine. the decoded string array data |
sort | public static void sort(int[] a)(Code) | | Sorts an array of integers.
Parameters: a - the list of integers |
split | public static String[] split(String data, char separatorChar, int startingPoint, boolean skipFirstIfEmpty)(Code) | | Parses a separated list of strings into a string array.
An escaped separator (backslash followed by separatorChar) is not
treated as a separator.
Parameters: data - input list to be parsed Parameters: separatorChar - the character used to separate items Parameters: startingPoint - Only use the part of the string thatfollows this index Parameters: skipFirstIfEmpty - whether the first element should be skipedif it's empty (data starts with the separator).This flag is used to support empty category name a non-null string array containing string elements |
split | public static String[] split(String data, char separatorChar, int startingPoint)(Code) | | Parses a separated list of strings into a string array.
An escaped separator (backslash followed by separatorChar) is not
treated as a separator.
Parameters: data - input list to be parsed Parameters: separatorChar - the character used to separate items Parameters: startingPoint - Only use the part of the string thatfollows this index a non-null string array containing string elements |
|
|