Top Description Inners Methods
com.amazon.ion

public Interface IonCursor

extends Closeable
Known Direct Subinterfaces
com.amazon.ion.impl.IonReaderContinuableCore
Known Direct Implementers
com.amazon.ion.impl.IonCursorBinary
Imports
java.io.Closeable

A cursor over a stream of Ion data.

Note

this interface is not considered part of the public API.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
IonCursor.Event

Conveys the type of event that occurred as a result of operating on the cursor.

Method Summary

Modifier and TypeMethod and Description
public IonCursor.Event

Returns:

an Event conveying the result of the operation.
endStream
()

Causes the cursor to force completion of the value on which it is currently positioned, if any.

public IonCursor.Event

Returns:

an Event conveying the result of the operation.
fillValue
()

Buffers the entirety of the value on which the cursor is currently positioned.

public IonCursor.Event

Returns:

an Event conveying the result of the previous operation.
getCurrentEvent
()

Conveys the result of the previous operation.

public IonCursor.Event

Returns:

an Event conveying the result of the operation.
nextValue
()

Advances the cursor to the next value, skipping the current value (if any).

public IonCursor.Event

Returns:

an Event conveying the result of the operation.
stepIntoContainer
()

Steps the cursor into the container value on which the cursor is currently positioned.

public IonCursor.Event

Returns:

an Event conveying the result of the operation.
stepOutOfContainer
()

Steps the cursor out of the current container, skipping any values in the container that may follow.

Inherited from java.io.Closeable:
close

Method Detail

endStreamback to summary
public IonCursor.Event endStream()

Causes the cursor to force completion of the value on which it is currently positioned, if any. This method may return:

  • NEEDS_DATA, if called when the reader is not positioned on a value, or
  • START_SCALAR, if ending the stream at the current position unambiguously results in a complete value
Note: in binary Ion, it is never ambiguous whether a value is complete. Therefore, binary IonCursor implementations will only return NEEDS_DATA or throw from this method. In text Ion, ambiguity is possible. For example, the stream true will initially return NEEDS_DATA from nextValue() because it cannot yet be known whether the stream contains the boolean value true or, e.g., the symbol value trueNorth. In this example, calling this method will return START_SCALAR, with the cursor positioned on a boolean value.
Returns:IonCursor.Event

an Event conveying the result of the operation.

Exceptions
IonException:
if this method is called below the top level or when the cursor is positioned on an incomplete value.
fillValueback to summary
public IonCursor.Event fillValue()

Buffers the entirety of the value on which the cursor is currently positioned. This method may return:

  • NEEDS_DATA, if not enough data is available in the stream
  • VALUE_READY, if the value was successfully filled
  • NEEDS_INSTRUCTION, if the value exceeded the configured maximum buffer size and could not be buffered
Returns:IonCursor.Event

an Event conveying the result of the operation.

getCurrentEventback to summary
public IonCursor.Event getCurrentEvent()

Conveys the result of the previous operation.

Returns:IonCursor.Event

an Event conveying the result of the previous operation.

nextValueback to summary
public IonCursor.Event nextValue()

Advances the cursor to the next value, skipping the current value (if any). This method may return:

  • NEEDS_DATA, if not enough data is available in the stream
  • START_SCALAR, if the reader is now positioned on a scalar value
  • START_CONTAINER, if the reader is now positioned on a container value
  • END_CONTAINER, if the reader is now positioned at the end of a container value, or
  • NEEDS_INSTRUCTION, if the reader skipped a value for exceeding the configured maximum buffer size
Returns:IonCursor.Event

an Event conveying the result of the operation.

stepIntoContainerback to summary
public IonCursor.Event stepIntoContainer()

Steps the cursor into the container value on which the cursor is currently positioned. This method may return:

  • NEEDS_DATA, if not enough data is available in the stream
  • NEEDS_INSTRUCTION, when successful, indicating that the caller must invoke another method on the cursor in order to position it on a value
Returns:IonCursor.Event

an Event conveying the result of the operation.

stepOutOfContainerback to summary
public IonCursor.Event stepOutOfContainer()

Steps the cursor out of the current container, skipping any values in the container that may follow. This method may return:

  • NEEDS_DATA, if not enough data is available in the stream
  • NEEDS_INSTRUCTION, when successful, indicating that the caller must invoke another method on the cursor in order to position it on a value
Returns:IonCursor.Event

an Event conveying the result of the operation.

com.amazon.ion back to summary

public final Enum IonCursor.Event

extends Enum<IonCursor.Event>
Class Inheritance

Conveys the type of event that occurred as a result of operating on the cursor.

Field Summary

Modifier and TypeField and Description
public static final IonCursor.Event
END_CONTAINER

The cursor has reached the end of the current container, and requires an instruction to proceed.

public static final IonCursor.Event
NEEDS_DATA

There is not enough data in the stream to complete the requested operation.

public static final IonCursor.Event
NEEDS_INSTRUCTION

The cursor has completed an operation (e.g. `stepIntoContainer()`) and requires another instruction in order to position itself on the next value.

public static final IonCursor.Event
START_CONTAINER

The cursor is positioned on a container value.

public static final IonCursor.Event
START_SCALAR

The cursor is positioned on a scalar value.

public static final IonCursor.Event
VALUE_READY

The cursor has successfully buffered the entirety of the value on which it is currently positioned, as requested by an invocation of `fillValue()`.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IonCursor.Event
public static IonCursor.Event[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

END_CONTAINERback to summary
public static final IonCursor.Event END_CONTAINER

The cursor has reached the end of the current container, and requires an instruction to proceed.

NEEDS_DATAback to summary
public static final IonCursor.Event NEEDS_DATA

There is not enough data in the stream to complete the requested operation. The operation should be retried when more data is available. Note that there is no way to "cancel" a previously requested operation; requesting a different operation after a `NEEDS_DATA` event has undefined behavior.

NEEDS_INSTRUCTIONback to summary
public static final IonCursor.Event NEEDS_INSTRUCTION

The cursor has completed an operation (e.g. `stepIntoContainer()`) and requires another instruction in order to position itself on the next value.

START_CONTAINERback to summary
public static final IonCursor.Event START_CONTAINER

The cursor is positioned on a container value.

START_SCALARback to summary
public static final IonCursor.Event START_SCALAR

The cursor is positioned on a scalar value.

VALUE_READYback to summary
public static final IonCursor.Event VALUE_READY

The cursor has successfully buffered the entirety of the value on which it is currently positioned, as requested by an invocation of `fillValue()`.

Constructor Detail

Eventback to summary
private Event()

Method Detail

valueOfback to summary
public static IonCursor.Event valueOf(String name)
valuesback to summary
public static IonCursor.Event[] values()