use of com.amazon.ion.SymbolToken in project ion-java by amzn.
the class IonReaderTextUserX method getFieldNameSymbol.
@Override
public final SymbolToken getFieldNameSymbol() {
SymbolToken fieldName = super.getFieldNameSymbol();
validateSymbolToken(fieldName);
return fieldName;
}
use of com.amazon.ion.SymbolToken in project ion-java by amzn.
the class IonWriterSystem method internAnnotationsAndGetSids.
final int[] internAnnotationsAndGetSids() throws IOException {
int count = _annotation_count;
if (count == 0)
return _Private_Utils.EMPTY_INT_ARRAY;
int[] sids = new int[count];
for (int i = 0; i < count; i++) {
SymbolToken sym = _annotations[i];
int sid = sym.getSid();
if (sid == UNKNOWN_SYMBOL_ID) {
String text = sym.getText();
sid = add_symbol(text);
_annotations[i] = new SymbolTokenImpl(text, sid);
}
sids[i] = sid;
}
return sids;
}
use of com.amazon.ion.SymbolToken in project ion-java by amzn.
the class IonWriterSystem method addTypeAnnotation.
public final void addTypeAnnotation(String annotation) {
SymbolToken is = newSymbolToken(getSymbolTable(), annotation);
ensureAnnotationCapacity(_annotation_count + 1);
_annotations[_annotation_count++] = is;
}
use of com.amazon.ion.SymbolToken in project ion-java by amzn.
the class IonWriterSystemText method startValue.
@Override
void startValue() throws IOException {
super.startValue();
boolean followingLongString = _following_long_string;
followingLongString = writeSeparator(followingLongString);
// write field name
if (_in_struct) {
SymbolToken sym = assumeFieldNameSymbol();
writeFieldNameToken(sym);
_output.appendAscii(':');
clearFieldName();
followingLongString = false;
}
// writing an IVM
if (hasAnnotations() && !_is_writing_ivm) {
if (!_options._skip_annotations) {
SymbolToken[] annotations = getTypeAnnotationSymbols();
writeAnnotations(annotations);
followingLongString = false;
}
clearAnnotations();
}
_following_long_string = followingLongString;
}
use of com.amazon.ion.SymbolToken in project ion-java by amzn.
the class IonReaderTextRawX method append_annotation.
private final void append_annotation(SymbolToken sym) {
// empty text is checked by caller
int oldlen = _annotations.length;
if (_annotation_count >= oldlen) {
int newlen = oldlen * 2;
SymbolToken[] temp = new SymbolToken[newlen];
System.arraycopy(_annotations, 0, temp, 0, oldlen);
_annotations = temp;
}
_annotations[_annotation_count++] = sym;
}
Aggregations