I have a class which is called TestPlan
(to put it simple, let's assume that it's a usual java bean).
I need to store TestPlan
instances in xml-files (1 instance per file). The most appropriate way to do it which I can see is using another class which should do only xml-related work.
It'll have methods like:
public TestPlan parseTestPlanXml(InputStream xmlFile) {
TestPlan testPlan = new TestPlan();
//parse xmlFile and set testPlan fields via setters
return testPlan;
}
public OutputStream writeTestPlanXml(TestPlan testPlan) {
//the actual implementation just copies the original xmlFile,
//makes necessary modifications
//and writes it to ByteArrayOutputStream
...
}
Which name would you suggest for this class? (btw, if you can also suggest better names for these 2 methods then don't hesitate to do that).
Thanks!