@Override public final void execute(AnalyserTaskContext ctx) throws Exception { Feature feature = ctx.getFeature(); // extract and check the api-regions Extensions extensions = feature.getExtensions(); Extension apiRegionsExtension = extensions.getByName(API_REGIONS_KEY); if (apiRegionsExtension == null) { // no need to be analyzed return; } String jsonRepresentation = apiRegionsExtension.getJSON(); if (jsonRepresentation == null || jsonRepresentation.isEmpty()) { // no need to be analyzed return; } // read the api-regions and create a Sieve data structure for checks ApiRegions apiRegions; try { apiRegions = ApiRegions.fromJson(jsonRepresentation); } catch (JsonParsingException e) { ctx.reportError("API Regions '" + jsonRepresentation + "' does not represent a valid JSON 'api-regions': " + e.getMessage()); return; } execute(apiRegions, ctx); }
section.setContents(ext.getText()); } else if (ext.getType() == ExtensionType.JSON) { JsonReader reader = Json.createReader(new StringReader(ext.getJSON())); JsonArray arr = reader.readArray(); StringBuilder sb = new StringBuilder();
case JSON : c.setJSON(e.getJSON()); break; case TEXT : c.setText(e.getText());