Class Dictionary

    • Field Detail

      • VERSION_REGEX

        public static final Pattern VERSION_REGEX
    • Constructor Detail

      • Dictionary

        public Dictionary()
      • Dictionary

        public Dictionary​(URI dictionaryURI)
      • Dictionary

        public Dictionary​(File dictionaryFile)
    • Method Detail

      • getDictionaryURI

        public URI getDictionaryURI()
      • getDictionaryFile

        public File getDictionaryFile()
      • getSourceString

        public String getSourceString()
      • getVersion

        public String getVersion()
      • merge

        public void merge​(Dictionary dictionary)
        Merges the definitions in the dictionaries
        Parameters:
        dictionary - to be merged into this dictionary. dictionary merged in will override values in this dictionary if scalars or be added if lists
      • containsDefinition

        public boolean containsDefinition​(DictIdentifier identifier)
        Tests to see whether or not a definition exists
        Parameters:
        identifier - of the definition
        Returns:
        flag indicating existence
      • containsObjectDefinition

        public boolean containsObjectDefinition​(DictIdentifier identifier)
        Tests to see whether or not an object is defined
        Parameters:
        identifier - of the object
        Returns:
        flag indicating existence
      • containsGroupDefinition

        public boolean containsGroupDefinition​(DictIdentifier identifier)
        Tests to see whether or not a group is defined
        Parameters:
        identifier - of the the group
        Returns:
        flag indicating existence
      • containsElementDefinition

        public boolean containsElementDefinition​(DictIdentifier identifier)
        Tests to see whether or not an element is defined
        Parameters:
        identifier - of the element
        Returns:
        flag indicating existence
      • containsElementDefinition

        public boolean containsElementDefinition​(String objectContext,
                                                 DictIdentifier identifier)
      • getDefinition

        public Definition getDefinition​(DictIdentifier identifier)
        Retrieves the definition from the dictionary or null if not found
        Parameters:
        identifier - of the definition
        Returns:
        the definition
      • getObjectDefinition

        public ObjectDefinition getObjectDefinition​(DictIdentifier identifier)
        Retrieves the object definition from the dictionary or null if not found
        Parameters:
        identifier - of the definition
        Returns:
        the object definition
      • getGroupDefinition

        public GroupDefinition getGroupDefinition​(DictIdentifier identifier)
        Retrieves the group definition from the dictionary or null if not found
        Parameters:
        identifier - of the definition
        Returns:
        the group definition
      • getElementDefinition

        public ElementDefinition getElementDefinition​(DictIdentifier identifier)
        Retrieves the element definition from the dictionary or null if not found.
        Parameters:
        identifier - of the definition
        Returns:
        the element definition
      • addDefinition

        public void addDefinition​(Definition definition)
        Adds a definition to this dictionary.
        Parameters:
        definition - to be added to the dictionary
      • setInformation

        public void setInformation​(String information)
        Sets the description information for a dictionary. This is often captured informally in comments at the top of a dictionary file.
        Parameters:
        information -
      • getInformation

        public String getInformation()
        Return the dictionary's descriptive information.
        Returns:
        the information
      • addDefinitions

        public void addDefinitions​(Collection<Definition> defs)
        Adds a list of definitions to this dictionary. The flag indicates whether the definitions should be overwritten.
        Parameters:
        defs - to be added to the dictionary
      • findObjectClassDefinition

        public ObjectDefinition findObjectClassDefinition​(DictIdentifier identifier)
        Retrieves the class definition for an object with the given identifier. This method will search the dictionary for an ObjectDefinition whose identifier is the greatest length and matches the end of the given identifier
        Parameters:
        identifier - to lookup up class of
        Returns:
        ObjectDefinition of class that will constrain object with given identifier. Returns null if not found.
      • getDefinitions

        protected Map<DictIdentifier,​Definition> getDefinitions()
        Retrieves the map of definitions
        Returns:
        the map of definitions.
      • findGroupClassDefinition

        public GroupDefinition findGroupClassDefinition​(DictIdentifier identifier)
        Retrieves the class definition for a group with the given identifier. This method will search the dictionary for a GroupDefinition whose identifier is the greatest length and matches the end of the given identifier
        Parameters:
        identifier - to lookup up class of
        Returns:
        GroupDefinition of class that will constrain object with given identifier. Returns null if not found.
      • clearProblems

        public void clearProblems()