Class

scala.xml

PrettyPrinter

Related Doc: package xml

Permalink

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.

Version

1.0

Linear Supertypes
AnyRef, Any
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)

    Permalink

    width

    the width to fit the output into

    step

    indentation

Type Members

  1. case class Box(col: Int, s: String) extends Item with Product with Serializable

    Permalink
  2. class BrokenException extends java.lang.Exception

    Permalink
  3. class Item extends AnyRef

    Permalink
  4. case class Para(s: String) extends Item with Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Break extends Item with Product with Serializable

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def childrenAreLeaves(n: Node): Boolean

    Permalink
    Attributes
    protected
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. var cur: Int

    Permalink
    Attributes
    protected
  9. def cut(s: String, ind: Int): List[Item]

    Permalink

    Try to cut at whitespace.

    Try to cut at whitespace.

    Attributes
    protected
  10. def endTag(n: Node): String

    Permalink
    Attributes
    protected
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def fits(test: String): Boolean

    Permalink
    Attributes
    protected
  15. def format(n: Node, pscope: NamespaceBinding = TopScope): String

    Permalink

    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

  16. def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit

    Permalink
  17. def format(n: Node, sb: StringBuilder): Unit

    Permalink

    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

  18. def formatNodes(nodes: Seq[Node], pscope: NamespaceBinding, sb: StringBuilder): Unit

    Permalink

    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

  19. def formatNodes(nodes: Seq[Node], pscope: NamespaceBinding = TopScope): String

    Permalink

    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

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. var items: List[Item]

    Permalink
    Attributes
    protected
  24. def leafTag(n: Node): String

    Permalink
    Attributes
    protected
  25. def makeBox(ind: Int, s: String): Unit

    Permalink

    Try to make indented box, if possible, else para.

    Try to make indented box, if possible, else para.

    Attributes
    protected
  26. def makeBreak(): Unit

    Permalink
    Attributes
    protected
  27. def makePara(ind: Int, s: String): Unit

    Permalink
    Attributes
    protected
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def reset(): Unit

    Permalink
    Attributes
    protected
  32. def startTag(n: Node, pscope: NamespaceBinding): (String, Int)

    Permalink
    Attributes
    protected
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. def traverse(it: Iterator[Node], scope: NamespaceBinding, ind: Int): Unit

    Permalink
    Attributes
    protected
  36. def traverse(node: Node, pscope: NamespaceBinding, ind: Int): Unit

    Permalink
    Attributes
    protected
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped