Packages

c

scala.xml

PrettyPrinter

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PrettyPrinter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PrettyPrinter(width: Int, step: Int)
  2. new PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean)

    width

    the width to fit the output into

    step

    indentation

    minimizeEmpty

    self-close empty tags

Type Members

  1. case class Box(col: Int, s: String) extends Item with Product with Serializable
  2. class BrokenException extends java.lang.Exception
  3. class Item extends AnyRef
  4. case class Para(s: String) extends Item with Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def childrenAreLeaves(n: Node): Boolean
    Attributes
    protected
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. var cur: Int
    Attributes
    protected
  8. def cut(s: String, ind: Int): List[Item]

    Try to cut at whitespace.

    Try to cut at whitespace.

    Attributes
    protected
  9. def endTag(n: Node): String
    Attributes
    protected
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def fits(test: String): Boolean
    Attributes
    protected
  13. 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

  14. def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit
  15. 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

  16. 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

  17. 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

  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. var items: List[Item]
    Attributes
    protected
  22. def leafTag(n: Node): String
    Attributes
    protected
  23. 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
  24. def makeBreak(): Unit
    Attributes
    protected
  25. def makePara(ind: Int, s: String): Unit
    Attributes
    protected
  26. val minimizeMode: MinimizeMode.Value
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. def reset(): Unit
    Attributes
    protected
  31. def startTag(n: Node, pscope: NamespaceBinding): (String, Int)
    Attributes
    protected
  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def traverse(it: Iterator[Node], scope: NamespaceBinding, ind: Int): Unit
    Attributes
    protected
  35. def traverse(node: Node, pscope: NamespaceBinding, ind: Int): Unit
    Attributes
    protected
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  39. object Break extends Item with Product with Serializable

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped