private static Symbol getSymbol(Schema schema) { if (null == schema) { throw new NullPointerException("Schema cannot be null!"); } return new JsonGrammarGenerator().generate(schema); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<>())); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<LitS, Symbol>())); }
private static Symbol getSymbol(Schema schema) { if (null == schema) { throw new NullPointerException("Schema cannot be null!"); } return new JsonGrammarGenerator().generate(schema); }
case ARRAY: return Symbol.seq(Symbol.repeat(Symbol.ARRAY_END, Symbol.ITEM_END, generate(sc.getElementType(), seen)), Symbol.ARRAY_START); case MAP: return Symbol.seq(Symbol.repeat(Symbol.MAP_END, Symbol.ITEM_END, generate(sc.getValueType(), seen), Symbol.MAP_KEY_MARKER, Symbol.STRING), Symbol.MAP_START); for (Field f : sc.getFields()) { production[--i] = Symbol.fieldAdjustAction(n, f.name()); production[--i] = generate(f.schema(), seen); production[--i] = Symbol.FIELD_END; n++;
JsonEncoder(Schema sc, JsonGenerator out) throws IOException { configure(out); this.parser = new Parser(new JsonGrammarGenerator().generate(sc), this); }
case ARRAY: return Symbol.seq(Symbol.repeat(Symbol.ARRAY_END, Symbol.ITEM_END, generate(sc.getElementType(), seen)), Symbol.ARRAY_START); case MAP: return Symbol.seq(Symbol.repeat(Symbol.MAP_END, Symbol.ITEM_END, generate(sc.getValueType(), seen), Symbol.MAP_KEY_MARKER, Symbol.STRING), Symbol.MAP_START); for (Field f : sc.getFields()) { production[--i] = Symbol.fieldAdjustAction(n, f.name(), f.aliases()); production[--i] = generate(f.schema(), seen); production[--i] = Symbol.FIELD_END; n++;
JsonEncoder(Schema sc, JsonGenerator out) throws IOException { configure(out); this.parser = new Parser(new JsonGrammarGenerator().generate(sc), this); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<LitS, Symbol>())); }
/** Creates a new JsonDecoder based on an InputStream. */ public JsonDecoder(Schema schema, InputStream in) throws IOException { this(new JsonGrammarGenerator().generate(schema), in); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<LitS, Symbol>())); }
/** Creates a new JsonDecoder based on an InputStream. */ public JsonDecoder(Schema schema, InputStream in) throws IOException { this(new JsonGrammarGenerator().generate(schema), in); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<LitS, Symbol>())); }
/** Creates a new JsonDecoder based on a String input. */ public JsonDecoder(Schema schema, String in) throws IOException { this(new JsonGrammarGenerator().generate(schema), in); }
/** * Returns the non-terminal that is the start symbol * for the grammar for the grammar for the given schema <tt>sc</tt>. */ public Symbol generate(Schema schema) { return Symbol.root(generate(schema, new HashMap<LitS, Symbol>())); }
/** Creates a new JsonDecoder based on a String input. */ public JsonDecoder(Schema schema, String in) throws IOException { this(new JsonGrammarGenerator().generate(schema), in); }
case ARRAY: return Symbol.seq(Symbol.repeat(Symbol.ARRAY_END, Symbol.ITEM_END, generate(sc.getElementType(), seen)), Symbol.ARRAY_START); case MAP: return Symbol.seq(Symbol.repeat(Symbol.MAP_END, Symbol.ITEM_END, generate(sc.getValueType(), seen), Symbol.MAP_KEY_MARKER, Symbol.STRING), Symbol.MAP_START); for (Field f : sc.getFields()) { production[--i] = new Symbol.FieldAdjustAction(n, f.name()); production[--i] = generate(f.schema(), seen); n++;
private static Symbol getSymbol(Schema schema) { if (null == schema) { throw new NullPointerException("Schema cannot be null!"); } return new JsonGrammarGenerator().generate(schema); }
case ARRAY: return Symbol.seq(Symbol.repeat(Symbol.ARRAY_END, Symbol.ITEM_END, generate(sc.getElementType(), seen)), Symbol.ARRAY_START); case MAP: return Symbol.seq(Symbol.repeat(Symbol.MAP_END, Symbol.ITEM_END, generate(sc.getValueType(), seen), Symbol.MAP_KEY_MARKER, Symbol.STRING), Symbol.MAP_START); for (Field f : sc.getFields()) { production[--i] = Symbol.fieldAdjustAction(n, f.name()); production[--i] = generate(f.schema(), seen); production[--i] = Symbol.FIELD_END; n++;
private static Symbol getSymbol(Schema schema) { if (null == schema) { throw new NullPointerException("Schema cannot be null!"); } return new JsonGrammarGenerator().generate(schema); }