-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement record path filter. #386
Conversation
Proof of concept; more test cases to follow. |
Open questions:
|
It would be nice if we could extract the |
Great, looks good, many thanks!
Not sure what you mean, something like literal-to-object / LiteralToObject (emits literal values as objects)?
Hm, they would always be empty right? I think the records should be skipped entirely. I think it makes sense: if we say e.g. 'records are in the data field', and there is no data field, we should not get any records.
Sounds good, in
I don't understand what you mean with the problem... metafacture-framework already depends on Mockito if that's what you mean. |
Thanks for having a look at this.
No, not really. I meant, what should happen here? @Test
public void shouldProcessLiteralPath() {
assertFilter(
i -> {
i.setPath("lit");
i.startRecord("1");
i.literal("lit", "record 1");
i.endRecord();
i.startRecord("2");
i.literal("lit", "record 2");
i.endRecord();
},
o -> {
o.get().startRecord("1");
o.get().literal("lit", "record 1"); // ?
o.get().endRecord();
o.get().startRecord("2");
o.get().literal("lit", "record 2"); // ?
o.get().endRecord();
}
);
} This would behave differently, because with an entity filter path, the entity element itself would not be emitted.
OK, I'll adapt it accordingly.
Well, not exactly. I thought it would have to go in
Yes, it's currently a |
dca31a1
to
ca9a107
Compare
Updated implementation:
Should be functionally complete now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, looks good, thanks.
Skipping if the path matches only a literal seems good to me. And we can extract the test helper class in the future, if we have a good solution for that. So I think we can merge, but leaving that to you (as we usually do in our internal team process).
Split event stream into records based on entity path.
Related to #382 and
org.metafacture.xml.XmlElementSplitter
.Resolves #385.