/** * NOT SYNCHRONIZED! Call within constructor or from synched method. * @param symbolName can be null when there's a gap in the local symbols list. */ private void recordLocalSymbolInIonRep(IonStruct ionRep, String symbolName, int sid) { assert sid >= myFirstLocalSid; ValueFactory sys = ionRep.getSystem(); // TODO this is crazy inefficient and not as reliable as it looks // since it doesn't handle the case where's theres more than one list IonValue syms = ionRep.get(SYMBOLS); while (syms != null && syms.getType() != IonType.LIST) { ionRep.remove(syms); syms = ionRep.get(SYMBOLS); } if (syms == null) { syms = sys.newEmptyList(); ionRep.put(SYMBOLS, syms); } int this_offset = sid - myFirstLocalSid; IonValue name = sys.newString(symbolName); ((IonList)syms).add(this_offset, name); }
private void writeIonListContent(IonList val) { if (val.isNullValue()) { writeByte((byte) (TYPE_LIST | NULL_LENGTH_MASK)); } else { writeIonSequenceContent(val); } }
@SuppressWarnings("resource") private IonValue getIonValue() throws IOException { if (_system == null) { throw new IllegalStateException("This "+getClass().getSimpleName()+" instance cannot be used for IonValue mapping"); } _currToken = JsonToken.VALUE_EMBEDDED_OBJECT; IonList l = _system.newEmptyList(); IonWriter writer = _system.newWriter(l); writer.writeValue(_reader); IonValue v = l.get(0); v.removeFromContainer(); return v; }
factory.newInt(importedTable.getMaxId())); importsList.add(importStruct);
private void writeIonListContent(IonList val) { if (val.isNullValue()) { writeByte((byte) (TYPE_LIST | NULL_LENGTH_MASK)); } else { writeIonSequenceContent(val); } }
/** * NOT SYNCHRONIZED! Call within constructor or from synched method. * @param symbolName can be null when there's a gap in the local symbols list. */ private void recordLocalSymbolInIonRep(IonStruct ionRep, String symbolName, int sid) { assert sid >= myFirstLocalSid; ValueFactory sys = ionRep.getSystem(); // TODO this is crazy inefficient and not as reliable as it looks // since it doesn't handle the case where's theres more than one list IonValue syms = ionRep.get(SYMBOLS); while (syms != null && syms.getType() != IonType.LIST) { ionRep.remove(syms); syms = ionRep.get(SYMBOLS); } if (syms == null) { syms = sys.newEmptyList(); ionRep.put(SYMBOLS, syms); } int this_offset = sid - myFirstLocalSid; IonValue name = sys.newString(symbolName); ((IonList)syms).add(this_offset, name); }
private void writeIonListContent(IonList val) { if (val.isNullValue()) { writeByte((byte) (TYPE_LIST | NULL_LENGTH_MASK)); } else { writeIonSequenceContent(val); } }
/** * NOT SYNCHRONIZED! Call within constructor or from synched method. * @param symbolName can be null when there's a gap in the local symbols list. */ private void recordLocalSymbolInIonRep(IonStruct ionRep, String symbolName, int sid) { assert sid >= myFirstLocalSid; ValueFactory sys = ionRep.getSystem(); // TODO this is crazy inefficient and not as reliable as it looks // since it doesn't handle the case where's theres more than one list IonValue syms = ionRep.get(SYMBOLS); while (syms != null && syms.getType() != IonType.LIST) { ionRep.remove(syms); syms = ionRep.get(SYMBOLS); } if (syms == null) { syms = sys.newEmptyList(); ionRep.put(SYMBOLS, syms); } int this_offset = sid - myFirstLocalSid; IonValue name = sys.newString(symbolName); ((IonList)syms).add(this_offset, name); }
factory.newInt(importedTable.getMaxId())); importsList.add(importStruct);
factory.newInt(importedTable.getMaxId())); importsList.add(importStruct);