Package com.jme3.export.xml
Class XMLUtils
java.lang.Object
com.jme3.export.xml.XMLUtils
Utilities for reading and writing XML files.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getAttribute
(int version, Element element, String name) Fetches the named attribute from the element.static boolean
hasAttribute
(int version, Element element, String name) Tests if the element contains the named attribute.static void
setAttribute
(Element element, String name, String attribute) Sets the attribute in the element under the name.
-
Field Details
-
PREFIX
Prefix for every jme xml attribute for format versions 3 and up.This prefix should be appended at the beginning of every xml attribute name. For format versions 3 and up, every name to access an attribute must append this prefix first.
- See Also:
-
-
Method Details
-
setAttribute
Sets the attribute in the element under the name.Automatically appends
PREFIX
to the beginning of the name before assigning the attribute to the element.- Parameters:
element
- element to set the attribute inname
- name of the attribute (without prefix)attribute
- attribute to save
-
getAttribute
Fetches the named attribute from the element.Automatically appends
PREFIX
to the beginning of the name before looking up the attribute for format versions 3 and up.- Parameters:
version
- format version of the xmlelement
- XML element to get the attribute fromname
- name of the attribute (without prefix)- Returns:
- named attribute
-
hasAttribute
Tests if the element contains the named attribute.Automatically appends
PREFIX
to the beginning of the name before looking up the attribute for format versions 3 and up.- Parameters:
version
- format version of the xmlelement
- element to testname
- name of the attribute (without prefix)- Returns:
- true if the element has the named attribute
-