eu.cdevreeze.yaidom

ElemBuilder

final class ElemBuilder extends NodeBuilder with ParentElemLike[ElemBuilder] with TransformableElemLike[NodeBuilder, ElemBuilder]

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

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

Self Type
ElemBuilder
Annotations
@SerialVersionUID( 1L )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ElemBuilder
  2. TransformableElemLike
  3. TransformableElemApi
  4. ParentElemLike
  5. ParentElemApi
  6. NodeBuilder
  7. Serializable
  8. Serializable
  9. Immutable
  10. AnyRef
  11. 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
    ElemBuilderNodeBuilder

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: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    Shorthand for filterChildElems(p).

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

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

    Shorthand for filterElemsOrSelf(p).

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

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

    Shorthand for findTopmostElemsOrSelf(p).

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

    Definition Classes
    ParentElemLikeParentElemApi
  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)]

  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: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    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: E => Boolean): immutable.IndexedSeq[E] =
    this.findAllChildElems.filter(p)
    Definition Classes
    ParentElemLikeParentElemApi
  21. final def filterElems(p: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  22. final def filterElemsOrSelf(p: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    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: E => Boolean): immutable.IndexedSeq[E] =
    Vector(this).filter(p) ++ (this.findAllChildElems flatMap (_.filterElemsOrSelf(p)))

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

    Definition Classes
    ParentElemLikeParentElemApi
  23. def finalize(): Unit

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

    Returns the element children as ElemBuilder instances

    Returns the element children as ElemBuilder instances

    Definition Classes
    ElemBuilderParentElemLikeParentElemApi
  25. final def findAllElems: IndexedSeq[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  26. final def findAllElemsOrSelf: IndexedSeq[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  27. final def findChildElem(p: (ElemBuilder) ⇒ Boolean): Option[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  28. final def findElem(p: (ElemBuilder) ⇒ Boolean): Option[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  29. final def findElemOrSelf(p: (ElemBuilder) ⇒ Boolean): Option[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  30. final def findTopmostElems(p: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    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
    ParentElemLikeParentElemApi
  31. final def findTopmostElemsOrSelf(p: (ElemBuilder) ⇒ Boolean): IndexedSeq[ElemBuilder]

    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: E => Boolean): immutable.IndexedSeq[E] =
    if (p(this)) Vector(this)
    else (this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p)))
    Definition Classes
    ParentElemLikeParentElemApi
  32. final def getChildElem(p: (ElemBuilder) ⇒ Boolean): ElemBuilder

    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
    ParentElemLikeParentElemApi
  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 notify(): Unit

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

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

    Returns withChildren(self.children :+ newChild).

  42. val qname: QName

  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  44. final def toString(): String

    Returns toTreeRepr.

    Returns toTreeRepr.

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

    Returns the tree representation.

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

    Definition Classes
    NodeBuilder
  46. 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
  47. 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
  48. final def transformElems(f: (ElemBuilder) ⇒ ElemBuilder): ElemBuilder

    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
  49. final def transformElemsOrSelf(f: (ElemBuilder) ⇒ ElemBuilder): ElemBuilder

    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
  50. final def transformElemsOrSelfToNodeSeq(f: (ElemBuilder) ⇒ IndexedSeq[NodeBuilder]): IndexedSeq[NodeBuilder]

    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
  51. final def transformElemsToNodeSeq(f: (ElemBuilder) ⇒ IndexedSeq[NodeBuilder]): ElemBuilder

    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
  52. final def wait(): Unit

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

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

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

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

Inherited from ParentElemLike[ElemBuilder]

Inherited from ParentElemApi[ElemBuilder]

Inherited from NodeBuilder

Inherited from Serializable

Inherited from Serializable

Inherited from Immutable

Inherited from AnyRef

Inherited from Any

Ungrouped