Class LabelParserException

    • Field Detail

      • sourceURI

        protected final URI sourceURI
      • sourceFile

        protected final File sourceFile
    • Constructor Detail

      • LabelParserException

        public LabelParserException​(Statement statement,
                                    Integer column,
                                    String key,
                                    Constants.ProblemType type,
                                    Object... arguments)
        Use of this constructor is encouraged where possible as it retains the context of the exception.
        Parameters:
        statement - in which the exception occurred
        column - within the file where the exception started
        key - used to quickly associate lookup or filter this type of exception
        type - classification of the problem
        arguments - to be used in generating problem messages
      • LabelParserException

        public LabelParserException​(String key,
                                    Constants.ProblemType type,
                                    Object... arguments)
        Use this constructor for exceptions not associated to a specific file such as not being able to parse due to missing file or bad URL
        Parameters:
        key - used to quickly associate lookup or filter this type of exception
        type - classification of the problem
        arguments - to be used in generating problem messages
      • LabelParserException

        public LabelParserException​(Label label,
                                    Integer lineNumber,
                                    Integer column,
                                    String key,
                                    Constants.ProblemType type,
                                    Object... arguments)
        Use this constructor for exceptions that are associated with a specific file but not on a given line (e.g. missing statements)
        Parameters:
        label - within which the exception occurred
        lineNumber - within the file where the exception started
        column - within the file where the exception started
        key - used to quickly associate lookup or filter this type of exception
        type - classification of the problem
        arguments - to be used in generating problem messages
      • LabelParserException

        public LabelParserException​(File sourceFile,
                                    Integer lineNumber,
                                    Integer column,
                                    String key,
                                    Constants.ProblemType type,
                                    Object... arguments)
        Use this constructor for exceptions to be reported about a file that can be traced back to a line and column
        Parameters:
        sourceFile - within which the exception occurred
        lineNumber - within the file where the exception started
        column - within the file where the exception started
        key - used to quickly associate lookup or filter this type of exception
        type - classification of the problem
        arguments - to be used in generating problem messages
      • LabelParserException

        public LabelParserException​(URI sourceURI,
                                    Integer lineNumber,
                                    Integer column,
                                    String key,
                                    Constants.ProblemType type,
                                    Object... arguments)
        Use this constructor for exceptions to be reported about a URI that can be traced back to a line and column
        Parameters:
        sourceURI - within which the exception occurred
        lineNumber - within the file where the exception started
        column - within the file where the exception started
        key - used to quickly associate lookup or filter this type of exception
        type - classification of the problem
        arguments - to be used in generating problem messages
    • Method Detail

      • getSourceURI

        public URI getSourceURI()
        Returns:
        URI of the file in which the exception occurred
      • getSourceFile

        public File getSourceFile()
        Returns:
        File in which the exception occurred
      • getLineNumber

        public Integer getLineNumber()
        Returns:
        Line number of the exception if applicable
      • getColumn

        public Integer getColumn()
        Returns:
        Column number of the exception if applicable
      • getArguments

        public Object[] getArguments()
        Returns:
        arguments to be used in producing a message about this exception
      • getKey

        public String getKey()
        Returns:
        key of this exception which is useful for filtering
      • getStatement

        public Statement getStatement()
        Returns:
        statement in which the exception occurred.