|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.common.pim.model.converter.BaseConverter
public abstract class BaseConverter
Represent a converter base class. Provides some common methods.
Field Summary | |
---|---|
protected java.lang.String |
charset
|
static java.lang.String |
CHARSET_UTF7
|
static java.lang.String |
CHARSET_UTF8
|
static java.lang.String |
ENCODING_B64
|
static java.lang.String |
ENCODING_QP
|
protected boolean |
forceClientLocalTime
|
static java.lang.String |
PLAIN_CHARSET
|
protected java.util.Vector<java.lang.String> |
supportedFields
Specifies the list of supported fields |
protected java.util.TimeZone |
timezone
|
Constructor Summary | |
---|---|
BaseConverter(java.util.TimeZone timezone,
java.lang.String charset)
Deprecated. |
|
BaseConverter(java.util.TimeZone timezone,
java.lang.String charset,
boolean forceDeviceLocalTime)
|
Method Summary | |
---|---|
java.lang.StringBuffer |
composeICalTextComponent(Property property,
java.lang.String field)
Deprecated. Unused since version 6.5, replaced by methods in #com.funambol.common.pim.converter.CalendarContentConverter |
protected java.lang.StringBuffer |
composeRemainingFields()
Compose the remaining fields from the supportedFields Vector. |
java.lang.StringBuffer |
composeVCardComponent(java.lang.String propertyValue,
java.util.ArrayList properties,
java.lang.String field)
This method compose the single component of vCard and in particular: 1) encode value with the proper encoding 2) handle the params 3) create a representation of the specificated vCard field |
java.lang.StringBuffer |
composeVCardComponent(java.lang.String propertyValue,
java.util.ArrayList properties,
java.lang.String field,
boolean excludeCharset)
This method compose the single component of vCard and in particular: 1) encode value with the proper encoding 2) handle the params 3) create a representation of the specificated vCard field |
java.lang.String |
encode(java.lang.String value,
java.lang.String encoding,
java.lang.String charset)
Replace values with proper encoding |
java.lang.String |
escapeSeparator(java.lang.String value)
A SEMI-COLON in a property value MUST be escaped with a '\' character. |
static java.lang.String |
handleConversionAcrossTimeZones(java.lang.String sDate,
java.util.TimeZone timezoneIn,
java.util.TimeZone timezoneOut)
Converts the given sDate it in the local time of another time zone. |
static java.lang.String |
handleConversionToAllDayDate(java.lang.String sDate)
Converts the given sDate in all-day format using the given timezone |
static java.lang.String |
handleConversionToAllDayDate(java.lang.String sDate,
java.util.TimeZone timezoneIn,
java.util.TimeZone timezoneOut)
Converts the given sDate in all-day format In the conversion the following rules are applied: if the given timezoneIn is not null, it is applied on the stringDate conversion if the given timezoneOut is not null, it is applied on the output date |
static java.lang.String |
handleConversionToLocalDate(java.lang.String sDate,
java.util.TimeZone timezone)
Converts the given sDate it in local time using the given timezone |
static java.lang.String |
handleConversionToUTCDate(java.lang.String sDate,
java.util.TimeZone timezone)
Converts the given sDate in UTC using the given timezone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENCODING_QP
public static final java.lang.String CHARSET_UTF8
public static final java.lang.String CHARSET_UTF7
public static final java.lang.String ENCODING_B64
public static final java.lang.String PLAIN_CHARSET
protected java.util.TimeZone timezone
protected java.lang.String charset
protected boolean forceClientLocalTime
protected java.util.Vector<java.lang.String> supportedFields
Constructor Detail |
---|
@Deprecated public BaseConverter(java.util.TimeZone timezone, java.lang.String charset)
timezone
- the timezone to use in the conversioncharset
- the charset to use in the conversionpublic BaseConverter(java.util.TimeZone timezone, java.lang.String charset, boolean forceDeviceLocalTime)
timezone
- the timezone to use in the conversioncharset
- the charset to use in the conversionforceDeviceLocalTime
- true if the date must be converted in the
device's local time, false otherwise.Method Detail |
---|
public static java.lang.String handleConversionToUTCDate(java.lang.String sDate, java.util.TimeZone timezone) throws ConverterException
sDate
- Stringtimezone
- TimeZone
ConverterException
public static java.lang.String handleConversionToLocalDate(java.lang.String sDate, java.util.TimeZone timezone) throws ConverterException
sDate
- Stringtimezone
- TimeZone
ConverterException
public static java.lang.String handleConversionAcrossTimeZones(java.lang.String sDate, java.util.TimeZone timezoneIn, java.util.TimeZone timezoneOut) throws ConverterException
sDate
- StringtimezoneIn
- TimeZonetimezoneOut
- TimeZone
ConverterException
public static java.lang.String handleConversionToAllDayDate(java.lang.String sDate) throws ConverterException
sDate
- as a String, in local time format
ConverterException
public static java.lang.String handleConversionToAllDayDate(java.lang.String sDate, java.util.TimeZone timezoneIn, java.util.TimeZone timezoneOut) throws ConverterException
sDate
- the date to converttimezoneIn
- the timezone to apply to the given datetimezoneOut
- the timezone to apply on the output date
ConverterException
- if an error occurspublic java.lang.String encode(java.lang.String value, java.lang.String encoding, java.lang.String charset) throws ConverterException
value
- the value to apply the replacementencoding
- the encoding to use (default is QUOTED-PRINTABLE)charset
- the charset to use (default is UTF-8)
ConverterException
public java.lang.StringBuffer composeVCardComponent(java.lang.String propertyValue, java.util.ArrayList properties, java.lang.String field) throws ConverterException
propertyValue
- the value of vCard fieldproperties
- a vector of paramsfield
- the filed name
com.funambol.common.pim.converter.ConverterException
- if an error occurs
ConverterException
public java.lang.StringBuffer composeVCardComponent(java.lang.String propertyValue, java.util.ArrayList properties, java.lang.String field, boolean excludeCharset) throws ConverterException
propertyValue
- the value of vCard fieldproperties
- a vector of paramsfield
- the filed nameexcludeCharset
- must the charset be not set ?
com.funambol.common.pim.converter.ConverterException
- if an error occurs
ConverterException
public java.lang.StringBuffer composeICalTextComponent(Property property, java.lang.String field) throws ConverterException
#com.funambol.common.pim.converter.CalendarContentConverter
value
- the value of iCalendar fieldproperties
- a vector of paramsfield
- the field name
ConverterException
protected java.lang.StringBuffer composeRemainingFields()
public java.lang.String escapeSeparator(java.lang.String value)
value
- the value in which replaced the ; and the \
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |