ezvcard.io.scribe
Class ImagePropertyScribe<T extends ImageProperty>

java.lang.Object
  extended by ezvcard.io.scribe.VCardPropertyScribe<T>
      extended by ezvcard.io.scribe.BinaryPropertyScribe<T,ImageType>
          extended by ezvcard.io.scribe.ImagePropertyScribe<T>
Type Parameters:
T - the property class
Direct Known Subclasses:
LogoScribe, PhotoScribe

public abstract class ImagePropertyScribe<T extends ImageProperty>
extends BinaryPropertyScribe<T,ImageType>

Marshals properties that contain images.

Author:
Michael Angstadt

Nested Class Summary
 
Nested classes/interfaces inherited from class ezvcard.io.scribe.VCardPropertyScribe
VCardPropertyScribe.DateWriter, VCardPropertyScribe.Result<T extends VCardProperty>, VCardPropertyScribe.SemiStructuredIterator, VCardPropertyScribe.Splitter, VCardPropertyScribe.StructuredIterator
 
Field Summary
 
Fields inherited from class ezvcard.io.scribe.VCardPropertyScribe
clazz, propertyName, qname
 
Constructor Summary
ImagePropertyScribe(Class<T> clazz, String propertyName)
           
 
Method Summary
protected  ImageType _buildMediaTypeObj(String mediaType)
          Builds a MediaTypeParameter object based on the information in the MEDIATYPE parameter or data URI of 4.0 vCards.
protected  ImageType _buildTypeObj(String type)
          Builds a MediaTypeParameter object based on the value of the TYPE parameter in 2.1/3.0 vCards.
protected  T _parseHtml(HCardElement element, List<String> warnings)
           Unmarshals the property from an hCard (HTML document).
 
Methods inherited from class ezvcard.io.scribe.BinaryPropertyScribe
_dataType, _defaultDataType, _newInstance, _newInstance, _parseJson, _parseText, _parseXml, _prepareParameters, _writeJson, _writeText, _writeXml, cannotUnmarshalValue, parseContentType
 
Methods inherited from class ezvcard.io.scribe.VCardPropertyScribe
dataType, date, date, defaultDataType, escape, getPropertyClass, getPropertyName, getQName, handlePrefParam, list, list, list, missingXmlElements, missingXmlElements, parseHtml, parseJson, parseText, parseXml, prepareParameters, semistructured, semistructured, split, structured, structured, structured, unescape, writeJson, writeText, writeXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagePropertyScribe

public ImagePropertyScribe(Class<T> clazz,
                           String propertyName)
Method Detail

_buildTypeObj

protected ImageType _buildTypeObj(String type)
Description copied from class: BinaryPropertyScribe
Builds a MediaTypeParameter object based on the value of the TYPE parameter in 2.1/3.0 vCards.

Specified by:
_buildTypeObj in class BinaryPropertyScribe<T extends ImageProperty,ImageType>
Parameters:
type - the TYPE value
Returns:
the parameter object

_buildMediaTypeObj

protected ImageType _buildMediaTypeObj(String mediaType)
Description copied from class: BinaryPropertyScribe
Builds a MediaTypeParameter object based on the information in the MEDIATYPE parameter or data URI of 4.0 vCards.

Specified by:
_buildMediaTypeObj in class BinaryPropertyScribe<T extends ImageProperty,ImageType>
Parameters:
mediaType - the media type string (e.g. "image/jpeg")
Returns:
the parameter object

_parseHtml

protected T _parseHtml(HCardElement element,
                       List<String> warnings)
Description copied from class: VCardPropertyScribe

Unmarshals the property from an hCard (HTML document).

This method should be overridden by child classes that wish to support hCard. The default implementation of this method will retrieve the HTML element's hCard value (as described in HCardElement.value()), and pass it into the VCardPropertyScribe._parseText(java.lang.String, ezvcard.VCardDataType, ezvcard.VCardVersion, ezvcard.parameter.VCardParameters, java.util.List) method.

Overrides:
_parseHtml in class BinaryPropertyScribe<T extends ImageProperty,ImageType>
Parameters:
element - the property's HTML element
warnings - allows the programmer to alert the user to any note-worthy (but non-critical) issues that occurred during the unmarshalling process


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.