Package com.ibm.icu.text
Class StringPrepParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.text.ParseException
-
- com.ibm.icu.text.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
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACE_PREFIX_ERROR
static int
BUFFER_OVERFLOW_ERROR
static int
CHECK_BIDI_ERROR
static int
DOMAIN_NAME_TOO_LONG_ERROR
private int
error
static int
ILLEGAL_CHAR_FOUND
static int
INVALID_CHAR_FOUND
static int
LABEL_TOO_LONG_ERROR
private int
line
The line on which the error occurred.private static int
PARSE_CONTEXT_LEN
private java.lang.StringBuffer
postContext
Textual context after the error.private java.lang.StringBuffer
preContext
Textual context before the error.static int
PROHIBITED_ERROR
(package private) static long
serialVersionUID
static int
STD3_ASCII_RULES_ERROR
static int
UNASSIGNED_ERROR
static int
VERIFICATION_ERROR
static int
ZERO_LENGTH_LABEL
-
Constructor Summary
Constructors Constructor Description StringPrepParseException(java.lang.String message, int error)
Construct a ParseException object with the given message and error codeStringPrepParseException(java.lang.String message, int error, java.lang.String rules, int pos)
Construct a ParseException object with the given message and error codeStringPrepParseException(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.int
hashCode()
Mock implementation of hashCode().private void
setContext(java.lang.String str, int pos)
private void
setPostContext(char[] str, int pos)
private void
setPostContext(java.lang.String str, int pos)
private void
setPreContext(char[] str, int pos)
private void
setPreContext(java.lang.String str, int pos)
java.lang.String
toString()
Returns the position of error in the rules string
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
INVALID_CHAR_FOUND
public static final int INVALID_CHAR_FOUND
- See Also:
- Constant Field Values
-
ILLEGAL_CHAR_FOUND
public static final int ILLEGAL_CHAR_FOUND
- See Also:
- Constant Field Values
-
PROHIBITED_ERROR
public static final int PROHIBITED_ERROR
- See Also:
- Constant Field Values
-
UNASSIGNED_ERROR
public static final int UNASSIGNED_ERROR
- See Also:
- Constant Field Values
-
CHECK_BIDI_ERROR
public static final int CHECK_BIDI_ERROR
- See Also:
- Constant Field Values
-
STD3_ASCII_RULES_ERROR
public static final int STD3_ASCII_RULES_ERROR
- See Also:
- Constant Field Values
-
ACE_PREFIX_ERROR
public static final int ACE_PREFIX_ERROR
- See Also:
- Constant Field Values
-
VERIFICATION_ERROR
public static final int VERIFICATION_ERROR
- See Also:
- Constant Field Values
-
LABEL_TOO_LONG_ERROR
public static final int LABEL_TOO_LONG_ERROR
- See Also:
- Constant Field Values
-
BUFFER_OVERFLOW_ERROR
public static final int BUFFER_OVERFLOW_ERROR
- See Also:
- Constant Field Values
-
ZERO_LENGTH_LABEL
public static final int ZERO_LENGTH_LABEL
- See Also:
- Constant Field Values
-
DOMAIN_NAME_TOO_LONG_ERROR
public static final int DOMAIN_NAME_TOO_LONG_ERROR
- See Also:
- Constant Field Values
-
error
private int error
-
line
private int line
The line on which the error 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.
-
preContext
private java.lang.StringBuffer preContext
Textual context before the error. Null-terminated. May be the empty string if not implemented by parser.
-
postContext
private java.lang.StringBuffer postContext
Textual context after the error. Null-terminated. May be the empty string if not implemented by parser.
-
PARSE_CONTEXT_LEN
private static final int PARSE_CONTEXT_LEN
- See Also:
- Constant Field Values
-
-
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 occurrederror
- 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 occurrederror
- The error that has occurredrules
- The input rules stringpos
- 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 occurrederror
- The error that has occurredrules
- The input rules stringpos
- The position of error in the rules stringlineNumber
- 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 classjava.lang.Object
- Parameters:
other
- The exception that this object should be compared to- Returns:
- true if the objects are equal, false if unequal
-
hashCode
public int hashCode()
Mock implementation of hashCode(). This implementation always returns a constant value. When Java assertion is enabled, this method triggers an assertion failure.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code value for this object.
-
toString
public java.lang.String toString()
Returns the position of error in the rules string- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- String
-
setPreContext
private void setPreContext(java.lang.String str, int pos)
-
setPreContext
private void setPreContext(char[] str, int pos)
-
setPostContext
private void setPostContext(java.lang.String str, int pos)
-
setPostContext
private void setPostContext(char[] str, int pos)
-
setContext
private void setContext(java.lang.String str, int pos)
-
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
-
-