Class AttributeRegistry

    • Constructor Detail

      • AttributeRegistry

        public AttributeRegistry()
    • Method Detail

      • registerScalar

        public void registerScalar​(SubjectKind kind,
                                   String keyword,
                                   AttributeRegistry.Attribute attribute)
        Registers a keyword that resolves to a scalar value.
        Parameters:
        kind - the subject kind the keyword applies to
        keyword - the attribute keyword
        attribute - the resolver
        Throws:
        IllegalStateException - if the kind and keyword are already registered
      • registerStream

        public void registerStream​(SubjectKind kind,
                                   String keyword,
                                   AttributeRegistry.Selector selector)
        Registers a keyword that expands a subject into sub-subjects.
        Parameters:
        kind - the subject kind the keyword applies to
        keyword - the attribute keyword
        selector - the expansion
        Throws:
        IllegalStateException - if the kind and keyword are already registered
      • lookup

        public AttributeRegistry.Entry lookup​(SubjectKind kind,
                                              String keyword)
        Finds the resolver registered for a keyword; keyword matching is case-insensitive.
        Parameters:
        kind - the subject kind the keyword is used on
        keyword - the attribute keyword
        Returns:
        the entry, or null if nothing is registered