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

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[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  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: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fits(test: String): Boolean
    Attributes
    protected
  14. 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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped