Class FormatXMLElements
java.lang.Object
com.io7m.coffeepick.runtime.format.xml.FormatXMLElements
public final class FormatXMLElements
extends java.lang.Object
Functions to transform values into XML elements.
-
Constructor Summary
Constructors Constructor Description FormatXMLElements()
Construct an element producer. -
Method Summary
Modifier and Type Method Description org.w3c.dom.Document
document()
Create a new empty document.static org.w3c.dom.Element
ofBranding(org.w3c.dom.Document document, RuntimeRepositoryBranding branding)
Serialize the given branding, using the given document to create elements.static org.w3c.dom.Element
ofBuild(org.w3c.dom.Document document, RuntimeBuild build)
Serialize the given build, using the given document to create elements.static org.w3c.dom.Element
ofHash(org.w3c.dom.Document document, RuntimeHash hash)
Serialize the given hash, using the given document to create elements.org.w3c.dom.Document
ofRepository(RuntimeRepositoryDescription repository)
Create a new document from the given repository.static org.w3c.dom.Element
ofRepository(org.w3c.dom.Document document, RuntimeRepositoryDescription repository)
Serialize the given repository, using the given document to create elements.static org.w3c.dom.Element
ofRuntime(org.w3c.dom.Document document, RuntimeDescription runtime, boolean append_repository)
Serialize the given runtime, using the given document to create elements.static org.w3c.dom.Element
ofTag(org.w3c.dom.Document document, java.lang.String tag)
Serialize the given tag, using the given document to create elements.static org.w3c.dom.Element
ofTags(org.w3c.dom.Document document, java.util.Set<java.lang.String> tags)
Serialize the given set of tags, using the given document to create elements.
-
Constructor Details
-
FormatXMLElements
public FormatXMLElements()Construct an element producer.
-
-
Method Details
-
ofRepository
public static org.w3c.dom.Element ofRepository(org.w3c.dom.Document document, RuntimeRepositoryDescription repository)Serialize the given repository, using the given document to create elements.- Parameters:
document
- The target documentrepository
- The repository- Returns:
- A serialized repository
-
ofBranding
public static org.w3c.dom.Element ofBranding(org.w3c.dom.Document document, RuntimeRepositoryBranding branding)Serialize the given branding, using the given document to create elements.- Parameters:
document
- The target documentbranding
- The branding- Returns:
- A serialized branding
-
ofRuntime
public static org.w3c.dom.Element ofRuntime(org.w3c.dom.Document document, RuntimeDescription runtime, boolean append_repository)Serialize the given runtime, using the given document to create elements.- Parameters:
document
- The target documentruntime
- The runtimeappend_repository
- True if the repository ID should be included in the element- Returns:
- A serialized runtime
-
ofTags
public static org.w3c.dom.Element ofTags(org.w3c.dom.Document document, java.util.Set<java.lang.String> tags)Serialize the given set of tags, using the given document to create elements.- Parameters:
document
- The target documenttags
- The set of tags- Returns:
- A serialized set of tags
-
ofTag
public static org.w3c.dom.Element ofTag(org.w3c.dom.Document document, java.lang.String tag)Serialize the given tag, using the given document to create elements.- Parameters:
document
- The target documenttag
- The tag- Returns:
- A serialized tag
-
ofHash
Serialize the given hash, using the given document to create elements.- Parameters:
document
- The target documenthash
- The hash- Returns:
- A serialized hash
-
ofBuild
Serialize the given build, using the given document to create elements.- Parameters:
document
- The target documentbuild
- The build- Returns:
- A serialized build
-
ofRepository
public org.w3c.dom.Document ofRepository(RuntimeRepositoryDescription repository) throws javax.xml.parsers.ParserConfigurationExceptionCreate a new document from the given repository.- Parameters:
repository
- The repository- Returns:
- A document
- Throws:
javax.xml.parsers.ParserConfigurationException
- On configuration errors
-
document
public org.w3c.dom.Document document() throws javax.xml.parsers.ParserConfigurationExceptionCreate a new empty document.- Returns:
- An empty document
- Throws:
javax.xml.parsers.ParserConfigurationException
- On configuration errors
-