@Override public CompositeRouteFinish refineText(String key, Object associatedObject, String defaultValue) { associatedObject(key,associatedObject); defaultText(key, defaultValue); return this; }
@Override public CompositeRouteFinish refineDecimal(String key, Object associatedObject, long mantissa, byte exponent) { associatedObject(key,associatedObject); defaultDecimal(key, mantissa, exponent); return this; }
@Override public CompositeRouteFinish refineInteger(String key, Object associatedObject, long defaultValue) { associatedObject(key,associatedObject); defaultInteger(key, defaultValue); return this; }
public CompositeRoute registerCompositeRoute(JSONExtractorCompleted extractor, HTTPHeader ... headers) { return new CompositeRouteImpl(conStruct, this, extractor, routeParser(), headers, routeCount++, pathCount); }
@Override public void visit(byte[] pattern, int length, long value) { final int argPos = ((int)value&0xFFFF)-1; StructType type = extractType(pattern, length, value); final long fieldId = scs.registry.modifyStruct(structId, pattern, 0, length, type, 0); //must build a list of fieldId ref in the order that these are disovered //at postion inURL must store fieldId for use later... where is this held? //one per path. activePathFieldIndexPosLookup[argPos] = (int)fieldId & StructRegistry.FIELD_MASK; activePathFieldValidator[argPos] = scs.registry.fieldValidator(fieldId); }
@Override public CompositeRouteFinish refineInteger(String key, Object associatedObject, long defaultValue, LongValidator validator) { long fieldLookup = scs.registry.fieldLookup(key, structId); if (-1 == fieldLookup) { throw new UnsupportedOperationException("The field "+key+" was not found defined above"); } scs.registry.setAssociatedObject(fieldLookup, associatedObject); assert(fieldLookup == scs.registry.fieldLookupByIdentity(associatedObject, structId)); scs.registry.setValidator(fieldLookup, JSONRequired.REQUIRED, validator); defaultInteger(key, defaultValue); return this; }
@Override public CompositeRouteFinish refineText(String key, Object associatedObject, String defaultValue, ByteSequenceValidator validator) { long fieldLookup = scs.registry.fieldLookup(key, structId); if (-1 == fieldLookup) { throw new UnsupportedOperationException("The field "+key+" was not found defined above"); } scs.registry.setAssociatedObject(fieldLookup, associatedObject); assert(fieldLookup == scs.registry.fieldLookupByIdentity(associatedObject, structId)); scs.registry.setValidator(fieldLookup, JSONRequired.REQUIRED, validator); defaultText(key, defaultValue); return this; }
@Override public CompositeRouteFinish refineDecimal(String key, Object associatedObject, long defaultMantissa, byte defaultExponent, DecimalValidator validator) { long fieldLookup = scs.registry.fieldLookup(key, structId); if (-1 == fieldLookup) { throw new UnsupportedOperationException("The field "+key+" was not found defined above"); } scs.registry.setAssociatedObject(fieldLookup, associatedObject); assert(fieldLookup == scs.registry.fieldLookupByIdentity(associatedObject, structId)); scs.registry.setValidator(fieldLookup, JSONRequired.REQUIRED, validator); defaultDecimal(key, defaultMantissa, defaultExponent);//NOTE: we must always set the default AFTER the validator return this; }
public CompositeRoute registerCompositeRoute(HTTPHeader ... headers) { return new CompositeRouteImpl(conStruct, this, null, routeParser(), headers, routeCount++, pathCount); }