开发者

Which interface should I implement to have parse method

开发者 https://www.devze.com 2023-01-15 05:53 出处:网络
I\'m working with webservices. I have a java object defined for the re开发者_StackOverflowquest. I\'d like to create a java object of this type from a String or a XmlObject. Which interface should I i

I'm working with webservices. I have a java object defined for the re开发者_StackOverflowquest. I'd like to create a java object of this type from a String or a XmlObject. Which interface should I implement to use the method parse to do this?

Thanks and regards


Won't you be better off using some kind of serialization/deserialization library such as XStream or something


You could create your own interface :)

public interface Parser<E>
{
  E parse(String sourceString);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消