eu.cdevreeze.yaidom.simple

ElemBuilder

final class ElemBuilder extends CanBeDocBuilderChild with ElemLike with TransformableElemLike with HasQNameApi with HasText

Builder for elements. See eu.cdevreeze.yaidom.simple.NodeBuilder.

See the documentation of the mixed-in query API trait(s) for more details on the uniform query API offered by this class.

Annotations
@SerialVersionUID( 1L )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ElemBuilder
  2. HasText
  3. HasTextApi
  4. HasQNameApi
  5. TransformableElemLike
  6. TransformableElemApi
  7. AnyElemNodeApi
  8. ElemLike
  9. ElemApi
  10. AnyElemApi
  11. CanBeDocBuilderChild
  12. NodeBuilder
  13. Serializable
  14. Serializable
  15. Immutable
  16. AnyRef
  17. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ElemBuilder(qname: QName, attributes: IndexedSeq[(QName, String)], namespaces: Declarations, children: IndexedSeq[NodeBuilder])

Type Members

  1. type NodeType = Elem

    Definition Classes
    ElemBuilderCanBeDocBuilderChildNodeBuilder
  2. type ThisElem = ElemBuilder

    Definition Classes
    ElemBuilderAnyElemNodeApiAnyElemApi
  3. type ThisElemApi = ElemBuilder

  4. type ThisNode = NodeBuilder

    Definition Classes
    ElemBuilderAnyElemNodeApi

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def \(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Shorthand for filterChildElems(p).

    Shorthand for filterChildElems(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  7. final def \\(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Shorthand for filterElemsOrSelf(p).

    Shorthand for filterElemsOrSelf(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  8. final def \\!(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Shorthand for findTopmostElemsOrSelf(p).

    Shorthand for findTopmostElemsOrSelf(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  9. def allDeclarationsAreAtTopLevel: Boolean

    Returns true if all namespace declarations, if any, are only at top level (so at the root of this tree).

    Returns true if all namespace declarations, if any, are only at top level (so at the root of this tree).

    It is good practice for a complete ElemBuilder tree to have only top-level namespace declarations, if any.

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. val attributes: IndexedSeq[(QName, String)]

    The attributes of the element as mapping from QNames to values

    The attributes of the element as mapping from QNames to values

    Definition Classes
    ElemBuilderHasQNameApi
  12. def build(parentScope: Scope): Elem

    Creates an Elem from this element builder, using the passed parent scope.

    Creates an Elem from this element builder, using the passed parent scope.

    The Scope of the created (root) element is the passed parent scope, altered by the namespace declarations in this element builder, if any.

    Definition Classes
    ElemBuilderNodeBuilder
  13. final def build(): NodeType

    Returns build(Scope.Empty)

    Returns build(Scope.Empty)

    Definition Classes
    NodeBuilder
  14. def canBuild(parentScope: Scope): Boolean

    Returns true if parentScope suffices to build an Elem, that is, if build(parentScope) returns an Elem instead of throwing an exception.

    Returns true if parentScope suffices to build an Elem, that is, if build(parentScope) returns an Elem instead of throwing an exception.

    A complete ElemBuilder tree should obey property canBuild(Scope.Empty).

  15. val children: IndexedSeq[NodeBuilder]

  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def copy(qname: QName = this.qname, attributes: IndexedSeq[(QName, String)] = this.attributes, namespaces: Declarations = this.namespaces, children: IndexedSeq[NodeBuilder] = this.children): ElemBuilder

    Creates a copy, altered with the explicitly passed parameters (for qname, attributes, namespaces and children).

  18. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  20. final def filterChildElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Returns the child elements obeying the given predicate.

    Returns the child elements obeying the given predicate. This method could be defined as:

    def filterChildElems(p: ThisElem => Boolean): immutable.IndexedSeq[ThisElem] =
    this.findAllChildElems.filter(p)
    Definition Classes
    ElemLikeElemApi
  21. final def filterElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Returns the descendant elements obeying the given predicate.

    Returns the descendant elements obeying the given predicate. This method could be defined as:

    this.findAllChildElems flatMap (_.filterElemsOrSelf(p))
    Definition Classes
    ElemLikeElemApi
  22. final def filterElemsOrSelf(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Returns the descendant-or-self elements obeying the given predicate.

    Returns the descendant-or-self elements obeying the given predicate. This method could be defined as:

    def filterElemsOrSelf(p: ThisElem => Boolean): immutable.IndexedSeq[ThisElem] =
    Vector(this).filter(p) ++ (this.findAllChildElems flatMap (_.filterElemsOrSelf(p)))

    It can be proven that the result is equivalent to findAllElemsOrSelf filter p.

    Definition Classes
    ElemLikeElemApi
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def findAllChildElems: IndexedSeq[ElemBuilder]

    Returns the element children as ElemBuilder instances

    Returns the element children as ElemBuilder instances

    Definition Classes
    ElemBuilderElemLikeElemApi
  25. final def findAllElems: IndexedSeq[ThisElem]

    Returns all descendant elements (not including this element).

    Returns all descendant elements (not including this element). This method could be defined as filterElems { e => true }. Equivalent to findAllElemsOrSelf.drop(1).

    Definition Classes
    ElemLikeElemApi
  26. final def findAllElemsOrSelf: IndexedSeq[ThisElem]

    Returns this element followed by all descendant elements (that is, the descendant-or-self elements).

    Returns this element followed by all descendant elements (that is, the descendant-or-self elements). This method could be defined as filterElemsOrSelf { e => true }.

    Definition Classes
    ElemLikeElemApi
  27. final def findChildElem(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Returns the first found child element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found child element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterChildElems(p).headOption.

    Definition Classes
    ElemLikeElemApi
  28. final def findElem(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Returns the first found (topmost) descendant element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found (topmost) descendant element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterElems(p).headOption.

    Definition Classes
    ElemLikeElemApi
  29. final def findElemOrSelf(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Returns the first found (topmost) descendant-or-self element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found (topmost) descendant-or-self element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterElemsOrSelf(p).headOption.

    Definition Classes
    ElemLikeElemApi
  30. final def findTopmostElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Returns the descendant elements obeying the given predicate that have no ancestor obeying the predicate.

    Returns the descendant elements obeying the given predicate that have no ancestor obeying the predicate. This method could be defined as:

    this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p))
    Definition Classes
    ElemLikeElemApi
  31. final def findTopmostElemsOrSelf(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate.

    Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate. This method could be defined as:

    def findTopmostElemsOrSelf(p: ThisElem => Boolean): immutable.IndexedSeq[ThisElem] =
    if (p(this)) Vector(this)
    else (this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p)))
    Definition Classes
    ElemLikeElemApi
  32. final def getChildElem(p: (ThisElem) ⇒ Boolean): ThisElem

    Returns the single child element obeying the given predicate, and throws an exception otherwise.

    Returns the single child element obeying the given predicate, and throws an exception otherwise. This method could be defined as findChildElem(p).get.

    Definition Classes
    ElemLikeElemApi
  33. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  36. val namespaces: Declarations

  37. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. def nonDeclaredPrefixes(parentScope: Scope): Set[String]

    Returns the accumulated used but non-declared prefixes throughout the tree, given the passed parentScope.

    Returns the accumulated used but non-declared prefixes throughout the tree, given the passed parentScope. A prefix is considered used in an element if it is used in element name and/or attribute names.

  39. final def normalizedText: String

    Returns XmlStringUtils.normalizeString(text).

    Returns XmlStringUtils.normalizeString(text).

    Definition Classes
    HasTextHasTextApi
  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. def plusChild(newChild: NodeBuilder): ElemBuilder

    Returns withChildren(thisElem.children :+ newChild).

  43. val qname: QName

    The QName of the element

    The QName of the element

    Definition Classes
    ElemBuilderHasQNameApi
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  45. def text: String

    Returns the concatenation of the texts of text children, including whitespace and CData.

    Returns the concatenation of the texts of text children, including whitespace and CData. Non-text children are ignored. If there are no text children, the empty string is returned.

    Definition Classes
    ElemBuilderHasTextApi
  46. def textChildren: IndexedSeq[TextBuilder]

    Returns the text children

  47. def thisElem: ThisElem

    Definition Classes
    ElemBuilderAnyElemApi
  48. final def toString(): String

    Returns toTreeRepr.

    Returns toTreeRepr.

    Definition Classes
    NodeBuilder → AnyRef → Any
  49. final def toTreeRepr(parentScope: Scope): String

    Returns the tree representation.

    Returns the tree representation. See the corresponding method in eu.cdevreeze.yaidom.simple.Node.

    Definition Classes
    NodeBuilder
  50. def transformChildElems(f: (ElemBuilder) ⇒ ElemBuilder): ElemBuilder

    Returns the same element, except that child elements have been replaced by applying the given function.

    Returns the same element, except that child elements have been replaced by applying the given function. Non-element child nodes occur in the result element unaltered.

    That is, returns the equivalent of:

    val newChildren =
      children map {
        case e: E => f(e)
        case n: N => n
      }
    withChildren(newChildren)
    Definition Classes
    ElemBuilderTransformableElemLikeTransformableElemApi
  51. def transformChildElemsToNodeSeq(f: (ElemBuilder) ⇒ IndexedSeq[NodeBuilder]): ElemBuilder

    Returns the same element, except that child elements have been replaced by applying the given function.

    Returns the same element, except that child elements have been replaced by applying the given function. Non-element child nodes occur in the result element unaltered.

    That is, returns the equivalent of:

    val newChildren =
      children flatMap {
        case e: E => f(e)
        case n: N => Vector(n)
      }
    withChildren(newChildren)
    Definition Classes
    ElemBuilderTransformableElemLikeTransformableElemApi
  52. final def transformElems(f: (ThisElem) ⇒ ThisElem): ThisElem

    Transforms the element by applying the given function to all its descendant elements, in a bottom-up manner.

    Transforms the element by applying the given function to all its descendant elements, in a bottom-up manner.

    That is, returns the equivalent of:

    transformChildElems (e => e.transformElemsOrSelf(f))
    Definition Classes
    TransformableElemLikeTransformableElemApi
  53. final def transformElemsOrSelf(f: (ThisElem) ⇒ ThisElem): ThisElem

    Transforms the element by applying the given function to all its descendant-or-self elements, in a bottom-up manner.

    Transforms the element by applying the given function to all its descendant-or-self elements, in a bottom-up manner.

    That is, returns the equivalent of:

    f(transformChildElems (e => e.transformElemsOrSelf(f)))

    In other words, returns the equivalent of:

    f(transformElems(f))
    Definition Classes
    TransformableElemLikeTransformableElemApi
  54. final def transformElemsOrSelfToNodeSeq(f: (ThisElem) ⇒ IndexedSeq[ThisNode]): IndexedSeq[ThisNode]

    Transforms each descendant element to a node sequence by applying the given function to all its descendant-or-self elements, in a bottom-up manner.

    Transforms each descendant element to a node sequence by applying the given function to all its descendant-or-self elements, in a bottom-up manner.

    That is, returns the equivalent of:

    f(transformChildElemsToNodeSeq(e => e.transformElemsOrSelfToNodeSeq(f)))

    In other words, returns the equivalent of:

    f(transformElemsToNodeSeq(f))
    Definition Classes
    TransformableElemLikeTransformableElemApi
  55. final def transformElemsToNodeSeq(f: (ThisElem) ⇒ IndexedSeq[ThisNode]): ThisElem

    Transforms each descendant element to a node sequence by applying the given function to all its descendant elements, in a bottom-up manner.

    Transforms each descendant element to a node sequence by applying the given function to all its descendant elements, in a bottom-up manner. The function is not applied to this element itself.

    That is, returns the equivalent of:

    transformChildElemsToNodeSeq(e => e.transformElemsOrSelfToNodeSeq(f))

    It is equivalent to the following expression:

    transformElemsOrSelf { e => e.transformChildElemsToNodeSeq(che => f(che)) }
    Definition Classes
    TransformableElemLikeTransformableElemApi
  56. final def trimmedText: String

    Returns text.trim.

    Returns text.trim.

    Definition Classes
    HasTextHasTextApi
  57. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def withChildren(newChildren: IndexedSeq[NodeBuilder]): ElemBuilder

    Creates a copy, but with (only) the children passed as parameter newChildren

Inherited from HasText

Inherited from HasTextApi

Inherited from HasQNameApi

Inherited from TransformableElemLike

Inherited from TransformableElemApi

Inherited from AnyElemNodeApi

Inherited from ElemLike

Inherited from ElemApi

Inherited from AnyElemApi

Inherited from CanBeDocBuilderChild

Inherited from NodeBuilder

Inherited from Serializable

Inherited from Serializable

Inherited from Immutable

Inherited from AnyRef

Inherited from Any

Ungrouped