Here is an example of my question:
1) I have XML files in which the rules for my account are fixed
<rules> .. <price> <Required>True</Required> <MinValue>0.1</MinValue> <price> .. </rules>
2) I have an invoice object in java (important: it should remain so (simple) . No annotations or anything else should be included.)
public class Invoice implements Serializable { private String details; private String tax; private String recipient; private double price;
}
3) And at least I have a Validator object
public class Validator(){ public boolean validate(String xmlfile, Invoice i) {
What I need: The validator should take an XML file with rules inside for example
<price> <Required>True</Required> <MinValue>0.1</MinValue> <price>
and use this rule to validate the Invoice Java object.
Is there any good framework that I could use for this? Or textbooks? Approaches? Any help is really appreciated.
Thanks.
source share