Class XmlNode.Builder
java.lang.Object
org.apache.maven.api.xml.XmlNode.Builder
- Enclosing interface:
XmlNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattributes
(Map<String, String> attributes) Sets the attributes of the XML node.build()
Builds a new XmlNode instance with the current builder settings.Sets the child nodes of the XML node.inputLocation
(Object inputLocation) Sets the input location information for the XML node.Sets the name of the XML node.namespaceUri
(String namespaceUri) Sets the namespace URI of the XML node.Sets the namespace prefix of the XML node.Sets the text content of the XML node.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the name of the XML node.This is the only required property that must be set before calling
build()
.- Parameters:
name
- the name of the XML node- Returns:
- this builder instance
- Throws:
NullPointerException
- if name is null
-
value
Sets the text content of the XML node.- Parameters:
value
- the text content of the XML node- Returns:
- this builder instance
-
namespaceUri
Sets the namespace URI of the XML node.- Parameters:
namespaceUri
- the namespace URI of the XML node- Returns:
- this builder instance
-
prefix
Sets the namespace prefix of the XML node.- Parameters:
prefix
- the namespace prefix of the XML node- Returns:
- this builder instance
-
attributes
Sets the attributes of the XML node.The provided map will be copied to ensure immutability.
- Parameters:
attributes
- the map of attribute names to values- Returns:
- this builder instance
-
children
Sets the child nodes of the XML node.The provided list will be copied to ensure immutability.
- Parameters:
children
- the list of child nodes- Returns:
- this builder instance
-
inputLocation
Sets the input location information for the XML node.This is typically used for error reporting and debugging purposes.
- Parameters:
inputLocation
- the input location object- Returns:
- this builder instance
-
build
Builds a new XmlNode instance with the current builder settings.- Returns:
- a new immutable XmlNode instance
- Throws:
NullPointerException
- if name has not been set
-