Top Description Fields Constructors Methods
org.apache.avro.path

public Class TracingClassCastException

extends ClassCastException
implements PathTracingException<ClassCastException>
Class Inheritance
All Implemented Interfaces
org.apache.avro.path.PathTracingException
Imports
org.apache.avro.Schema, org.apache.avro.util.SchemaUtil, java.util.ArrayList, .List

a ClassCastException with extra fields used to trace back the path to a bad value through an object graph

Field Summary

Modifier and TypeField and Description
private final ClassCastException
private final boolean
private final Object
private final Schema
private final List<PathElement>

Constructor Summary

AccessConstructor and Description
public
TracingClassCastException(ClassCastException cause, Object datum, Schema expected, boolean customCoderUsed)

Method Summary

Modifier and TypeMethod and Description
public synchronized ClassCastException
getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.
public ClassCastException

Returns:

a hopefully helpful error message
summarize
(Schema
the root object for the operation that generated the exception
root
)

Implements org.apache.avro.path.PathTracingException.summarize.

produces a user-facing exception to be thrown back out to user code
public void
tracePath(PathElement
an AvroPath step tracing back from the location of the original exception towards the root of the data graph
step
)

Implements org.apache.avro.path.PathTracingException.tracePath.

appends a path element to the trace.

Field Detail

causeback to summary
private final ClassCastException cause

Hides java.lang.Throwable.cause.

customCoderUsedback to summary
private final boolean customCoderUsed
datumback to summary
private final Object datum
expectedback to summary
private final Schema expected
reversePathback to summary
private final List<PathElement> reversePath

Constructor Detail

TracingClassCastExceptionback to summary
public TracingClassCastException(ClassCastException cause, Object datum, Schema expected, boolean customCoderUsed)

Method Detail

getCauseback to summary
public synchronized ClassCastException getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

Returns:ClassCastException

the cause of this throwable or null if the cause is nonexistent or unknown.

Annotations
@Override
summarizeback to summary
public ClassCastException summarize(Schema root)

Implements org.apache.avro.path.PathTracingException.summarize.

Doc from org.apache.avro.path.PathTracingException.summarize.

produces a user-facing exception to be thrown back out to user code

Parameters
root:Schema

the root object for the operation that generated the exception

Returns:ClassCastException

a hopefully helpful error message

Annotations
@Override
tracePathback to summary
public void tracePath(PathElement step)

Implements org.apache.avro.path.PathTracingException.tracePath.

Doc from org.apache.avro.path.PathTracingException.tracePath.

appends a path element to the trace. expected to be called in reverse-order as the exception bubbles up the stack

Parameters
step:PathElement

an AvroPath step tracing back from the location of the original exception towards the root of the data graph

Annotations
@Override