Class StringPrepParseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class StringPrepParseException
    extends java.text.ParseException
    Exception that signals an error has occurred while parsing the input to StringPrep or IDNA.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StringPrepParseException​(java.lang.String message, int error)
      Construct a ParseException object with the given message and error code
      StringPrepParseException​(java.lang.String message, int error, java.lang.String rules, int pos)
      Construct a ParseException object with the given message and error code
      StringPrepParseException​(java.lang.String message, int error, java.lang.String rules, int pos, int lineNumber)
      Construct a ParseException object with the given message and error code
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)
      Compare this ParseException to another and evaluate if they are equal.
      int getError()
      Returns the error code of this exception.
      java.lang.String toString()
      Returns the position of error in the rules string
      • Methods inherited from class java.text.ParseException

        getErrorOffset
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StringPrepParseException

        public StringPrepParseException​(java.lang.String message,
                                        int error)
        Construct a ParseException object with the given message and error code
        Parameters:
        message - A string describing the type of error that occurred
        error - The error that has occurred
      • StringPrepParseException

        public StringPrepParseException​(java.lang.String message,
                                        int error,
                                        java.lang.String rules,
                                        int pos)
        Construct a ParseException object with the given message and error code
        Parameters:
        message - A string describing the type of error that occurred
        error - The error that has occurred
        rules - The input rules string
        pos - The position of error in the rules string
      • StringPrepParseException

        public StringPrepParseException​(java.lang.String message,
                                        int error,
                                        java.lang.String rules,
                                        int pos,
                                        int lineNumber)
        Construct a ParseException object with the given message and error code
        Parameters:
        message - A string describing the type of error that occurred
        error - The error that has occurred
        rules - The input rules string
        pos - The position of error in the rules string
        lineNumber - The line number at which the error has occurred. If the parse engine is not using this field, it should set it to zero. Otherwise it should be a positive integer. The default value of this field is -1. It will be set to 0 if the code populating this struct is not using line numbers.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Compare this ParseException to another and evaluate if they are equal. The comparison works only on the type of error and does not compare the rules strings, if any, for equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - The exception that this object should be compared to
        Returns:
        true if the objects are equal, false if unequal
      • toString

        public java.lang.String toString()
        Returns the position of error in the rules string
        Overrides:
        toString in class java.lang.Throwable
        Returns:
        String
      • getError

        public int getError()
        Returns the error code of this exception. This method is only used for testing to verify the error.
        Returns:
        The error code