scala.xml.dtd
class ElementValidator

[source: `scala/xml/dtd/ElementValidator.scala`]

`` `class` ElementValidator
  `extends` (Node) => Boolean

  validate children and/or attributes of an element exceptions are created but not thrown.

Value Summary
`protected var` | adecls : List[AttrDecl]
`protected var` | contentModel : ContentModel
`protected var` | dfa : DetWordAutom[ElemName]
`var` | exc : List[ValidationException]

Method Summary
`def` | apply (n : Node) : Boolean applies various validations - accumulates error messages in exc
`def` | check (md : MetaData) : Boolean check attributes, return true if md corresponds to attribute declarations in adecls.
`def` | check (nodes : Seq[Node]) : Boolean check children, return true if conform to content model
`def` | getContentModel : ContentModel
`def` | getIterator (nodes : Seq[Node], skipPCDATA : Boolean) : Iterator[ElemName]
`def` | setContentModel (cm : ContentModel) : Unit set content model, enabling element validation
`def` | setMetaData (adecls : List[AttrDecl]) : Unit set meta data, enabling attribute validation

Methods inherited from Function1
toString, compose, andThen

Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Value Details

`` `var` exc : List[ValidationException]

`protected` `var` contentModel : ContentModel

`protected` `var` dfa : DetWordAutom[ElemName]

`protected` `var` adecls : List[AttrDecl]

Method Details

`` `def` setContentModel(cm : ContentModel) : Unit

  set content model, enabling element validation

`` `def` getContentModel : ContentModel

`` `def` setMetaData(adecls : List[AttrDecl]) : Unit

  set meta data, enabling attribute validation

`` `def` getIterator(nodes : Seq[Node], skipPCDATA : Boolean) : Iterator[ElemName]

`` `def` check(md : MetaData) : Boolean

  check attributes, return true if md corresponds to attribute declarations in adecls.

`` `def` check(nodes : Seq[Node]) : Boolean

  check children, return true if conform to content model

Precondition
  contentModel != null

`` `def` apply(n : Node) : Boolean

  applies various validations - accumulates error messages in exc

Todo
  : fail on first error, ignore other errors (rearranging conditions)

Overrides
  Function1.apply