HED JavaScript Library
    Preparing search index...

    A parser for unit classes and their units.

    The units of every schema are collected before the unit classes are built, so a unit class declared by several schemas is built once with the units of all of them, and every unit is built against the merged unit modifiers.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • xmlCollection: HedSchemaXMLCollection

        A collection of XML data for a given prefix.

      • attributes: SchemaEntryManager<SchemaAttribute>

        The parsed schema attributes.

      • unitModifiers: SchemaEntryManager<SchemaUnitModifier>

        The parsed unit modifiers.

      Returns default

    attributes: default<SchemaAttribute>

    The schema attributes.

    entryTypeMap: Map<string, any>

    The map of names to entry objects for this entry type.

    unitClassesUnits: Map<string, Map<string, default>>

    The units of each unit class, keyed by unit class name and then by unit name.

    unitModifiers: SchemaEntryManager<SchemaUnitModifier>

    The unit modifiers.

    xmlCollection: HedSchemaXMLCollection

    The collection of XML data for a given prefix.

    • Protected

      Give the elements of an unmerged library schema the inLibrary attribute that its merged file carries.

      An unmerged file holds only its library's elements, except that it may name an element of an earlier schema of the group again to extend it (a partner unit class it adds units to); such an element keeps its declarer.

      Parameters

      • schemaXml: Object

        The XML of the schema being parsed.

      • valueAttributeDefinitions: Map<string, Map<SchemaAttribute, string[]>>

        The value attributes by name, modified in place.

      • isDeclared: (arg0: string) => boolean

        Whether an earlier schema of the group declared the named element.

      Returns void

    • Protected

      Build one entry.

      Parameters

      • name: any

        The entry name.

      • description: any

        The entry description.

      • booleanAttributes: any

        The boolean attributes.

      • valueAttributes: any

        The value attributes.

      Returns default

      The entry.

    • Protected

      Parse the attributes and descriptions of a list of elements.

      Parameters

      • elements: Iterable<Object, any, any>

        The XML elements.

      • namer: (arg0: Object) => string

        A function giving the name of an element.

      Returns [
          Map<string, Set<SchemaAttribute>>,
          Map<string, Map<SchemaAttribute, string[]>>,
          Map<string, string | undefined>,
      ]

      The boolean attributes, value attributes, and descriptions of the elements, keyed by name.

    • Protected

      Parse the attributes and descriptions of a list of definition elements.

      Parameters

      • definitionElements: Iterable<Object, any, any>

        The XML elements.

      Returns [
          Map<string, Set<SchemaAttribute>>,
          Map<string, Map<SchemaAttribute, string[]>>,
          Map<string, string | undefined>,
      ]

      The boolean attributes, value attributes, and descriptions of the elements, keyed by name.

    • Add a new entry while checking for duplicates.

      An existing declaration of the same name is kept if the new one is equivalent to it.

      Parameters

      • newEntryName: string

        The entry name.

      • newEntry: any

        The new entry object to add.

      Returns void

      If an entry of that name exists and is not equivalent.