|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.BinaryProperty<T>
T
- the class used for representing the content type of the resourcepublic abstract class BinaryProperty<T extends MediaTypeParameter>
Represents a property whose value contains binary data (for example,
Photo
).
Field Summary | |
---|---|
protected T |
contentType
The content type of the resource (for example, a JPEG image). |
protected byte[] |
data
The decoded data. |
protected String |
url
The URL to the resource. |
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
BinaryProperty()
|
|
BinaryProperty(byte[] data,
T type)
Creates a binary property. |
|
BinaryProperty(File file,
T type)
Creates a binary property. |
|
BinaryProperty(InputStream in,
T type)
Creates a binary property. |
|
BinaryProperty(String url,
T type)
Creates a binary property. |
Method Summary | |
---|---|
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the spec. |
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID value. |
String |
getAltId()
Gets the property's ALTID parameter. |
T |
getContentType()
Gets the content type of the resource. |
byte[] |
getData()
Gets the binary data of the resource. |
List<Integer[]> |
getPids()
Gets all PID values. |
Integer |
getPref()
Gets the preference value. |
String |
getType()
Gets the vCard 4.0 TYPE parameter. |
String |
getUrl()
Gets the URL to the resource |
void |
removePids()
Removes all PID values. |
void |
setAltId(String altId)
Sets the property's ALTID parameter. |
void |
setContentType(T contentType)
Sets the content type of the resource. |
void |
setData(byte[] data,
T type)
Sets the binary data of the resource. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setType(String type)
Sets the vCard 4.0 TYPE parameter. |
void |
setUrl(String url,
T type)
Sets the URL to the resource. |
Methods inherited from class ezvcard.property.VCardProperty |
---|
_supportedVersions, addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] data
protected String url
protected T extends MediaTypeParameter contentType
Constructor Detail |
---|
public BinaryProperty()
public BinaryProperty(String url, T type)
url
- the URL to the resourcetype
- the content typepublic BinaryProperty(byte[] data, T type)
data
- the binary datatype
- the content typepublic BinaryProperty(InputStream in, T type) throws IOException
in
- an input stream to the binary data (will be closed)type
- the content type
IOException
- if there is a problem reading from the input streampublic BinaryProperty(File file, T type) throws IOException
file
- the file containing the binary datatype
- the content type
IOException
- if there is a problem reading from the fileMethod Detail |
---|
public byte[] getData()
public void setData(byte[] data, T type)
data
- the binary datatype
- the content type (e.g. "JPEG image")public String getUrl()
public void setUrl(String url, T type)
url
- the URLtype
- the content type (e.g. "JPEG image")public T getContentType()
public void setContentType(T contentType)
contentType
- the content type (e.g. "JPEG image")public String getType()
getContentType()
instead.
Supported versions: 4.0
public void setType(String type)
setContentType(T)
instead.
Supported versions: 4.0
type
- the TYPE value (should be either "work" or "home") or null to
removepublic List<Integer[]> getPids()
VCardProperty
Gets all PID values.
Supported versions: 4.0
VCardParameters.getPids()
public void addPid(int localId, int clientPidMapRef)
VCardProperty
Adds a PID value.
Supported versions: 4.0
localId
- the local IDclientPidMapRef
- the ID used to reference the property's globally
unique identifier in the CLIENTPIDMAP property.VCardParameters.addPid(int, int)
public void removePids()
VCardProperty
Removes all PID values.
Supported versions: 4.0
VCardParameters.removePids()
public Integer getPref()
VCardProperty
Gets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
VCardParameters.getPref()
public void setPref(Integer pref)
VCardProperty
Sets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
pref
- the preference value or null to removeVCardParameters.setPref(java.lang.Integer)
public String getAltId()
HasAltId
Supported versions: 4.0
getAltId
in interface HasAltId
VCardParameters.getAltId()
public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId
in interface HasAltId
altId
- the ALTID or null to removeVCardParameters.setAltId(java.lang.String)
protected void _validate(List<Warning> warnings, VCardVersion version, VCard vcard)
VCardProperty
_validate
in class VCardProperty
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |