public class XCardElement
extends java.lang.Object
Element
.Constructor and Description |
---|
XCardElement(org.w3c.dom.Element element)
Wraps an existing XML element.
|
XCardElement(org.w3c.dom.Element element,
VCardVersion version)
Wraps an existing XML element.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
all(java.lang.String localName)
Gets the value of all non-empty child elements that have the given name.
|
java.util.List<java.lang.String> |
all(VCardDataType dataType)
Gets all the values of a given data type.
|
java.util.List<org.w3c.dom.Element> |
append(java.lang.String name,
java.util.Collection<java.lang.String> values)
Adds multiple child elements, each with the same name.
|
org.w3c.dom.Element |
append(java.lang.String name,
java.lang.String value)
Adds a child element.
|
org.w3c.dom.Element |
append(VCardDataType dataType,
java.lang.String value)
Adds a value.
|
org.w3c.dom.Document |
document()
Gets the owner document.
|
org.w3c.dom.Element |
element()
Gets the wrapped XML element.
|
java.lang.String |
first(java.lang.String... names)
Gets the value of the first child element with one of the given names.
|
java.lang.String |
first(VCardDataType... dataTypes)
Gets the first value with one of the given data types.
|
VCardVersion |
version()
Gets the vCard version.
|
public XCardElement(org.w3c.dom.Element element)
element
- the XML elementpublic XCardElement(org.w3c.dom.Element element, VCardVersion version)
element
- the XML elementversion
- the vCard versionpublic java.lang.String first(VCardDataType... dataTypes)
dataTypes
- the data type(s) to look for (null signifies the
"unknown" data type)public java.lang.String first(java.lang.String... names)
names
- the possible names of the elementpublic java.util.List<java.lang.String> all(VCardDataType dataType)
dataType
- the data type to look forpublic java.util.List<java.lang.String> all(java.lang.String localName)
localName
- the element namepublic org.w3c.dom.Element append(VCardDataType dataType, java.lang.String value)
dataType
- the data type or null for the "unknown" data typevalue
- the valuepublic org.w3c.dom.Element append(java.lang.String name, java.lang.String value)
name
- the name of the child elementvalue
- the value of the child element.public java.util.List<org.w3c.dom.Element> append(java.lang.String name, java.util.Collection<java.lang.String> values)
name
- the name for all the child elementsvalues
- the values of each child elementpublic org.w3c.dom.Document document()
public org.w3c.dom.Element element()
public VCardVersion version()
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.