public class ConversionUtils extends Object
DomUtil
, and
are not generally useful to anyone who isn't writing a converter. But if you
are writing a converter, you'll probably use them a lot ...
Note: where methods in this class reference a namespaced element or attribute
(eg, xsi:type
), they do not use a prefix unless explicitly noted.
This prevents the possibility of collisions, where the same prefix is used
elsewhere in the DOM for elements not managed by the converter. A serializer
will pick an appropriate prefix for output.
Constructor and Description |
---|
ConversionUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getAttribute(Element elem,
String name)
Retrieves an arbitrary attribute.
|
static boolean |
getXsiNil(Element elem)
Returns the value of the
xsi:nil attribute on the passed
element, false if the attribute is not set. |
static void |
setAttribute(Element elem,
String name,
String value)
Sets an arbitrary attribute within the "conversion" namespace.
|
static void |
setXsiNil(Element elem,
boolean isNil)
Sets the
xsi:nil attribute to the passed value. |
public static String getAttribute(Element elem, String name)
public static void setAttribute(Element elem, String name, String value)
public static void setXsiNil(Element elem, boolean isNil)
xsi:nil
attribute to the passed value.public static boolean getXsiNil(Element elem)
xsi:nil
attribute on the passed
element, false
if the attribute is not set.