public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader) { TokenStream result = new LowerCaseTokenizer(reader); result = new PayloadFilter(enclosingInstance, result, fieldName); return(result); }
public Task <object> SendReceive <TSend>(TSend obj, PayloadFilter filter, CancellationToken?token = null) { var res = Receive(filter, token); Send(obj); return(res); }
public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader) { PayloadData payload = (PayloadData)fieldToData[fieldName]; TokenStream ts = new WhitespaceTokenizer(reader); if (payload != null) { if (payload.numFieldInstancesToSkip == 0) { ts = new PayloadFilter(ts, payload.data, payload.offset, payload.length); } else { payload.numFieldInstancesToSkip--; } } return(ts); }
public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader) { TokenStream result = new LowerCaseTokenizer(reader); result = new PayloadFilter(enclosingInstance, result, fieldName); return result; }
public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader) { PayloadData payload = (PayloadData) fieldToData[fieldName]; TokenStream ts = new WhitespaceTokenizer(reader); if (payload != null) { if (payload.numFieldInstancesToSkip == 0) { ts = new PayloadFilter(ts, payload.data, payload.offset, payload.length); } else { payload.numFieldInstancesToSkip--; } } return ts; }
/// <summary> /// Find all payload components with the help of the PayloadComponentAttribute /// </summary> /// <param name="assembly"></param> /// <returns></returns> public static IEnumerable <PayloadDefinition> FindPayloadComponents(Assembly assembly, PayloadFilter includePayload) { var types = assembly.GetTypes(); Type interfaceType = typeof(IPayloadComponent); foreach (var t in types) { if (interfaceType.IsAssignableFrom(t)) { foreach (var componentAttribute in t.GetCustomAttributes <PayloadComponentAttribute>()) { if (includePayload(t, componentAttribute)) { Serialize serialize = FindSerializeMethod(t); Deserialize deserialize = FindDeserializeMethod(t); yield return(new PayloadDefinition(componentAttribute.Name, t, serialize, deserialize)); } } } } }