Class Saplings


  • public class Saplings
    extends java.lang.Object
    This is a non-instantiable class holding a number of convenience methods for creating sapling nodes of different kinds.
    See Also:
    SaplingNode
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SaplingComment comment​(java.lang.String value)
      Create a sapling comment node, with a given string value
      static SaplingDocument doc()
      Create a sapling document node, with no children
      static SaplingDocument doc​(java.lang.String baseUri)
      Create a sapling document node with a specified base URI, with no children
      static SaplingElement elem​(java.lang.String name)
      Create a sapling element node, in no namespace, with no attributes and no children
      static SaplingElement elem​(QName qName)
      Create a sapling element node, which may or may not be in a namespace, with no attributes and no children
      static SaplingProcessingInstruction pi​(java.lang.String target, java.lang.String data)
      Create a sapling processing instruction node, with a given name and string value
      static SaplingText text​(java.lang.String value)
      Create a sapling text node, with a given string value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • doc

        public static SaplingDocument doc()
        Create a sapling document node, with no children
        Returns:
        the new node
      • doc

        public static SaplingDocument doc​(java.lang.String baseUri)
        Create a sapling document node with a specified base URI, with no children
        Parameters:
        baseUri - the base URI of the document
        Returns:
        the new node
      • elem

        public static SaplingElement elem​(java.lang.String name)
        Create a sapling element node, in no namespace, with no attributes and no children
        Parameters:
        name - the local name of the element node. This must be a valid NCName, but the current implementation does not check this.
        Returns:
        the new node
      • elem

        public static SaplingElement elem​(QName qName)
        Create a sapling element node, which may or may not be in a namespace, with no attributes and no children
        Parameters:
        qName - the qualified name of the element. The current implementation does not check that the parts of the qualified name are syntactically valid.
        Returns:
        the new node
      • text

        public static SaplingText text​(java.lang.String value)
        Create a sapling text node, with a given string value
        Parameters:
        value - the string value of the text node
        Returns:
        the new node
      • comment

        public static SaplingComment comment​(java.lang.String value)
        Create a sapling comment node, with a given string value
        Parameters:
        value - the string value of the comment node. This must not contain "--" as a substring, but the current implementation does not check this.
        Returns:
        the new node
      • pi

        public static SaplingProcessingInstruction pi​(java.lang.String target,
                                                      java.lang.String data)
        Create a sapling processing instruction node, with a given name and string value
        Parameters:
        target - the target (name) of the processing instruction. This must be a valid NCName, but the current implementation does not check this.
        data - the string value of the processing instruction node. This must not contain "?>" as a substring, but the current implementation does not check this.
        Returns:
        the new node