@Override public CompositeRoute path(CharSequence path) { int pathsId = pathCounter.getAndIncrement(); //logger.trace("pathId: {} assinged for path: {}",pathsId, path); FieldExtractionDefinitions fieldExDef = parser.addPath(path, routeId, pathsId, structId);//hold for defaults.. activePathFieldIndexPosLookup = new int[fieldExDef.getIndexCount()]; activePathFieldValidator = new Object[fieldExDef.getIndexCount()]; //this visitor will populate the above 2 member arrays we just created fieldExDef.getFieldParamParser().visitPatterns(modifyStructVisitor); fieldExDef.setPathFieldLookup(activePathFieldIndexPosLookup, activePathFieldValidator); config.storeRequestExtractionParsers(pathsId, fieldExDef); //this looked up by pathId config.storeRequestedJSONMapping(routeId, extractor); assert(structId == config.getStructIdForRouteId(routeId)); defs.add(fieldExDef); //System.out.println("added path:"+path); //System.out.println("known routes defined:\n"+parser.debugRouterMap()); return this; }
routeParser().addPath(constantUnknownRoute, routeId, pathId, structId); UNMAPPED_STRUCT = structId;