Class

eu.cdevreeze.yaidom.simple

ElemBuilder

Related Doc: package simple

Permalink

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()
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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Type Members

  1. type NodeType = Elem

    Permalink
    Definition Classes
    ElemBuilderCanBeDocBuilderChildNodeBuilder
  2. type ThisElem = ElemBuilder

    Permalink

    The element type itself.

    The element type itself. It must be restricted to a sub-type of the query API trait in question.

    Concrete element classes will restrict this type to that element class itself.

    Definition Classes
    ElemBuilderTransformableElemLikeTransformableElemApiElemLikeElemApiAnyElemApi
  3. type ThisNode = NodeBuilder

    Permalink

    The node type, that is a super-type of the element type, but also of corresponding text node types etc.

    The node type, that is a super-type of the element type, but also of corresponding text node types etc.

    Definition Classes
    ElemBuilderAnyElemNodeApi

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. final def \(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink

    Shorthand for filterChildElems(p).

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

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

    Permalink

    Shorthand for filterElemsOrSelf(p).

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

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

    Permalink

    Shorthand for findTopmostElemsOrSelf(p).

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

    Definition Classes
    ElemLikeElemApi
  7. def allDeclarationsAreAtTopLevel: Boolean

    Permalink

    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.

  8. final def asInstanceOf[T0]: T0

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

    Permalink

    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
  10. def build(parentScope: Scope): Elem

    Permalink

    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
  11. final def build(): NodeType

    Permalink

    Returns build(Scope.Empty)

    Returns build(Scope.Empty)

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

    Permalink

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

  13. val children: IndexedSeq[NodeBuilder]

    Permalink
  14. def clone(): AnyRef

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

    Permalink

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

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

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

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

    Permalink

    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
  19. final def filterElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink

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

    Permalink

    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
  21. def finalize(): Unit

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

    Permalink

    Returns the element children as ElemBuilder instances

    Returns the element children as ElemBuilder instances

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

    Permalink

    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
  24. final def findAllElemsOrSelf: IndexedSeq[ThisElem]

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

    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
  30. final def getChildElem(p: (ThisElem) ⇒ Boolean): ThisElem

    Permalink

    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
  31. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  34. val namespaces: Declarations

    Permalink
  35. final def ne(arg0: AnyRef): Boolean

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

    Permalink

    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.

  37. final def normalizedText: String

    Permalink

    Returns XmlStringUtils.normalizeString(text).

    Returns XmlStringUtils.normalizeString(text).

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

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

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

    Permalink

    Returns withChildren(thisElem.children :+ newChild).

  41. val qname: QName

    Permalink

    The QName of the element

    The QName of the element

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

    Permalink
    Definition Classes
    AnyRef
  43. def text: String

    Permalink

    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
  44. def textChildren: IndexedSeq[TextBuilder]

    Permalink

    Returns the text children

  45. def thisElem: ThisElem

    Permalink

    This element itself.

    This element itself.

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

    Permalink

    Returns toTreeRepr.

    Returns toTreeRepr.

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

    Permalink

    Returns the tree representation.

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

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

    Permalink

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

    Permalink

    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
  50. final def transformElems(f: (ThisElem) ⇒ ThisElem): ThisElem

    Permalink

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

    Permalink

    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
  52. final def transformElemsOrSelfToNodeSeq(f: (ThisElem) ⇒ IndexedSeq[ThisNode]): IndexedSeq[ThisNode]

    Permalink

    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
  53. final def transformElemsToNodeSeq(f: (ThisElem) ⇒ IndexedSeq[ThisNode]): ThisElem

    Permalink

    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
  54. final def trimmedText: String

    Permalink

    Returns text.trim.

    Returns text.trim.

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

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

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

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

    Permalink

    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