Field constructor

Field(
  1. Node node,
  2. String tag,
  3. dynamic manifest
)

Implementation

Field(this.node, this.tag, this.manifest) : name = validName(tag), optional = RegExp(r'^\?').hasMatch(tag) {
    if (name == '') throw Exception('Field "$tag" of node "${node.tag}" in '
        '${node.container.filename}.json is resulted with the name parsed into an empty string.');
    if (isReserved(name)) throw Exception('Field "$tag" of node "${node.tag}" in '
        '${node.container.filename}.json is resulted with the name "$name", which is reserved by Dart language.');
}