class PrettyPrinter extends AnyRef
Class for pretty printing. After instantiating, you can use the format() and formatNode() methods to convert XML to a formatted string. The class can be reused to pretty print any number of XML nodes.
- Note
This class is not threadsafe and should not be accessed by multiple threads at the same time.
- Alphabetic
- By Inheritance
- PrettyPrinter
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def childrenAreLeaves(n: Node): Boolean
- Attributes
- protected
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- var cur: Int
- Attributes
- protected
- def cut(s: String, ind: Int): List[Item]
Try to cut at whitespace.
Try to cut at whitespace.
- Attributes
- protected
- def endTag(n: Node): String
- Attributes
- protected
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fits(test: String): Boolean
- Attributes
- protected
- def format(n: Node, pscope: NamespaceBinding = TopScope): String
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
- n
the node to be serialized
- pscope
the namespace to prefix mapping
- returns
the formatted string
- def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit
- def format(n: Node, sb: StringBuilder): Unit
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
- n
the node to be serialized
- sb
the stringbuffer to append to
- def formatNodes(nodes: collection.Seq[Node], pscope: NamespaceBinding, sb: StringBuilder): Unit
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
- nodes
the nodes to be serialized
- pscope
the namespace to prefix mapping
- sb
the string buffer to which to append to
- def formatNodes(nodes: collection.Seq[Node], pscope: NamespaceBinding = TopScope): String
Returns a formatted string containing well-formed XML.
Returns a formatted string containing well-formed XML.
- nodes
the sequence of nodes to be serialized
- pscope
the namespace to prefix mapping
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- var items: List[Item]
- Attributes
- protected
- def leafTag(n: Node): String
- Attributes
- protected
- def makeBox(ind: Int, s: String): Unit
Try to make indented box, if possible, else para.
Try to make indented box, if possible, else para.
- Attributes
- protected
- def makeBreak(): Unit
- Attributes
- protected
- def makePara(ind: Int, s: String): Unit
- Attributes
- protected
- val minimizeMode: MinimizeMode.Value
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def reset(): Unit
- Attributes
- protected
- def startTag(n: Node, pscope: NamespaceBinding): (String, Int)
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse(it: Iterator[Node], scope: NamespaceBinding, ind: Int): Unit
- Attributes
- protected
- def traverse(node: Node, pscope: NamespaceBinding, ind: Int): Unit
- Attributes
- protected
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object Break extends Item with Product with Serializable