Package com.unboundid.ldif
Class LDIFException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.unboundid.util.LDAPSDKException
-
- com.unboundid.ldif.LDIFException
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDIFException extends LDAPSDKException
This class defines an exception that may be thrown if a problem occurs while attempting to decode data read from an LDIF source. It has a flag to indicate whether it is possible to try to continue reading additional information from the LDIF source, and also the approximate line number on which the problem was encountered.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDIFException(java.lang.String message, long lineNumber, boolean mayContinueReading)
Creates a new LDIF exception with the provided information.LDIFException(java.lang.String message, long lineNumber, boolean mayContinueReading, java.lang.CharSequence[] dataLines, java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.LDIFException(java.lang.String message, long lineNumber, boolean mayContinueReading, java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.LDIFException(java.lang.String message, long lineNumber, boolean mayContinueReading, java.util.List<? extends java.lang.CharSequence> dataLines, java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getDataLines()
Retrieves the lines comprising the data that could not be parsed as valid LDIF, if available.java.lang.String
getExceptionMessage()
Retrieves a string representation of this exception suitable for use in messages.java.lang.String
getExceptionMessage(boolean includeCause, boolean includeStackTrace)
Retrieves a string representation of this exception suitable for use in messages.long
getLineNumber()
Retrieves the line number on which the problem occurred.boolean
mayContinueReading()
Indicates whether it is possible to continue attempting to read from the LDIF source.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this exception to the provided buffer.void
toString(java.lang.StringBuilder buffer, boolean includeCause, boolean includeStackTrace)
Appends a string representation of thisLDIFException
to the provided buffer.-
Methods inherited from class com.unboundid.util.LDAPSDKException
toString
-
-
-
-
Constructor Detail
-
LDIFException
public LDIFException(@NotNull java.lang.String message, long lineNumber, boolean mayContinueReading)
Creates a new LDIF exception with the provided information.- Parameters:
message
- A message explaining the problem that occurred. It must not benull
.lineNumber
- The line number in the LDIF source on which the problem occurred.mayContinueReading
- Indicates whether it is possible to continue attempting to read from the LDIF source.
-
LDIFException
public LDIFException(@NotNull java.lang.String message, long lineNumber, boolean mayContinueReading, @Nullable java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.- Parameters:
message
- A message explaining the problem that occurred. It must not benull
.lineNumber
- The line number in the LDIF source on which the problem occurred.mayContinueReading
- Indicates whether it is possible to continue attempting to read from the LDIF source.cause
- The underlying exception that triggered this exception.
-
LDIFException
public LDIFException(@NotNull java.lang.String message, long lineNumber, boolean mayContinueReading, @Nullable java.lang.CharSequence[] dataLines, @Nullable java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.- Parameters:
message
- A message explaining the problem that occurred. It must not benull
.lineNumber
- The line number in the LDIF source on which the problem occurred.mayContinueReading
- Indicates whether it is possible to continue attempting to read from the LDIF source.dataLines
- The lines that comprise the data that could not be parsed as valid LDIF. It may benull
if this is not available.cause
- The underlying exception that triggered this exception.
-
LDIFException
public LDIFException(@NotNull java.lang.String message, long lineNumber, boolean mayContinueReading, @Nullable java.util.List<? extends java.lang.CharSequence> dataLines, @Nullable java.lang.Throwable cause)
Creates a new LDIF exception with the provided information.- Parameters:
message
- A message explaining the problem that occurred. It must not benull
.lineNumber
- The line number in the LDIF source on which the problem occurred.mayContinueReading
- Indicates whether it is possible to continue attempting to read from the LDIF source.dataLines
- The lines that comprise the data that could not be parsed as valid LDIF. It may benull
if this is not available.cause
- The underlying exception that triggered this exception.
-
-
Method Detail
-
getLineNumber
public long getLineNumber()
Retrieves the line number on which the problem occurred.- Returns:
- The line number on which the problem occurred.
-
mayContinueReading
public boolean mayContinueReading()
Indicates whether it is possible to continue attempting to read from the LDIF source.- Returns:
true
if it is possible to continue attempting to read from the LDIF source, orfalse
if it is not possible to continue.
-
getDataLines
@Nullable public java.util.List<java.lang.String> getDataLines()
Retrieves the lines comprising the data that could not be parsed as valid LDIF, if available.- Returns:
- An unmodifiable list of the lines comprising the data that could
not be parsed as valid LDIF, or
null
if that is not available.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this exception to the provided buffer.- Overrides:
toString
in classLDAPSDKException
- Parameters:
buffer
- The buffer to which the string representation of this exception is to be appended.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer, boolean includeCause, boolean includeStackTrace)
Appends a string representation of thisLDIFException
to the provided buffer.- Parameters:
buffer
- The buffer to which the information should be appended. This must not benull
.includeCause
- Indicates whether to include information about the cause (if any) in the exception message.includeStackTrace
- Indicates whether to include a condensed representation of the stack trace in the exception message. If a stack trace is included, then the cause (if any) will automatically be included, regardless of the value of theincludeCause
argument.
-
getExceptionMessage
@NotNull public java.lang.String getExceptionMessage()
Retrieves a string representation of this exception suitable for use in messages.- Overrides:
getExceptionMessage
in classLDAPSDKException
- Returns:
- A string representation of this exception suitable for use in messages.
-
getExceptionMessage
@NotNull public java.lang.String getExceptionMessage(boolean includeCause, boolean includeStackTrace)
Retrieves a string representation of this exception suitable for use in messages.- Overrides:
getExceptionMessage
in classLDAPSDKException
- Parameters:
includeCause
- Indicates whether to include information about the cause (if any) in the exception message.includeStackTrace
- Indicates whether to include a condensed representation of the stack trace in the exception message.- Returns:
- A string representation of this exception suitable for use in messages.
-
-