Search in sources :

Example 76 with IonValue

use of com.amazon.ion.IonValue in project ion-java by amzn.

the class IonWriterSystemTree method writeInt.

public void writeInt(BigInteger value) throws IOException {
    IonValue v = _factory.newInt(value);
    append(v);
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 77 with IonValue

use of com.amazon.ion.IonValue in project ion-java by amzn.

the class IonWriterSystemTree method writeInt.

public void writeInt(int value) throws IOException {
    IonValue v = _factory.newInt(value);
    append(v);
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 78 with IonValue

use of com.amazon.ion.IonValue in project ion-java by amzn.

the class IonWriterSystemTree method writeNull.

// ========================================================================
public void writeNull(IonType type) throws IOException {
    IonValue v = _factory.newNull(type);
    append(v);
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 79 with IonValue

use of com.amazon.ion.IonValue in project ion-java by amzn.

the class SymbolTableStructCache method addSymbol.

/**
 * Adds a new symbol table with the given symbol ID to the IonStruct's 'symbols' list.
 * @param symbolName can be null when there's a gap in the local symbols list.
 * @param sid the symbol ID to assign to the new symbol.
 */
void addSymbol(String symbolName, int sid) {
    assert sid >= firstLocalSid;
    ValueFactory sys = image.getSystem();
    IonValue syms = image.get(SYMBOLS);
    // the symbols field if necessary.
    while (syms != null && syms.getType() != IonType.LIST) {
        image.remove(syms);
        syms = image.get(SYMBOLS);
    }
    if (syms == null) {
        syms = sys.newEmptyList();
        image.put(SYMBOLS, syms);
    }
    int thisOffset = sid - firstLocalSid;
    IonValue name = sys.newString(symbolName);
    ((IonList) syms).add(thisOffset, name);
}
Also used : IonValue(com.amazon.ion.IonValue) IonList(com.amazon.ion.IonList) ValueFactory(com.amazon.ion.ValueFactory)

Example 80 with IonValue

use of com.amazon.ion.IonValue in project ion-java by amzn.

the class _Private_CurriedValueFactory method newNull.

public IonValue newNull(IonType type) {
    IonValue v = myFactory.newNull(type);
    handle(v);
    return v;
}
Also used : IonValue(com.amazon.ion.IonValue)

Aggregations

IonValue (com.amazon.ion.IonValue)185 Test (org.junit.Test)115 IonSequence (com.amazon.ion.IonSequence)61 SymbolTable (com.amazon.ion.SymbolTable)21 IonDatagram (com.amazon.ion.IonDatagram)20 IonStruct (com.amazon.ion.IonStruct)18 IonInt (com.amazon.ion.IonInt)16 IOException (java.io.IOException)14 IonReader (com.amazon.ion.IonReader)13 IonSystem (com.amazon.ion.IonSystem)12 Result (software.amazon.qldb.Result)11 SymbolToken (com.amazon.ion.SymbolToken)10 ArrayList (java.util.ArrayList)10 IonString (com.amazon.ion.IonString)9 IonException (com.amazon.ion.IonException)7 IonType (com.amazon.ion.IonType)6 IonObjectMapper (com.fasterxml.jackson.dataformat.ion.IonObjectMapper)6 Event (com.amazon.tools.events.Event)5 com.amazon.ion.impl._Private_IonValue (com.amazon.ion.impl._Private_IonValue)4 EventType (com.amazon.tools.events.EventType)4