@Test public void nestedAllSemanticIdentifiers() throws ParseException { JSONArray json = array( "[\n" + " 'all',\n" + " ['==', '$type', 'LineString'],\n" + " ['all', ['==', 'brunnel', 'tunnel'], ['==', 'class', 'path']]\n" + " ]"); MBFilter mbfilter = new MBFilter(json); Set<SemanticType> identifiers = mbfilter.semanticTypeIdentifiers(); assertEquals(Collections.singleton(SemanticType.LINE), identifiers); }
public Set<SemanticType> semanticTypeIdentifiers() { if (json == null || json.isEmpty()) { return semanticTypeIdentifiersDefaults(); } Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json); return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes; }
MBFilter { public Set<SemanticType> semanticTypeIdentifiers() { if (json == null || json.isEmpty()) { return semanticTypeIdentifiersDefaults(); } Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json); return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes; } }
MBFilter { public Set<SemanticType> semanticTypeIdentifiers() { if (json == null || json.isEmpty()) { return semanticTypeIdentifiersDefaults(); } Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json); return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes; } MBFilter(JSONArray json);  MBFilter(JSONArray json, MBObjectParser parse);  MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType); }
MBFilter { public Set<SemanticType> semanticTypeIdentifiers() { if (json == null || json.isEmpty()) { return semanticTypeIdentifiersDefaults(); } Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json); return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes; } MBFilter(JSONArray json);  MBFilter(JSONArray json, MBObjectParser parse);  MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType); Set<SemanticType> semanticTypeIdentifiers(); Filter filter(); }
MBFilter { public Set<SemanticType> semanticTypeIdentifiers() { if (json == null || json.isEmpty()) { return semanticTypeIdentifiersDefaults(); } Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json); return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes; } MBFilter(JSONArray json);  MBFilter(JSONArray json, MBObjectParser parse);  MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType); Set<SemanticType> semanticTypeIdentifiers(); Filter filter(); static final String TYPE_POINT; static final String TYPE_LINE; static final String TYPE_POLYGON; }