@Override public boolean find(final ParserContext ctx, final ValueListener<HttpUri> value) { // we are after 'http:' now. final int pos = ctx.position(); final CharSequence number = ParserUtils.read(ctx, URIC); if (number == null) { ctx.position(pos); return false; } if (value != null) { value.set(new HttpUri(this.secure, number.toString())); } return true; }
@Override public boolean find(final ParserContext ctx, final ValueListener<CSeq> value) { final int pos = ctx.position(); final UnsignedInteger seq = ctx.read(ParserUtils.uint(1, 10), null); if ((seq == null) || (ctx.skip(ParserUtils.LWS) == false)) { ctx.position(pos); return false; } final CharSequence method = ctx.read(ParserUtils.TOKEN); if (method == null) { ctx.position(pos); return false; } if (value != null) { value.set(new CSeq(seq, SipMethod.of(method))); } return true; }
@Override public boolean find(final ParserContext context, final ValueListener<ViaProtocol> proto) { final int pos = context.position(); try { final CharSequence name = context.read(TOKEN); context.read(SLASH); final CharSequence version = context.read(TOKEN); context.read(SLASH); final CharSequence transport = context.read(TOKEN); if (proto != null) { proto.set(new ViaProtocol(name, version, transport)); } return true; } catch (final SipMessageParseFailureException e) { context.position(pos); return false; } }