Module java.money

Class MonetaryParseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class MonetaryParseException
    extends MonetaryException
    Signals that an error has been reached unexpectedly while parsing.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.CharSequence data
      The original input data.
      private int errorIndex
      The zero-based character offset into the string being parsed at which the error was found during parsing.
      private static long serialVersionUID
      serialVersionUID.
    • Constructor Summary

      Constructors 
      Constructor Description
      MonetaryParseException​(java.lang.CharSequence parsedData, int errorIndex)
      Constructs a MonetaryParseException with the parsed text and offset.
      MonetaryParseException​(java.lang.String message, java.lang.CharSequence parsedData, int errorIndex)
      Constructs a MonetaryParseException with the specified detail message, parsed text and index.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getErrorIndex()
      Returns the index where the error was found.
      java.lang.String getInput()
      Returns the string that was being parsed.
      • 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
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        serialVersionUID.
        See Also:
        Constant Field Values
      • errorIndex

        private int errorIndex
        The zero-based character offset into the string being parsed at which the error was found during parsing.
      • data

        private java.lang.CharSequence data
        The original input data.
    • Constructor Detail

      • MonetaryParseException

        public MonetaryParseException​(java.lang.String message,
                                      java.lang.CharSequence parsedData,
                                      int errorIndex)
        Constructs a MonetaryParseException with the specified detail message, parsed text and index. A detail message is a String that describes this particular exception.
        Parameters:
        message - the detail message
        parsedData - the parsed text, should not be null
        errorIndex - the position where the error is found while parsing.
      • MonetaryParseException

        public MonetaryParseException​(java.lang.CharSequence parsedData,
                                      int errorIndex)
        Constructs a MonetaryParseException with the parsed text and offset. A detail message is a String that describes this particular exception.
        Parameters:
        parsedData - the parsed text, should not be null
        errorIndex - the position where the error is found while parsing.
    • Method Detail

      • getErrorIndex

        public int getErrorIndex()
        Returns the index where the error was found.
        Returns:
        the index where the error was found
      • getInput

        public java.lang.String getInput()
        Returns the string that was being parsed.
        Returns:
        the parsed input string, or null, if null was passed as input.