juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <james.bog...@salesforce.com>
Subject Status update.
Date Mon, 29 Aug 2016 13:21:53 GMT
Hi all,

I've been working on tightening up the code by trying to convert the code
to use final fields where possible.  It seems to be having a small but
positive impact on performance.

There are two changes I'd like to make to the code....on minor and one

First, I'd like to replace @BeanProperty(beanUri=true) with
@Rdf(beanUri=true).  Only RDF has the concept of bean URIs, so I'd like to
move it out of the common code.

Second, I want to introduce the concept of class lexicons.  A class lexicon
is a simple mapping of names to classes to help identify class types when
they cannot be inferred through reflection (e.g. when parsing into an
Object or superclass/interface field).  The names would also be used as
element names in XML.

Class names would be defined by the following annotations...
@Bean(name="foo") - For beans.
@Pojo(name="foo") - For other POJOs.

Lexicons would be defined by the following annotations....
...and also serializer/parser properties...
SERIALIZER_lexicon, PARSER_lexiconClasses

For example....

public class Foo {
   public Object[] x = new Object[]{new Bar(), new Baz()};

public class Bar {}

public class Baz {}

When serialized as XML, you would see...

When serialized as JSON, 'n' attributes would be added when needed to infer
the type during parsing...
   x: [

This change should allow me to eliminate the following features that I was
never happy about:
1) The "_class" attribute.  Will be replaced with "n" attribute.
2) The @Bean(subTypeAttr) and @Bean(subTypeAttrs) annotations.

James Bognar

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message