abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: svn commit: r417828 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ core/src/main/java/org/apache/abdera/writer/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Wed, 28 Jun 2006 19:05:15 GMT
On 6/28/06, jmsnell@apache.org <jmsnell@apache.org> 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

Mime
View raw message