Package cz.martlin.xspf.util
Class XSPFDocumentUtility
- java.lang.Object
-
- cz.martlin.xspf.util.XSPFDocumentUtility
-
public class XSPFDocumentUtility extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceXSPFDocumentUtility.TextToValueMapper<T>static interfaceXSPFDocumentUtility.ValueToTextMapper<T>
-
Constructor Summary
Constructors Constructor Description XSPFDocumentUtility(String nsName, String nsURL)
-
Method Summary
-
-
-
Method Detail
-
init
public void init(Document document) throws XSPFException
- Throws:
XSPFException
-
getElementText
public String getElementText(Element owner, String elemName) throws XSPFException
- Throws:
XSPFException
-
setElementText
public void setElementText(Element owner, String elemName, String value) throws XSPFException
- Throws:
XSPFException
-
getElementValue
public <T> T getElementValue(Element owner, String elemName, XSPFDocumentUtility.TextToValueMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
setElementValue
public <T> void setElementValue(Element elem, T value, XSPFDocumentUtility.ValueToTextMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
getElementValue
public <T> T getElementValue(Element elem, XSPFDocumentUtility.TextToValueMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
setElementValue
public <T> void setElementValue(Element owner, String elemName, T value, XSPFDocumentUtility.ValueToTextMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
getElementAttr
public String getElementAttr(Element owner, String attrName) throws XSPFException
- Throws:
XSPFException
-
setElementAttr
public void setElementAttr(Element owner, String attrName, String value) throws XSPFException
- Throws:
XSPFException
-
getElementAttr
public <T> T getElementAttr(Element owner, String attrName, XSPFDocumentUtility.TextToValueMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
setElementAttr
public <T> void setElementAttr(Element owner, String attrName, T value, XSPFDocumentUtility.ValueToTextMapper<T> mapper) throws XSPFException
- Throws:
XSPFException
-
getOrCreateChildElem
public Element getOrCreateChildElem(Element owner, String elemName) throws XSPFException
- Throws:
XSPFException
-
getOrCreateRootElem
public Element getOrCreateRootElem(Document doc, String elemName) throws XSPFException
- Throws:
XSPFException
-
getChildElem
public Element getChildElem(Element owner, String elemName) throws XSPFException
- Throws:
XSPFException
-
getRootElem
public Element getRootElem(Document doc, String elemName) throws XSPFException
- Throws:
XSPFException
-
replaceChildElem
public Element replaceChildElem(Element owner, String elemName) throws XSPFException
- Throws:
XSPFException
-
replaceChildElem
public Element replaceChildElem(Element owner, String elemName, Element replacement) throws XSPFException
- Throws:
XSPFException
-
replaceAllChildren
public void replaceAllChildren(Element owner, String elemName, List<Element> elements) throws XSPFException
- Throws:
XSPFException
-
-