On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: jmsnell
Date: Wed Jun 28 10:51:56 2006
New Revision: 417828
URL: http://svn.apache.org/viewvc?rev=417828&view=rev
Log:
Adding custom parser/writer support
This introduces the concept of named parsers and named writers. For instance,
if I wanted to have
a JSON serialization of a set of Abdera objects, I could do something like:
Writer writer = WriterFactory.INSTANCE.getInstance("json");
Maybe it's just me, but .INSTANCE.getInstance() seems kind of weird.
We have to get an instance of our factor, and use that to get an
instance of a writer? Is it just me, or is maybe this stuff getting a
bit too overly abstract?
Also...
@@ -93,5 +93,31 @@
ParserOptions options)
throws ParseException, URISyntaxException;
+ <T extends Element>Document<T> parse(
+ Object in)
+ throws ParseException;
+
+ <T extends Element>Document<T> parse(
+ Object in,
+ URI base)
+ throws ParseException;
+
+ <T extends Element>Document<T> parse(
+ Object in,
+ URI base,
+ ParserOptions options)
+ throws ParseException;
+
+ <T extends Element>Document<T> parse(
+ Object in,
+ String base)
+ throws ParseException, URISyntaxException;
+
+ <T extends Element>Document<T> parse(
+ Object in,
+ String base,
+ ParserOptions options)
+ throws ParseException, URISyntaxException;
+
ParserOptions getDefaultParserOptions();
}
I'm not overly thrilled with the idea of adding parse(Object foo)
methods... Doesn't that basically kill any benefit from static typing
we once had here? Compile time errors are now run time errors...
-garrett