ezvcard.types
Class XmlType

java.lang.Object
  extended by ezvcard.types.VCardType
      extended by ezvcard.types.TextType
          extended by ezvcard.types.XmlType
All Implemented Interfaces:
Comparable<VCardType>

public class XmlType
extends TextType

Any XML data attached to the vCard. This is used if the vCard was encoded in XML (xCard standard) and it contained some non-standard elements.

 VCard vcard = new VCard();
 XmlType xml = new XmlType("<b>Some xml</b>");
 vcard.addXml(xml);
 

vCard property name: XML

vCard versions: 4.0

Author:
Michael Angstadt

Field Summary
static String NAME
           
 
Fields inherited from class ezvcard.types.TextType
value
 
Fields inherited from class ezvcard.types.VCardType
group, subTypes, typeName
 
Constructor Summary
XmlType()
           
XmlType(String xml)
           
 
Method Summary
 Element asElement()
          Converts the text value of this property to an XML Element object.
protected  void doMarshalXml(XCardElement parent, List<String> warnings, CompatibilityMode compatibilityMode)
          Marshals this type for inclusion in an xCard (XML document).
protected  void doUnmarshalXml(XCardElement element, List<String> warnings, CompatibilityMode compatibilityMode)
          Unmarshals the type from an xCard (XML document).
 String getAltId()
          Gets the ALTID.
 VCardVersion[] getSupportedVersions()
          Gets the vCard versions that support this type.
 void setAltId(String altId)
          Sets the ALTID.
 
Methods inherited from class ezvcard.types.TextType
doMarshalText, doUnmarshalHtml, doUnmarshalText, getValue, setValue
 
Methods inherited from class ezvcard.types.VCardType
compareTo, doMarshalSubTypes, getGroup, getQName, getSubTypes, getTypeName, marshalSubTypes, marshalText, marshalXml, setGroup, unmarshalHtml, unmarshalText, unmarshalXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

XmlType

public XmlType()

XmlType

public XmlType(String xml)
Parameters:
xml - the XML element
Method Detail

getAltId

public String getAltId()
Gets the ALTID.

vCard versions: 4.0

Returns:
the ALTID or null if it doesn't exist
See Also:
VCardSubTypes.getAltId()

setAltId

public void setAltId(String altId)
Sets the ALTID.

vCard versions: 4.0

Parameters:
altId - the ALTID or null to remove
See Also:
VCardSubTypes.setAltId(java.lang.String)

getSupportedVersions

public VCardVersion[] getSupportedVersions()
Description copied from class: VCardType
Gets the vCard versions that support this type.

Overrides:
getSupportedVersions in class VCardType
Returns:
the vCard versions that support this type.

asElement

public Element asElement()
                  throws SAXException
Converts the text value of this property to an XML Element object.

Returns:
the element object or null if this property's value is null
Throws:
SAXException - if there's a problem parsing the XML

doMarshalXml

protected void doMarshalXml(XCardElement parent,
                            List<String> warnings,
                            CompatibilityMode compatibilityMode)
Description copied from class: VCardType
Marshals this type for inclusion in an xCard (XML document). All child classes SHOULD override this, but are not required to.

Overrides:
doMarshalXml in class TextType
Parameters:
parent - the XML element that the type's value will be inserted into. For example, this would be the "<fn>" element for the "FN" type.
warnings - allows the programmer to alert the user to any note-worthy (but non-critical) issues that occurred during the marshalling process
compatibilityMode - allows the programmer to customize the marshalling process depending on the expected consumer of the vCard

doUnmarshalXml

protected void doUnmarshalXml(XCardElement element,
                              List<String> warnings,
                              CompatibilityMode compatibilityMode)
Description copied from class: VCardType
Unmarshals the type from an xCard (XML document).

Overrides:
doUnmarshalXml in class TextType
Parameters:
element - the XML element that contains the type data. For example, this would be the "<fn>" element for the "FN" type. This object will NOT include the "<parameters>" child element (it is removed after being unmarshalled into a VCardSubTypes object).
warnings - allows the programmer to alert the user to any note-worthy (but non-critical) issues that occurred during the unmarshalling process
compatibilityMode - allows the programmer to customize the unmarshalling process depending on where the vCard came from


Copyright © 2012-2013. All Rights Reserved.