Package com.peterphi.carbon.type
Class XMLWrapper
java.lang.Object
com.peterphi.carbon.type.XMLWrapper
- Direct Known Subclasses:
CarbonFTPSettings
,CarbonFTPUpload
,CarbonJobInfo
,CarbonModule
,CarbonModuleData
,CarbonProject
,CarbonReply
,MediaInfo
,MediaInfoTrack
Generic wrapper around some Carbon XML element
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) Helper method to retrieve the value of an attribute on this Elementorg.jdom2.Element
Return the XML Element this object is wrappingprotected org.jdom2.Element
getElement
(String name, int index) Helper method to retrieve a child element with a particular name and indexvoid
setAttribute
(String name, String value) Helper method to set the value of an attribute on this Element
-
Field Details
-
element
public org.jdom2.Element element
-
-
Constructor Details
-
XMLWrapper
public XMLWrapper(org.jdom2.Element element)
-
-
Method Details
-
getElement
public org.jdom2.Element getElement()Return the XML Element this object is wrapping- Returns:
-
setAttribute
Helper method to set the value of an attribute on this Element- Parameters:
name
- the attribute namevalue
- the value to set - if null the attribute is removed
-
getAttribute
Helper method to retrieve the value of an attribute on this Element- Parameters:
name
-- Returns:
-
getElement
Helper method to retrieve a child element with a particular name and index- Parameters:
name
- the name of the elementindex
- the index (where 0 is the first element with that name)- Returns:
- an Element (or null if none could be found by that name or with that index)
-