@Override public void skipAction() throws IOException { parser.popSymbol(); }
@Override public void skipAction() throws IOException { parser.popSymbol(); }
private void checkFixed(int size) throws IOException { parser.advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); if (size != top.size) { throw new AvroTypeException( "Incorrect length for fixed binary: expected " + top.size + " but received " + size + " bytes."); } }
@Override protected void skipFixed() throws IOException { advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); doSkipFixed(top.size); }
@Override protected void skipFixed() throws IOException { parser.advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); in.skipFixed(top.size); }
private void checkFixed(int size) throws IOException { advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); if (size != top.size) { throw new AvroTypeException( "Incorrect length for fixed binary: expected " + top.size + " but received " + size + " bytes."); } }
@Override protected void skipFixed() throws IOException { parser.advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); in.skipFixed(top.size); }
@Override public int readIndex() throws IOException { parser.advance(Symbol.UNION); Symbol.UnionAdjustAction top = (Symbol.UnionAdjustAction) parser.popSymbol(); parser.pushSymbol(top.symToParse); return top.rindex; }
private void checkFixed(int size) throws IOException { parser.advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); if (size != top.size) { throw new AvroTypeException( "Incorrect length for fixed binary: expected " + top.size + " but received " + size + " bytes."); } }
private void checkFixed(int size) throws IOException { advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); if (size != top.size) { throw new AvroTypeException( "Incorrect length for fixed binary: expected " + top.size + " but received " + size + " bytes."); } }
@Override protected void skipFixed() throws IOException { advance(Symbol.FIXED); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); doSkipFixed(top.size); }
@Override public int readEnum() throws IOException { advance(Symbol.ENUM); Symbol.EnumLabelsAction top = (Symbol.EnumLabelsAction) parser.popSymbol(); if (in.getCurrentToken() == JsonToken.VALUE_STRING) { in.getText(); int n = top.findLabel(in.getText()); if (n >= 0) { in.nextToken(); return n; } throw new AvroTypeException("Unknown symbol in enum " + in.getText()); } else { throw error("fixed"); } }
@Override public int readEnum() throws IOException { parser.advance(Symbol.ENUM); Symbol.EnumAdjustAction top = (Symbol.EnumAdjustAction) parser.popSymbol(); int n = in.readEnum(); Object o = top.adjustments[n]; if (o instanceof Integer) { return ((Integer) o).intValue(); } else { throw new AvroTypeException((String) o); } }
@Override public int readEnum() throws IOException { parser.advance(Symbol.ENUM); Symbol.EnumAdjustAction top = (Symbol.EnumAdjustAction) parser.popSymbol(); int n = in.readEnum(); if (top.noAdjustments) return n; Object o = top.adjustments[n]; if (o instanceof Integer) { return ((Integer) o).intValue(); } else { throw new AvroTypeException((String) o); } }
@Override public int readEnum() throws IOException { parser.advance(Symbol.ENUM); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); int result = in.readEnum(); if (result < 0 || result >= top.size) { throw new AvroTypeException( "Enumeration out of range: max is " + top.size + " but received " + result); } return result; }
@Override public int readEnum() throws IOException { parser.advance(Symbol.ENUM); Symbol.IntCheckAction top = (Symbol.IntCheckAction) parser.popSymbol(); int result = in.readEnum(); if (result < 0 || result >= top.size) { throw new AvroTypeException( "Enumeration out of range: max is " + top.size + " but received " + result); } return result; }
@Override public int readIndex() throws IOException { parser.advance(Symbol.UNION); Symbol.Alternative top = (Symbol.Alternative) parser.popSymbol(); int result = in.readIndex(); parser.pushSymbol(top.getSymbol(result)); return result; }
@Override public int readIndex() throws IOException { parser.advance(Symbol.UNION); Symbol.Alternative top = (Symbol.Alternative) parser.popSymbol(); int result = in.readIndex(); parser.pushSymbol(top.getSymbol(result)); return result; }
@Override public int readIndex() throws IOException { parser.advance(Symbol.UNION); Symbol top = parser.popSymbol(); int result; if (top instanceof Symbol.UnionAdjustAction) { result = ((Symbol.UnionAdjustAction) top).rindex; top = ((Symbol.UnionAdjustAction) top).symToParse; } else { result = in.readIndex(); top = ((Symbol.Alternative) top).getSymbol(result); } parser.pushSymbol(top); return result; }
@Override public int readEnum() throws IOException { advance(Symbol.ENUM); Symbol.EnumLabelsAction top = (Symbol.EnumLabelsAction) parser.popSymbol(); if (in.getCurrentToken() == JsonToken.VALUE_STRING) { in.getText(); int n = top.findLabel(in.getText()); if (n >= 0) { in.nextToken(); return n; } throw new AvroTypeException("Unknown symbol in enum " + in.getText()); } else { throw error("fixed"); } }