public GreenTokenMap(boolean ignoreCase) { boolean skipDeepChecks = false; boolean supportsExtraction = true; tp = new TrieParser(128, 4, skipDeepChecks, supportsExtraction, ignoreCase); }
public JSONFieldSchema(int nullPosition) { this.mappings = new JSONFieldMapping[0]; this.parser = new TrieParser(256,2,false,true); JSONStreamParser.populateWithJSONTokens(parser); }
private static TrieParser defaultParser() { TrieParser trie = new TrieParser(256,1,false,true); populateWithJSONTokens(trie); return trie; }
private static TrieParser structureNameSeparatorParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.nameSeparator, NAME_SEPARATOR); return trie; }
public static TrieParser textToNumberTrieParser() { if (textToNumberParser == null) { TrieParser p = new TrieParser(8,false); //supports streaming, so false p.setUTF8Value("%i%.", 1); //p.setUTF8Value("%i%.%/%.", 1); //the above pattern can parse 234 and 234.34 and 23/45 and 23.4/56.7 //it also supports the normal capture methods for ints and decimals with no change //TrieParserReader.capturedLongField(parserReader, 0) textToNumberParser = p; } return textToNumberParser; }
public static TrieParser textToNumberTrieParser() { if (textToNumberParser == null) { TrieParser p = new TrieParser(8,false); //supports streaming, so false p.setUTF8Value("%i%.", 1); //p.setUTF8Value("%i%.%/%.", 1); //the above pattern can parse 234 and 234.34 and 23/45 and 23.4/56.7 //it also supports the normal capture methods for ints and decimals with no change //TrieParserReader.capturedLongField(parserReader, 0) textToNumberParser = p; } return textToNumberParser; }
@Override public void defineUnScopedTopic(String topic) { if (null == unScopedTopics) { unScopedTopics = new TrieParser(); } unScopedTopics.setUTF8Value(topic, 1); }
private static TrieParser stringBeginParser() { //TODO: double check that slash and " if appearing inside UTF8 encoding do not get picked up as an escape.. TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.string221, STRING_PART | 0x2200); trie.setValue(JSONConstants.string222, STRING_END | 0x2200); return trie; }
private static TrieParser stringBeginParser() { //TODO: double check that slash and " if appearing inside UTF8 encoding do not get picked up as an escape.. TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.string221, STRING_PART | 0x2200); trie.setValue(JSONConstants.string222, STRING_END | 0x2200); return trie; }
private static TrieParser structureObjectEndParser() { TrieParser trie = new TrieParser(128,1,true,false); trie.setValue(JSONConstants.endObject, END_OBJECT); trie.setValue(JSONConstants.valueSeparator, VALUE_SEPARATOR); return trie; }
public TrieCollector(int size) { trie = new TrieParser(size, 2, false, false); reader = new TrieParserReader(); pipe.initBuffers(); }
private static TrieParser structureObjectEndParser() { TrieParser trie = new TrieParser(128,1,true,false); trie.setValue(JSONConstants.endObject, END_OBJECT); trie.setValue(JSONConstants.valueSeparator, VALUE_SEPARATOR); return trie; }
public TrieCollector(int size) { trie = new TrieParser(size, 2, false, false); reader = new TrieParserReader(); pipe.initBuffers(); }
private static TrieParser structureObjectEndParser() { TrieParser trie = new TrieParser(128,1,true,false); trie.setValue(JSONConstants.endObject, END_OBJECT); trie.setValue(JSONConstants.valueSeparator, VALUE_SEPARATOR); return trie; }
private static TrieParser structureArrayEndParser() { TrieParser trie = new TrieParser(128,1,true,false); trie.setValue(JSONConstants.endArray, END_ARRAY); trie.setValue(JSONConstants.valueSeparator, VALUE_SEPARATOR); return trie; }
private static TrieParser structureBeginParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.beginArray, BEGIN_ARRAY); trie.setValue(JSONConstants.beginObject, BEGIN_OBJECT); return trie; }
public TrieCollector(int size) { trie = new TrieParser(size, 2, false, false); reader = new TrieParserReader(); pipe.initBuffers(); }
public static <T extends Enum<T> & TrieKeyable> TrieParser customParser(Class<T> keys) { //2 because we need 2 shorts for the number TrieParser trie = new TrieParser(256,2,false,true); for (T key: keys.getEnumConstants()) { int value = toValue(key.ordinal()); assert(value>=0); trie.setUTF8Value("\"", key.getKey(), "\"", value); //TODO: should we add the same key without quotes ?? } populateWithJSONTokens(trie); return trie; }
private static TrieParser literalParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.number, NUMBER_ID); trie.setValue(JSONConstants.falseLiteral, FALSE_ID); trie.setValue(JSONConstants.nullLiteral, NULL_ID); trie.setValue(JSONConstants.trueLiteral, TRUE_ID); return trie; }
private static TrieParser whiteSpaceParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.ws1, 1); trie.setValue(JSONConstants.ws2, 2); trie.setValue(JSONConstants.ws3, 3); trie.setValue(JSONConstants.ws4, 4); return trie; }