org.eclipse.rdf4j.rio

## Class RDFParseException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.eclipse.rdf4j.OpenRDFException
        - - org.eclipse.rdf4j.RDF4JException
          - - org.eclipse.rdf4j.rio.RDFParseException

- All Implemented Interfaces:
    Serializable

      public class RDFParseException
      extends RDF4JException

  A parse exception that can be thrown by a parser when it encounters an error from which it cannot or doesn't want to recover.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RDFParseException(String msg)` Creates a new ParseException.
    `RDFParseException(String msg, long lineNo, long columnNo)` Creates a new ParseException.
    `RDFParseException(String msg, Throwable t)` Creates a new ParseException wrapping another exception.
    `RDFParseException(String msg, Throwable t, long lineNo, long columnNo)` Creates a new ParseException wrapping another exception.
    `RDFParseException(Throwable t)` Creates a new ParseException wrapping another exception.
    `RDFParseException(Throwable t, long lineNo, long columnNo)` Creates a new ParseException wrapping another exception.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getColumnNumber()` Gets the column number associated with this parse exception.
    `long` | `getLineNumber()` Gets the line number associated with this parse exception.
    `static String` | `getLocationString(long lineNo, long columnNo)` Creates a string to that shows the specified line and column number.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RDFParseException

          public RDFParseException(String msg)

      Creates a new ParseException.
      Parameters:
        `msg` - An error message.

    - #### RDFParseException

          public RDFParseException(String msg,
                                   long lineNo,
                                   long columnNo)

      Creates a new ParseException.
      Parameters:
        `msg` - An error message.
        `lineNo` - A line number associated with the message.
        `columnNo` - A column number associated with the message.

    - #### RDFParseException

          public RDFParseException(Throwable t)

      Creates a new ParseException wrapping another exception. The ParseException will inherit its message from the supplied source exception.
      Parameters:
        `t` - The source exception.

    - #### RDFParseException

          public RDFParseException(String msg,
                                   Throwable t)

      Creates a new ParseException wrapping another exception. The ParseException will inherit its message from the supplied source exception.
      Parameters:
        `msg` - An error message.
        `t` - The source exception.

    - #### RDFParseException

          public RDFParseException(Throwable t,
                                   long lineNo,
                                   long columnNo)

      Creates a new ParseException wrapping another exception. The ParseException will inherit its message from the supplied source exception.
      Parameters:
        `t` - The source exception.
        `lineNo` - A line number associated with the message.
        `columnNo` - A column number associated with the message.

    - #### RDFParseException

          public RDFParseException(String msg,
                                   Throwable t,
                                   long lineNo,
                                   long columnNo)

      Creates a new ParseException wrapping another exception. The ParseException will inherit its message from the supplied source exception.
      Parameters:
        `t` - The source exception.
        `lineNo` - A line number associated with the message.
        `columnNo` - A column number associated with the message.

  - ### Method Detail

    - #### getLineNumber

          public long getLineNumber()

      Gets the line number associated with this parse exception.
      Returns:
        A line number, or -1 if no line number is available or applicable.

    - #### getColumnNumber

          public long getColumnNumber()

      Gets the column number associated with this parse exception.
      Returns:
        A column number, or -1 if no column number is available or applicable.

    - #### getLocationString

          public static String getLocationString(long lineNo,
                                                 long columnNo)

      Creates a string to that shows the specified line and column number. Negative line numbers are interpreted as unknowns. Example output: "[line 12, column 34]". If the specified line number is negative, this method returns an empty string.

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.