Skip to main content

Release 5.1.0.3

Date: Jun 28, 2014

Juno 5.1.0.3 is a moderate update.

Core API updates

  • Ability to detect and use non-public bean classes, getters/setters, and fields using the following new properties:

    • BeanContext.BEAN_beanConstructorVisibility - Control which bean constructors are visible to Juno.
    • BeanContext.BEAN_beanClassVisibility - Control which bean classes are interpreted as beans to Juno.
    • BeanContext.BEAN_beanFieldVisibility - Control which fields are visible to Juno as bean properties.
    • BeanContext.BEAN_beanMethodVisibility - Control which getters/setters are visible to Juno as bean properties.

    Removed BeanContext.INCLUDE_BEAN_FIELD_PROPERTIES and BeanContext.INCLUDE_BEAN_METHOD_PROPERTIES properties, since ignoring fields and methods can be accomplished by setting the appropriate properties above to Visibility.NONE.

    Also, the @BeanProperty annotation can now be used on non-public fields/getters/setters to override the default behavior defined by the VISIBILITY properties identified above. This is a convenient way of identifying protected or private fields or methods as bean properties. Previously, you could only identify public fields/getters/setters using this annotation.

  • New BeanContext.BEAN_useJavaBeanIntrospector property that lets Juno use the Java bean Introspector class to determine bean properties. In the previous release, the method for determining bean properties was a mixture of Juno-based and Introspector-based. Now it's either pure Juno-based or pure Introspector-based. The result is considerably cleaner code and consistent behavior.

  • New @BeanIgnore annotation. Replaces the previous @BeanProperty(hidden=true) annotation for ignoring bean properties. Can also be used on classes that look like beans so that they're not treated as beans.

  • Support for parsing into non-static member classes. This applies to all parsers.

  • New @Json(wrapperAttr) annotation that automatically wraps beans and objects in a wrapper attribute when serializing to or parsing from JSON.

  • Changed the default ordering of bean properties to be in parent-to-child class order.

  • New BeanFilter.readProperty(Object,String,Object) and BeanFilter.writeProperty(Object,String,Object) methods added to BeanFilter class to allow individualized serialization and parsing behavior on a class-by-class basis.

  • Eliminated previous restriction where bean subtype attributes had to be listed first in JSON objects when using the Bean.subTypeProperty() annotation. The previous behavior was not strictly JSON-compliant since JSON objects are supposed to consist of unordered lists of key/value pairs. While targeted for JSON, the restriction is also lifted for all other parsers.

  • New fluent-style BeanMap.load() methods for initializing bean maps.

  • HtmlDocSerializer will now embed the data portion of the output in a <div id='data'> element to make it easier to extract the data portion of the page in Javascript in browsers.

REST Server API updates

  • New RestRequest.getJavaMethod() method for getting access to the method used to handle a request. Useful for accessing the method name or annotations during requests, such as in calls to RestGuard.guard(RestRequest,RestResponse).

  • Fixed bug when using Jetty where you tried to read text input after a header was written.

  • Added new string variables $A{...} (request attributes) and $P{...} (request parameters) to RestServlet.createRequestVarResolver(RestRequest).