Module java.money

Class MonetaryParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.money.MonetaryException
javax.money.format.MonetaryParseException
All Implemented Interfaces:
java.io.Serializable

public class MonetaryParseException
extends MonetaryException
Signals that an error has been reached unexpectedly while parsing.
Author:
Werner Keil
See Also:
Serialized Form
  • 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

    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
  • Constructor Details

    • 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 Details

    • 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.