Package uk.blankaspect.common.jsonxml
Interface IElementFacade
- All Known Implementing Classes:
SimpleElementFacade
public interface IElementFacade
This interface defines methods that can be used to create JSON-XML elements and to access the attributes of JSON-XML
elements.
-
Method Summary
Modifier and TypeMethodDescriptioncreateElement
(String name) Creates and returns a new instance of a JSON-XML element whose name is the specified name or is derived from it in some way (for example, by applying a namespace prefix to it).getAttribute
(Element element, String name) Returns the value of a named attribute of the specified element.void
setAttribute
(Element element, String name, String value) Sets the value of a named attribute of the specified element.
-
Method Details
-
createElement
Creates and returns a new instance of a JSON-XML element whose name is the specified name or is derived from it in some way (for example, by applying a namespace prefix to it).- Parameters:
name
- the name from which the name of the new JSON-XML element will be derived.- Returns:
- a new instance of a JSON-XML element whose name is derived from
name
.
-
getAttribute
Returns the value of a named attribute of the specified element. The name of the attribute is the specified name or is derived from it in some way (for example, by applying a namespace prefix to it).- Parameters:
element
- the JSON-XML element whose specified attribute is of interest.name
- the name from which the name of the target attribute will be derived.- Returns:
- the value of the attribute of
element
whose name is derived fromname
.
-
setAttribute
Sets the value of a named attribute of the specified element. The name of the attribute is the specified name or is derived from it in some way (for example, by applying a namespace prefix to it).- Parameters:
element
- the JSON-XML element whose specified attribute is of interest.name
- the name from which the name of the target attribute will be derived.value
- the value to which the target attribute will be set.
-