MCPcopy Index your code
hub / github.com/amazon-ion/ion-java

github.com/amazon-ion/ion-java @v1.12.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.12.0 ↗ · + Follow
7,469 symbols 35,306 edges 446 files 1,787 documented · 24% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Amazon Ion Java

Build Status Maven Central Version Javadoc

A Java implementation of the Ion data notation.

Setup

This repository contains a git submodule called ion-tests, which holds test data used by ion-java's unit tests.

The easiest way to clone the ion-java repository and initialize its ion-tests submodule is to run the following command.

$ git clone --recursive https://github.com/amazon-ion/ion-java.git ion-java

Alternatively, the submodule may be initialized independently from the clone by running the following commands.

$ git submodule init
$ git submodule update

The submodule points to the tip of the branch of the ion-tests repository specified in ion-java's .gitmodules file.

ion-java may now be built and installed into the local Maven repository with the following command.

$ ./gradlew publishToMavenLocal

Pulling in Upstream Changes

To pull upstream changes into ion-java, start with a simple git pull. This will pull in any changes to ion-java itself (including any changes to its .gitmodules file), but not any changes to the ion-tests submodule. To make sure the submodule is up-to-date, use the following command.

$ git submodule update --remote

This will fetch and update the ion-tests submodule from the ion-tests branch currently specified in the .gitmodules file.

For detailed walkthroughs of git submodule usage, see the Git Tools documentation.

Depending on the Library

To start using ion-java in your code, refer to ion-java on Maven Central to find snippets for adding a dependency on the latest version of the library using your favorite build tool.

Legacy group id

Originally ion-java was published using the group id software.amazon.ion. Since 1.4.0 the official groupId was changed to com.amazon.ion to be consistent with other Amazon open source libraries. We still maintain the legacy group id but strongly encourage users to migrate to the official one.

Using the Library

A great way to get started is to use the Ion cookbook. The API documentation will give a lot of detailed information about how to use the library.

Alternatives

If you are looking for an in-memory Ion data model, this library provides IonValue, but you should consider using IonElement from ion-element-kotlin instead.

IonElement is a better choice than IonValue as long as you can work within its limitations. IonElement has significantly less memory overhead than IonValue. It is immutable and does not have references to parent values, so it is always threadsafe, and unlike IonValue there is no need to make deep copies of IonElement. The limitations of IonElement are that it does not support symbols with unknown text, it will bring a dependency on the Kotlin Stdlib, and you may need to change some logic in your application if it relies on being able to access the parent container of an Ion value.

The Ion maintainers recommend using IonElement instead of IonValue whenever possible. For more information, see "Why is IonElement needed?"

Extension points exported contracts — how you extend this code

InputStreamWrapper (Interface)
Callback for decorating an InputStream. [17 implementers]
src/test/java/com/amazon/ion/InputStreamWrapper.java
IonNull (Interface)
The Ion null value, also known as null.null . WARNING: This interface should not be [26 implementers]
src/main/java/com/amazon/ion/IonNull.java
Checker (Interface)
(no doc) [4 implementers]
src/test/java/com/amazon/ion/Checker.java
SymbolTable (Interface)
A symbol table maps symbols between their textual form and an integer ID used in the binary encoding. WARNING:</b [7 implementers]
src/main/java/com/amazon/ion/SymbolTable.java
IonList (Interface)
An Ion list value. WARNING: This interface should not be implemented or extended by code outside [26 implementers]
src/main/java/com/amazon/ion/IonList.java
IonSexp (Interface)
An Ion sexp (S-expression) value. WARNING: This interface should not be implemented or extended [26 implementers]
src/main/java/com/amazon/ion/IonSexp.java
IonReader (Interface)
Provides stream-based access to Ion data independent of its underlying representation (text, binary, or IonValue [7 implementers]
src/main/java/com/amazon/ion/IonReader.java

Core symbols most depended-on inside this repo

next
called by 606
src/main/java/com/amazon/ion/IonReader.java
add
called by 360
src/main/java/com/amazon/ion/IonStruct.java
get
called by 341
src/main/java/com/amazon/ion/IonStruct.java
size
called by 315
src/main/java/com/amazon/ion/IonStruct.java
fail
called by 297
src/main/java/com/amazon/ion/Timestamp.java
toString
called by 276
src/main/java/com/amazon/ion/IonValue.java
read
called by 257
src/main/java/com/amazon/ion/impl/ByteReader.java
stepIn
called by 252
src/main/java/com/amazon/ion/IonWriter.java

Shape

Method 6,808
Class 497
Interface 94
Enum 66
Function 4

Languages

Java100%
Kotlin1%

Modules by API surface

src/test/java/com/amazon/ion/TimestampTest.java202 symbols
src/test/java/com/amazon/ion/impl/IonReaderContinuableTopLevelBinaryTest.java194 symbols
src/main/java/com/amazon/ion/impl/IonReaderTextRawTokensX.java120 symbols
src/test/java/com/amazon/ion/StructTest.java111 symbols
src/main/java/com/amazon/ion/impl/IonBinary.java106 symbols
src/test/java/com/amazon/ion/impl/bin/WriteBufferTest.java95 symbols
src/main/java/com/amazon/ion/impl/BlockedBuffer.java94 symbols
src/main/java/com/amazon/ion/impl/IonCursorBinary.java92 symbols
src/main/java/com/amazon/ion/Timestamp.java91 symbols
src/main/java/com/amazon/ion/impl/bin/IonManagedBinaryWriter.java87 symbols
src/main/java/com/amazon/ion/impl/_Private_ScalarConversions.java86 symbols
src/main/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java84 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add ion-java \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact