public class Logo extends ImageProperty
Defines a company logo.
Code sample (creating)
VCard vcard = new VCard(); //URL Logo logo = new Logo("http://www.ourcompany.com/our-logo.png", ImageType.PNG); vcard.addLogo(logo); //binary data byte data[] = ... logo = new Logo(data, ImageType.PNG); vcard.addLogo(logo);
Code sample (retrieving)
VCard vcard = ... for (Logo logo : vcard.getLogos()){ ImageType contentType = logo.getContentType(); //e.g. "image/png" String url = logo.getUrl(); if (url != null){ //property value is a URL continue; } byte[] data = logo.getData(); if (data != null){ //property value is binary data continue; } }
Property name: LOGO
Supported versions: 2.1, 3.0, 4.0
contentType, data, url
group, parameters
Constructor and Description |
---|
Logo(byte[] data,
ImageType type)
Creates a logo property.
|
Logo(java.io.File file,
ImageType type)
Creates a logo property.
|
Logo(java.io.InputStream in,
ImageType type)
Creates a logo property.
|
Logo(java.lang.String url,
ImageType type)
Creates a logo property.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLanguage()
Gets the language that the property value is written in.
|
void |
setLanguage(java.lang.String language)
Sets the language that the property value is written in.
|
_validate, addPid, getAltId, getContentType, getData, getPids, getPref, getType, getUrl, removePids, setAltId, setContentType, setData, setPref, setType, setUrl
_supportedVersions, addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate
public Logo(java.lang.String url, ImageType type)
url
- the URL to the logotype
- the content type (e.g. PNG)public Logo(byte[] data, ImageType type)
data
- the binary data of the logotype
- the content type (e.g. PNG)public Logo(java.io.InputStream in, ImageType type) throws java.io.IOException
in
- an input stream to the binary data (will be closed)type
- the content type (e.g. PNG)java.io.IOException
- if there's a problem reading from the input streampublic Logo(java.io.File file, ImageType type) throws java.io.IOException
file
- the image filetype
- the content type (e.g. PNG)java.io.IOException
- if there's a problem reading from the filepublic java.lang.String getLanguage()
VCardProperty
VCardParameters.getLanguage()
public void setLanguage(java.lang.String language)
VCardProperty
language
- the language or null to removeVCardParameters.setLanguage(java.lang.String)
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.