@SupportedVersions(value=V4_0) public class Xml extends VCardProperty implements HasAltId
Contains an XML element that was not recognized when parsing an xCard (XML-formatted vCard).
Code sample
VCard vcard = new VCard(); Xml xml = new Xml("<b>Some xml</b>"); vcard.addXml(xml);
Property name: XML
Supported versions: 4.0
group, parameters
Constructor and Description |
---|
Xml(Document document)
Creates an XML property.
|
Xml(Element element)
Creates an XML property.
|
Xml(String xml)
Creates an XML property.
|
Xml(Xml original)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_validate(List<ValidationWarning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
Xml |
copy()
Creates a copy of this property object.
|
boolean |
equals(Object obj) |
String |
getAltId()
Gets the property's ALTID parameter.
|
Document |
getValue()
Gets the value of this property.
|
int |
hashCode() |
void |
setAltId(String altId)
Sets the property's ALTID parameter.
|
void |
setValue(Document value)
Sets the value of this property.
|
protected Map<String,Object> |
toStringValues()
Gets string representations of the class's fields for the
VCardProperty.toString() method. |
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, isSupportedBy, removeParameter, setGroup, setParameter, setParameters, toString, validate
public Xml(String xml) throws SAXException
xml
- the XML to use as the property's valueSAXException
- if the XML cannot be parsedpublic Xml(Element element)
element
- the XML element to use as the property's value (the
element is imported into an empty Document
object)public Xml(Document document)
document
- the XML document to use as the property's valuepublic Document getValue()
public void setValue(Document value)
value
- the valuepublic 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<ValidationWarning> 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 toprotected Map<String,Object> toStringValues()
VCardProperty
Gets string representations of the class's fields for the
VCardProperty.toString()
method.
Meant to be overridden by child classes. The default implementation returns an empty map.
toStringValues
in class VCardProperty
public Xml copy()
VCardProperty
Creates a copy of this property object.
The default implementation of this method uses reflection to look for a copy constructor. Child classes SHOULD override this method to avoid the performance overhead involved in using reflection.
The child class's copy constructor, if present, MUST invoke the
VCardProperty.VCardProperty(VCardProperty)
super constructor to ensure that
the group name and parameters are also copied.
This method MUST be overridden by the child class if the child class does
not have a copy constructor. Otherwise, an
UnsupportedOperationException
will be thrown when an attempt is
made to copy the property (such as in the VCard
class's copy constructor
).
copy
in class VCardProperty
public int hashCode()
hashCode
in class VCardProperty
public boolean equals(Object obj)
equals
in class VCardProperty
Copyright © 2012–2023 Michael Angstadt. All rights reserved.