com.funambol.common.pim.model.common
Class Property

java.lang.Object
  extended by com.funambol.common.pim.model.common.Property
Direct Known Subclasses:
Attendee, PropertyWithTimeZone, TypifiedProperty

public class Property
extends java.lang.Object

This object represents the property of a vCard/vCalendar/iCalendar item, including its value and parameters.

Version:
$Id: Property.java,v 1.6 2008-04-10 10:42:22 mauro Exp $

Field Summary
protected  java.lang.String altrep
           
protected  java.lang.String chrset
           
protected  java.lang.String cn
           
protected  java.lang.String cutype
           
protected  java.lang.String delegatedFrom
           
protected  java.lang.String delegatedTo
           
protected  java.lang.String dir
           
protected  java.lang.String encoding
           
protected  java.lang.String group
           
protected  java.lang.String language
           
protected  java.lang.String member
           
protected  java.lang.String partstat
           
protected  java.lang.Object propertyValue
           
protected  java.lang.String related
           
protected  java.lang.String sentby
           
protected  java.lang.String tag
           
protected  java.lang.String type
           
protected  java.lang.String value
           
protected  java.util.Map<java.lang.String,java.lang.String> xParams
           
 
Constructor Summary
Property()
          Creates an empty property.
Property(java.lang.String propertyValue)
          Creates property without parameters but with the specified value.
 
Method Summary
 boolean compare(Property prop)
          Compares this Property with another one.
 boolean equals(java.lang.Object o)
           
 java.lang.String getAltrep()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getCharset()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getCn()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getCutype()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getDelegatedFrom()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getDelegatedTo()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getDir()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getEncoding()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getGroup()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getLanguage()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getMember()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getPartstat()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.Object getPropertyValue()
          Returns the value of this property "as it is".
 java.lang.String getPropertyValueAsString()
          Returns the value of this property as a String.
 java.lang.String getRelated()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getSentby()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getTag()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getType()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.lang.String getValue()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 java.util.HashMap<java.lang.String,java.lang.String> getXParams()
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 int hashCode()
           
static boolean isEmptyProperty(Property property)
          Checks (safely) whether the property is unset or set to an empty string.
 void setAltrep(java.lang.String altrep)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setCharset(java.lang.String chrset)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setCn(java.lang.String cn)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setCutype(java.lang.String cutype)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setDelegatedFrom(java.lang.String delegatedFrom)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setDelegatedTo(java.lang.String delegatedTo)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setDir(java.lang.String dir)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setEncoding(java.lang.String encoding)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setGroup(java.lang.String group)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setLanguage(java.lang.String language)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setMember(java.lang.String member)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setPartstat(java.lang.String partstat)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setPropertyValue(java.lang.Object propertyValue)
          Sets the property value.
 void setRelated(java.lang.String related)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setSentby(java.lang.String sentby)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setTag(java.lang.String tag)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setType(java.lang.String type)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setValue(java.lang.String value)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
 void setXParams(java.util.Map<java.lang.String,java.lang.String> xParams)
          Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.
static java.lang.String stringFrom(Property property)
          Extract a string from a property in a safe way.
static java.lang.String stringFrom(Property property, boolean emptyImpliesNull)
          Extract a string from a property in a safe way.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyValue

protected java.lang.Object propertyValue

altrep

protected java.lang.String altrep

cn

protected java.lang.String cn

cutype

protected java.lang.String cutype

delegatedFrom

protected java.lang.String delegatedFrom

delegatedTo

protected java.lang.String delegatedTo

dir

protected java.lang.String dir

encoding

protected java.lang.String encoding

language

protected java.lang.String language

member

protected java.lang.String member

partstat

protected java.lang.String partstat

related

protected java.lang.String related

sentby

protected java.lang.String sentby

value

protected java.lang.String value

xParams

protected java.util.Map<java.lang.String,java.lang.String> xParams

tag

protected java.lang.String tag

group

protected java.lang.String group

chrset

protected java.lang.String chrset

type

protected java.lang.String type
Constructor Detail

Property

public Property()
Creates an empty property.


Property

public Property(java.lang.String propertyValue)
Creates property without parameters but with the specified value.

Parameters:
propertyValue - the property value
Method Detail

getPropertyValue

public java.lang.Object getPropertyValue()
Returns the value of this property "as it is".

Returns:
the value of this property as any Object

getPropertyValueAsString

public java.lang.String getPropertyValueAsString()
Returns the value of this property as a String. If the property value is not of type String, String.valueOf() is invoked to translate the object into its string representation.

Returns:
the value of this property as a String object

getEncoding

public java.lang.String getEncoding()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns parameter ENCODING that is used to specify an alternate encoding for a value.

Returns:
the encoding parameter of this property

getLanguage

public java.lang.String getLanguage()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns parameter LANGUAGE that is used to identify data in multiple languages.

Returns:
the language parameter of this property

getValue

public java.lang.String getValue()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns parameter VALUE that is used to identify the value data type and format of the value.

Returns:
the value parameter of this property

getAltrep

public java.lang.String getAltrep()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns an alternate text representation for the property value.

Returns:
an alternate text representation

getCn

public java.lang.String getCn()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the common name that is associated with the calendar user specified by this property.

Returns:
a common name

getCutype

public java.lang.String getCutype()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the type of calendar user specified by this property.

Returns:
the type of calendar user

getDelegatedFrom

public java.lang.String getDelegatedFrom()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the calendar users that have delegated their participation to the calendar user specified by this property.

Returns:
the delegators

getDelegatedTo

public java.lang.String getDelegatedTo()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the calendar users to whom the calendar user specified by this property has delegated participation.

Returns:
the delegatees

getDir

public java.lang.String getDir()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the reference to a directory entry associated with the calendar user specified by this property.

Returns:
the reference to a directory entry

getMember

public java.lang.String getMember()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the group or list membership of the calendar user specified by this property.

Returns:
the group or list membership

getPartstat

public java.lang.String getPartstat()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the partecipation status of the calendar user specified by this property.

Returns:
the partecipation status

getRelated

public java.lang.String getRelated()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the relationship of the alarm trigger with respect to the start or end of the calendar component.

Returns:
the relationship of the alarm trigger

getSentby

public java.lang.String getSentby()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the calendar user that is acting on behalf of the calendar user specified by this property.

Returns:
the calendar user that is acting on behalf of the calendar user specified by this property

getGroup

public java.lang.String getGroup()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the group parameter of this property. The group parameter is used to group related attributes together.

Returns:
the group parameter of this property

getCharset

public java.lang.String getCharset()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the default character set used within the body part.

Returns:
the charset parameter of this property

getType

public java.lang.String getType()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the type parameter of this property.

Returns:
the type parameter of this property

getXParams

public java.util.HashMap<java.lang.String,java.lang.String> getXParams()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Gets the custom parameters.

Returns:
a HashMap containing all custom parameters (names and values)

setXParams

public void setXParams(java.util.Map<java.lang.String,java.lang.String> xParams)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the custom parameter

Parameters:
xParams - a Map containing all custom parameters (names and values)

getTag

public java.lang.String getTag()
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Returns the TAG of this property.

Returns:
the tag parameter of this property

setTag

public void setTag(java.lang.String tag)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the TAG of this property.

Parameters:
tag - the tag to set

setEncoding

public void setEncoding(java.lang.String encoding)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the encoding parameter of this property.

Parameters:
encoding - the encoding to set

setLanguage

public void setLanguage(java.lang.String language)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the language parameter of this property.

Parameters:
language - the language to set

setValue

public void setValue(java.lang.String value)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the value parameter of this property.

Parameters:
value - the value to set

setPropertyValue

public void setPropertyValue(java.lang.Object propertyValue)
Sets the property value. Blank spaces and tabs will be stripped from its end if it is a string.

Parameters:
propertyValue - the property value to set

setAltrep

public void setAltrep(java.lang.String altrep)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets an alternative text representation for the property value.

Parameters:
altrep - an alternative text representation for the property value

setCn

public void setCn(java.lang.String cn)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets a common name.

Parameters:
cn - a common name

setCutype

public void setCutype(java.lang.String cutype)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the type of calendar user.

Parameters:
cutype - the type of calendar user

setDelegatedFrom

public void setDelegatedFrom(java.lang.String delegatedFrom)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the delegated to partecipate at the event.

Parameters:
delegatedFrom - the delegated to partecipate at the event

setDelegatedTo

public void setDelegatedTo(java.lang.String delegatedTo)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the delegate.

Parameters:
delegatedTo - the delegate

setDir

public void setDir(java.lang.String dir)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the directory entry.

Parameters:
dir - the directory entry

setMember

public void setMember(java.lang.String member)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the group or list membership.

Parameters:
member - the group or list membership

setPartstat

public void setPartstat(java.lang.String partstat)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the partecipation status.

Parameters:
partstat - the partecipation status

setRelated

public void setRelated(java.lang.String related)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the relationship of the alarm trigger.

Parameters:
related - the relationship of the alarm trigger

setSentby

public void setSentby(java.lang.String sentby)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the calendar user that is acting on behalf of the calendar user specified by the property.

Parameters:
sentby - the calendar user that is acting on behalf of the calendar user specified by the property

setGroup

public void setGroup(java.lang.String group)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the group parameter of this property.

Parameters:
group - the group to set

setCharset

public void setCharset(java.lang.String chrset)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the charset parameter of this property.

Parameters:
chrset - the charset to set

setType

public void setType(java.lang.String type)
Deprecated. Since version 6.5, a Property should not contain anything but the propertyValue.

Sets the type parameter of this property.

Parameters:
type - the type to set

compare

public boolean compare(Property prop)
Compares this Property with another one. Only the property value in its string form is considered, since all other properties are deprecated.

Parameters:
prop - the Property object to compare with
Returns:
true if the objects are to be considered equal, false otherwise.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isEmptyProperty

public static boolean isEmptyProperty(Property property)
Checks (safely) whether the property is unset or set to an empty string.

Parameters:
property - may be null
Returns:
false only if the property value is a non-null non-empty string
See Also:
PIMEntityDAO#stringFrom(Property, boolean)

stringFrom

public static java.lang.String stringFrom(Property property)
Extract a string from a property in a safe way. An empty string ("") is considered as an acceptable value for the property: in such a case, an empty String object will be returned.

Parameters:
property - may be null
Returns:
if existing, the property value will be returned as a String object

stringFrom

public static java.lang.String stringFrom(Property property,
                                          boolean emptyImpliesNull)
Extract a string from a property in a safe way. This method is not currently used, but it could be useful in the future for determining the behaviour of the connector when dealing with empty properties. A field whose value is extracted with stringFrom(..., true) will not be updated in case its value is set to ""; a field whose value is extracted with stringFrom(..., false) will be considered as explicitly kept blank if its value is "". This means that single field deletions can be made tunable.

Parameters:
property - may be null
emptyImpliesNull - if true, an empty string ("") will be treated as if it were null; otherwise, in such a case an empty String object will be returned
Returns:
if existing (and not empty if emptyImpliesNull is true), the property value will be returned as a String object


Copyright © 2001-2009 Funambol.