Skip to main content

Release Notes 6.x

This page collects every release in the 6.x line, newest first.

Release 6.4.0​

Date: Oct 5, 2017

The major change in this release is the project structure.

The library now consists of the following artifacts found in the Maven group "org.apache.juneau":

CategoryMaven ArtifactsDescriptionPrereqs
Juneau Corejuneau-marshallSerializers and parsers for: JSON, XML, HTML, UON, URL-Encoding, MessagePack, SOAP/XML, CSV, BSON (coming soon), YAML (coming soon), Protobuf (coming soon)Java 6
juneau-marshallSerializers and parsers for: RDF/XML, RDF/XML-Abbrev, N-Triple, Turtle, N3Java 6, Apache Jena 2.7.1
juneau-dtoData Transfer Objects for: HTML5, Atom, Cognos, JSON-Schema, Swagger 2.0Java 6
juneau-svlSimple Variable Language APIJava 6
juneau-configConfiguration file APIJava 6
Juneau RESTjuneau-rest-serverREST Servlet APIJava 6, Servlet 3.1
juneau-rest-server-jaxrsOptional JAX-RS supportJava 6, JAX-RS 2.0
juneau-rest-clientREST Client APIJava 6, Apache HttpClient 4.5
Juneau Microservicejuneau-microservice-serverREST Microservice Server APIJava 8, Eclipse Jetty 9.4.3
juneau-microservice-templateDeveloper template projectJava 8, Eclipse Jetty 9.4.3
Examplesjuneau-examples-coreCore code examples
juneau-examples-restREST code examples
Juneau Alljuneau-allCombination of: juneau-marshall, juneau-dto, juneau-svl, juneau-config, juneau-rest-server, juneau-rest-clientJava 6, Servlet 3.1, Apache HttpClient 4.5

juneau-marshall​

  • Improvements to swap support.

    • New @Swap annotation. Replaces the @Pojo and @BeanProperty(swap) annotations.

    • Support for per-media-type swaps.

      Programmatic example:

      @Swap(MyJsonOnlySwap.class)			
      public class MyPojo {}

      public class MyJsonOnlySwap extends PojoSwap<MyPojo,String> {

      public MediaType[] forMediaTypes() {
      return MediaType.forStrings("*/json");
      }

      public String swap(BeanSession session, MyPojo o) throws Exception {
      return "It's JSON!";
      }
      }

      Annotated example:

      @Swap(impl=ToStringSwap.class, mediaTypes="*/json")
      public class MyBean { ... }

      public class ToStringSwap extends PojoSwap<Object,String> {
      public String swap(BeanSession session, Object o) throws Exception {
      return o.toString();
      }
      }
    • Support for templated swaps which provide additional context information for a swap. The following is an example of a templated swap class used to serialize POJOs to HTML using FreeMarker:

      // Our abstracted templated swap class.
      public abstract class FreeMarkerSwap extends PojoSwap<Object,Reader> {

      public MediaType[] forMediaTypes() {
      return MediaType.forStrings("*/html");
      }

      public Reader swap(BeanSession session, Object o, String template) throws Exception {
      return getFreeMarkerReader(template, o); // Some method that creates raw HTML.
      }
      }
      @Swap(impl=FreeMarkerSwap.class, template="MyPojo.div.ftl")
      public class MyPojo {}
    • New @Swaps annotation for defining multiple swaps against the same POJO when they're differentiated by media types:

      @Swaps(
      {
      @Swap(MyJsonSwap.class),
      @Swap(MyXmlSwap.class),
      @Swap(MyOtherSwap.class)
      }
      )
      public class MyPojo {}
  • New Surrogate interface for identifying surrogate classes.

  • Serializers can now serialize to StringBuilders.

  • Serializers now serialize the contents of Readers and InputStreams directly to the output stream or writer. When used with conjunction with PojoSwaps, this can be used to provide customized output for specific content types.

    @Pojo(swap=MyBeanSwap.class)
    public class MyBean {...}

    public class MyBeanSwap extends PojoSwap<MyBean,Object> {
    public Object swap(BeanSession session, MyPojo o) throws Exception {
    MediaType mt = session.getMediaType();
    if (mt.hasSubType("json"))
    return new StringReader("{foo:'bar'}"); // Custom JSON output
    return o; // Otherwise treat as normal bean
    }
    }

    // Produces "{foo:'bar'}"
    String json = SimpleJsonSerializer.DEFAULT.toString(new MyBean());

    This feature helps with the implementation of language-agnostic template support such as for using FreeMaker to serialize POJOs to HTML.

  • SerializerSession and ParserSession objects are now reusable if used within the same thread.

    // Old way (still works)
    JsonSerializer.DEFAULT.serialize(writer1, pojo1);
    JsonSerializer.DEFAULT.serialize(writer2, pojo2);

    // Same but using a session object
    SerializerSession session = JsonSerializer.DEFAULT.createSession();
    try {
    session.serialize(writer1, pojo1);
    session.serialize(writer2, pojo2);
    } finally {
    session.close();
    }

    This is mostly an internal change and doesn't affect the existing APIs.

  • PojoSwap.swap(BeanSession,Object) and PojoSwap.unswap(BeanSession,Object,ClassMeta) can now throw arbitrary exceptions instead of having to wrap them in SerializeException/ParseException.

  • New CalendarUtils class that encapsulates serialization/parsing logic from CalendarSwap and DateSwap.

  • New annotation @Html(anchorText).

  • New methods on ObjectList:

    • ObjectList.get(int,Class)
    • ObjectList.get(int,Type,Type...)
    • ObjectList.getMap(int,Class,Class)
    • ObjectList.getList(int,Class)
  • New methods on ObjectMap:

    • ObjectMap.get(String,Class)
    • ObjectMap.get(String,Type,Type...)
    • ObjectMap.getWithDefault(String,Object)
    • ObjectMap.getWithDefault(String,Object,Class)
    • ObjectMap.getWithDefault(String,Object,Type,Type...)
    • ObjectMap.getSwapped(String,PojoSwap)
    • ObjectMap.getAt(String,Class)
    • ObjectMap.getAt(String,Type,Type...)
    • ObjectMap.getMap(String,Class,Class,Map)
    • ObjectMap.getList(String,Class,List)
  • New methods on PojoRest:

    • PojoRest.get(String,Class)
    • PojoRest.get(String,Type,Type...)
    • PojoRest.getWithDefault(String,Object)
    • PojoRest.getWithDefault(String,Object,Class)
    • PojoRest.getWithDefault(String,Object,Type,Type...)
  • Fixed bug where BeanSession.getMediaType() wasn't returning a value.

  • Eliminated the @Consumes and @Produces annotations. The supported media types are now passed in through the constructors. This was changed to eliminate a performance issue where a field could not be set as final because the call to getClass() to retrieve the annotation value could not be called before calling the super() method.

  • New class: PojoMerge

  • New doc: 2.6.2 - @Pojo annotation

  • New doc: 2.6.5 - Serializing Readers and InputStreams

juneau-dto​

  • HtmlElementMixed.children(Object...) can now take in collections of objects.

  • The DTO beans can now be serialized to strings of their typical language by calling the toString() method. For example, Swagger.toString() produces JSON and the HTML5 Form.toString() produces HTML.

juneau-rest-server​

  • Revamped and simplified servlet and REST-call lifecycle handling through new @RestHook annotation.

    • The RestServlet.init(ServletConfig) method is now final and can no longer be extended. Instead, use HookEvent.INIT or HookEvent.POST_INIT for initialization.

    • The following methods on RestServlet have been removed:

      • init(RestConfig) - Use HookEvent.INIT instead.
      • onSuccess(RestRequest, RestResponse, long) - Use HookEvent.END_CALL instead.
      • onPreCall(RestRequest) - Use HookEvent.PRE_CALL instead.
      • onPostCall(RestRequest, RestResponse) - Use HookEvent.POST_CALL instead.
  • Simplified MenuItemWidget. Exposes an abstract method getContent(RestRequest) that can return raw HTML via readers or char-sequences, or any other object (such as HTML5 beans) that will get converted to HTML using HtmlSerializer.DEFAULT.

  • RestResourceResolver instances are now inherited from parent resources to child resources unless explicitly overridden at the child level. It's also been changed to an interface.

  • New annotations on @RestResource:

    • resourceResolver() - Allows you to specify a resource resolver on the servlet context to make it easier to work with dependency injection frameworks.
    • contextPath() - Allows you to override the context path value inherited from the servlet container.
    • allowHeaderParams() - Replaces the RestContext.REST_allowHeaderParams setting.
    • allowMethodParam() - Replaces the RestContext.REST_allowMethodParam setting.
    • allowBodyParam() - Replaces the RestContext.REST_allowBodyParam setting.
    • renderResponseStackTraces() - Replaces the RestContext.REST_xxx setting.
    • useStackTraceHashes() - Replaces the RestContext.REST_useStackTraceHashes setting.
    • defaultCharset() - Replaces the RestContext.REST_defaultCharset setting.
    • paramFormat() - Replaces the RestContext.REST_paramFormat setting.
  • New annotations on @RestMethod:

    • RestMethod.defaultCharset() - Replaces the RestContext.REST_defaultCharset setting.
    • RestMethod.paramFormat() - Replaces the RestContext.REST_paramFormat setting.
  • The following implementation classes can now be defined as non-static inner classes of servlets/resources:

    • Widget
    • RestConverter
    • RestGuard
    • ResponseHandler
    • RestCallHandler
    • RestInfoProvider
    • RestResourceResolver
    • RestLogger
    • HtmlDocTemplate
  • New tooltip template: Tooltip

  • New dark theme available:

    Dark Theme

  • Stylesheet selection now stored in HTTP session when passed in via ?stylesheet query parameter.

  • New doc: Lifecycle Hooks

  • Eliminated the RestServletJenaDefault class to remove the Jena dependency class on the juneau-rest-server artifact. It's simple enough to simply extend BasicRestServlet and add the RDF serializers and parsers.

juneau-microservice​

  • The microservice has been significantly modified to be configured via a jetty.xml file for maximum flexibility instead of the hodge-podge of support in the config file. Top-level servlets should now be defined in the provided jetty.xml file.

  • New methods on RestMicroservice:

    • addServlet(Servlet,String)
    • addServletAttribute(String,Object)
    • getServer()
    • getInstance()
    • getPort()
    • getContextPath()
    • getProtocol()
    • getHostName()
  • New methods on Microservice:

  • New class JettyLogger for directing Jetty logging to the java.util.logging framework.

  • New class DebugResource for viewing and generating Jetty thread dumps through REST calls.

org.apache.juneau.rest.examples​

  • New example of adding a menu-item widget to the Pet Store resource (including tooltips):

    Pet Store Menu Example

Release 6.3.1​

Date: Aug 1, 2017

Juneau 6.3.1 is a minor release.

org.apache.juneau​

  • PojoQuery improvements.

  • New RemoteMethod.returns() annotation. Allows you to specify whether the remote method returns the HTTP body or status code.

  • Fixed bugs with BEAN_includeProperties and BEAN_excludeProperties settings.

  • New/modified settings in HtmlDocSerializerContext:

    • HTMLDOC_script
    • HTMLDOC_style - Was HTMLDOC_css.
    • HTMLDOC_stylesheet - Was HTMLDOC_cssUrl. Now an array.
  • New ResourceFinder utility class. Allows you to search for resources up the parent hierarchy chain. Also allows you to search for localized resources.

  • Eliminated the following properties from HtmlDocSerializerContext: HTMLDOC_title, HTMLDOC_description, HTMLDOC_description See below on changes to simplify HTML headers.

  • Var implementations can now throw exceptions and will be converted to "{exceptionMessage}" values.

org.apache.juneau.rest​

  • New 'light' stylesheet:

    Light Style

    Compared with previous 'devops':

    DevOps Style

    For those nostalgic for old times, there's also 'original':

    Original Style

  • Simplified the stylesheets and HTML code. For example, the nav links are now an ordered list of elements which makes rendering as a side-bar (for example) easier to do in CSS.

  • Modifications to the following @HtmlDoc annotations:

    • @HtmlDoc(navlinks) - Now an array of strings instead of a JSON object. Simplified syntax.

      For example:

      // Old syntax
      htmldoc=@HtmlDoc(
      links="{"
      + "up:'request:/..',"
      + "options:'servlet:/?method=OPTIONS',"
      + "contentTypes:'$W{ContentTypeMenuItem}',"
      + "styles:'$W{StyleMenuItem}',"
      + "source:'$C{Source/gitHub}/org/apache/juneau/examples/rest/PetStoreResource.java'"
      + "}"
      )

      // New syntax
      htmldoc=@HtmlDoc(
      navlinks={
      "up: request:/..",
      "options: servlet:/?method=OPTIONS",
      "$W{ContentTypeMenuItem}",
      "$W{StyleMenuItem}",
      "source: $C{Source/gitHub}/org/apache/juneau/examples/rest/PetStoreResource.java"
      }
      )

      Previous syntax will still work but you're encouraged to use the simplified syntax.

    • Several annotations are now arrays of strings instead of simple strings. Values are simply concatenated with newlines which makes multi-line values cleaner.

      • HtmlDoc.header()
      • HtmlDoc.nav()
      • HtmlDoc.aside()
      • HtmlDoc.footer()
      • HtmlDoc.script()
      • HtmlDoc.style()

      Additionally, the "INHERIT" string literal can be used to combine the value with the value defined on the servlet or parent class. Links can also be inserted at specific index positions.

  • Improvements made to the Widget API.

    • You can now add arbitrary CSS and Javascript along with your widgets through new methods:

      • Widget.getHtml(RestRequest)
      • Widget.getScript(RestRequest)
      • Widget.getStyle(RestRequest)
    • Declaration of widgets moved to @HtmlDoc(widgets) instead of separately on @RestResource and @RestMethod annotations.

    • Widget.getName() now defaults to the simple class name. So now you can just refer to the class name: "$W{ContentTypeMenuItem}".

    • Renamed widgets:

      • PoweredByApacheWidget → PoweredByApache
      • PoweredByJuneauWidget → PoweredByJuneau
    • New MenuItemWidget can be used as a starting point for creating pull-down menu items.

    • New ContentTypeMenuItem widget that provides a pull-down menu with hyperlinks for all supported languages for that page:

      Content Type Menu Item

    • Improved QueryMenuItem widget that provides a pull-down menu of a search/view/order-by/page form:

      Query Menu Item

      Fields are now pre-filled with current query parameters.

    • New ThemeMenuItem widget that provides a pull-down menu with hyperlinks to show the content in the default stylesheets:

      Theme Menu Item

  • New/modified annotations on @HtmlDoc:

    • HtmlDoc.style() - Renamed from css().
    • HtmlDoc.stylesheet() - Renamed from cssUrl(). Can now be a comma-delimited list of URLs.
    • HtmlDoc.script() - Add arbitrary Javascript to page header.
  • Bug fix with @HtmlDoc(nowrap) so that the setting only applies to the data contents, not the whole page.

  • Two convenience methods added to RestRequest:

    • RestRequest.attr(String,Object)
    • RestRequest.prop(String,Object)
  • Annotations added:

    • @RestResource(siteName)
    • @RestResource(flags)
    • @RestMethod(flags)
  • Eliminated the @RestResource(stylesheet) annotation. It's no longer needed now that you can easily specify styles via @HtmlDoc.

  • Eliminated the following annotations since they are now redundant with @HtmlDoc(header):

    • title()
    • description()
    • branding()

    Instead, the BasicRestServlet class defines the following default header that can be easily overridden:

    htmldoc=@HtmlDoc(
    header={
    "<h1>$R{resourceTitle}</h1>",
    "<h2>$R{methodSummary,resourceDescription}</h2>",
    "<a href='http://juneau.apache.org'><img src='$U{servlet:/htdocs/juneau.png}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></a>"
    }
    )

    Note that the subtitle first tries using the method summary and then the servlet description.

  • New FileVar $F variable resolver for resolving the contents of files in the classpath. The DockerRegistryResource examples shows how it can be used to pull in a localized file from the classpath to populate the aside section of a page.

    htmldoc=@HtmlDoc(
    // Pull in aside contents from file.
    aside="$F{resources/DockerRegistryResourceAside.html}"
    )
  • New ReaderResource.toCommentStrippedString() method.

  • The bpIncludes() and bpExcludes() annotations on @RestMethod has been replaced with the following:

    • RestMethod.bpi() - Now an array of simplified values instead of LAX JSON.
    • RestMethod.bpx() - Now an array of simplified values instead of LAX JSON.
  • Two new variables added to $R variable: "$R{servletClass}", "$R{servletClassSimple}"

org.apache.juneau.rest.examples​

  • Added CONTENT-TYPE and STYLES menu items to most pages.

  • Added improved QUERY menu item to PetStore page.

Release 6.3.0​

Date: Jun 30, 2017

Juneau 6.3.0 is a major update with significant new functionality for defining proxy interfaces against arbitrary 3rd-party REST interfaces.

org.apache.juneau​

  • New package: org.apache.juneau.http.

  • Support for dynamic beans. See @BeanProperty(name).

  • New doc: 2.8 - Virtual Beans

  • New doc: 2.13 - Comparison with Jackson

  • All parsers now allow for numeric types with 'K'/'M'/'G' suffixes to represent kilobytes, megabytes, and gigabytes.

    // Example
    int i = JsonParser.DEFAULT.parse("123M"); // 123MB
  • New/modified methods on ConfigFile:

    • ConfigFile.put(String,String,String,boolean)
    • ConfigFile.put(String,String,Object,Serializer,boolean,boolean)
    • ConfigFile.getObject(String,Type,Type...)
    • ConfigFile.getObject(String,Parser,Type,Type...)
    • ConfigFile.getObject(String,Class)
    • ConfigFile.getObject(String,Parser,Class)
    • ConfigFile.getObject(String,String,Type,Type...)
    • ConfigFile.getObject(String,String,Parser,Type,Type...)
    • ConfigFile.getObject(String,String,Class)
    • ConfigFile.getObject(String,String,Parser,Class)
    • ConfigFile.getObjectWithDefault(String,Object,Type,Type...)
    • ConfigFile.getObjectWithDefault(String,Parser,Object,Type,Type...)
    • ConfigFile.getObjectWithDefault(String,Object,Class)
    • ConfigFile.getObjectWithDefault(String,Parser,Object,Class)
  • New ability to interact with config file sections with proxy interfaces with new method ConfigFile.getSectionAsInterface(String,Class).

  • @BeanProperty annotation can now be applied to getters and setters defined on interfaces.

  • New methods on SerializerSession and ParserSession for retrieving context and runtime-override properties:

    • Session.getProperty(String)
    • Session.getProperty(String,String)
    • Session.getProperty(Class,String)
    • Session.getProperty(Class,String,Object)
  • New PartSerializer interface particularly tailored to HTTP headers, query parameters, form-data parameters, and path variables. Allows easy user-defined serialization of these objects. The interface can be used in the following locations:

    • Builder.partSerializer(Class)
    • Path.serializer
    • Query.serializer
    • QueryIfNE.serializer
    • FormData.serializer
    • FormDataIfNE.serializer
    • Header.serializer
    • HeaderIfNE.serializer
  • Across-the-board improvements to the URI-resolution support (i.e. how URIs get serialized).

    • New support for resolving URIs with the following newly-recognized protocols:

      • "context:/..." - Relative to context-root of the application.
      • "servlet:/..." - Relative to the servlet URI.
      • "request:/..." - Relative to the request URI.

      For example, currently we define HTML page links using variables and servlet-relative URIs...

      pages="{up:'$R{requestParentURI}', options:'?method=OPTIONS', upload:'upload'}"

      With these new protocols, we can define them like so:

      links="{top:'context:/', up:'request:/..' ,options:'servlet:/?method=OPTIONS', upload:'servlet:/upload'}"

      The old method of using variables and servlet-relative URIs will still be supported but using these new protocols should (hopefully) be easier to understand. These protocols work on all serialized URL and URI objects, as well as classes and properties annotated with @URI.

    • New classes:

    • New configuration properties:

      • SerializerContext.SERIALIZER_uriContext
      • SerializerContext.SERIALIZER_uriRelativity
      • SerializerContext.SERIALIZER_uriResolution
      • SerializerContext.SERIALIZER_maxIndent
  • New annotation property: @BeanProperty(value). The following two annotations are considered equivalent:

    @BeanProperty(name="foo")

    @BeanProperty("foo")
  • Fixed a race condition in ClassMeta.

  • URLENC_paramFormat has been moved to UonSerializer.UON_paramFormat, and the UON/URL-Encoding serializers will now always serialize all values as plain text. This means that arrays and maps are converted to simple comma-delimited lists.

  • Listener APIs added to serializers and parsers:

  • The BEAN_debug flag will now capture parser input and make it available through the ParserSession.getInputAsString() method so that it can be used in the listeners.

  • Significant new functionality introduced to the HTML serializer. Lots of new options for customizing the HTML output.

    • New @Html(render) annotation and HtmlRender class that allows you to customize the HTML output and CSS style on bean properties:

      HTML Render Example

      Annotation can be applied to POJO classes and bean properties.

    • Several new properties for customizing parts of the HTML page:

      • HtmlDocSerializerContext.HTMLDOC_title
      • HtmlDocSerializerContext.HTMLDOC_description
      • HtmlDocSerializerContext.HTMLDOC_branding
      • HtmlDocSerializerContext.HTMLDOC_header
      • HtmlDocSerializerContext.HTMLDOC_nav
      • HtmlDocSerializerContext.HTMLDOC_aside
      • HtmlDocSerializerContext.HTMLDOC_footer
      • HtmlDocSerializerContext.HTMLDOC_noResultsMessage
      • HtmlDocSerializerContext.HTMLDOC_cssUrl
      • HtmlDocSerializerContext.HTMLDOC_css
      • HtmlDocSerializerContext.HTMLDOC_template
    • New interface HtmlDocTemplate that allows full control over rendering of HTML produced by HtmlDocSerializer.

  • @NameProperty and @ParentProperty can now be applied to fields.

  • New properties on BeanContext:

    • BEAN_includeProperties
    • BEAN_excludeProperties
  • New annotation property: @BeanProperty(format).

org.apache.juneau.rest​

  • MAJOR enhancements made to the REST API.

  • The RestRequest class functionality has been broken up into the following functional pieces to reduce its complexity:

    • RestRequest.getBody() - The request body.
    • RestRequest.getHeaders() - The request headers.
    • RestRequest.getQuery() - The request query parameters.
    • RestRequest.getFormData() - The request form data parameters.
    • RestRequest.getPathMatch() - The path variables and remainder.

    The following classes have been introduced:

    • RequestBody
    • RequestHeaders
    • RequestQuery
    • RequestFormData
    • RequestPath
  • The un-annotated parameter types that can be passed in through REST Java methods has been significantly expanded. For reference, the previous supported types were:

    • RestRequest - The request object.
    • javax.servlet.http.HttpServletRequest - The superclass of RestRequest.
    • RestResponse - The response object.
    • javax.servlet.http.HttpServletResponse - The superclass of RestResponse.

    The new supported types are:

    • Accept
    • AcceptCharset
    • AcceptEncoding
    • AcceptLanguage
    • Authorization
    • CacheControl
    • Connection
    • ContentLength
    • ContentType
    • Date
    • Expect
    • From
    • Host
    • IfMatch
    • IfModifiedSince
    • IfNoneMatch
    • IfRange
    • IfUnmodifiedSince
    • MaxForwards
    • Pragma
    • ProxyAuthorization
    • Range
    • Referer
    • TE
    • UserAgent
    • Upgrade
    • Via
    • Warning
    • TimeZone
    • InputStream
    • javax.servlet.ServletInputStream
    • Reader
    • OutputStream
    • javax.servlet.ServletOutputStream
    • Writer
    • ResourceBundle - Client-localized resource bundle.
    • MessageBundle - A resource bundle with additional features.
    • Locale - Client locale.
    • RequestHeaders - API for accessing request headers.
    • RequestQuery - API for accessing request query parameters.
    • RequestFormData - API for accessing request form data.
    • RequestPath - API for accessing path variables.
    • RequestBody - API for accessing request body.
    • HttpMethod - The method name matched (when using @RestMethod(name="*"))
    • Logger - The logger to use for logging.
    • JuneauLogger - Logger with additional features.
    • RestContext - The resource read-only context.
    • Parser - The parser matching the request content type.
    • Swagger - The auto-generated Swagger doc.
    • ConfigFile - The external config file for the resource.

    So, for example...

    /** Old way */ 
    @RestMethod(name="*", path="/example1/{a1}/{a2}/{a3}/*")
    public String example1(
    @Method String method,
    @Path("a1") String a1,
    @Path("a2") int a2,
    @Path("a3") UUID a3,
    @Query("p1") int p1,
    @Query("p2") String p2,
    @Query("p3") UUID p3,
    @Header("Accept-Language") String lang,
    @Header("Accept") String accept
    )

    /** New way */
    @RestMethod(name="*", path="/example2/{a1}/{a2}/{a3}/*")
    public String example2(
    HttpMethod httpMethod,
    RequestPathParams pathParams,
    RequestQuery query,
    AcceptLanguage acceptLanguage,
    Accept accept
    )
  • A new annotation @RestResource(paramResolvers) that allows you to define your own custom Java method parameter resolvers.

  • Fixed bug where Writer returned by RestResponse.getWriter() was not being flushed automatically at the end of the HTTP call.

  • New annotations added to @RestMethod:

    • RestMethod.defaultQuery()
    • RestMethod.defaultFormData()
    • bpIncludes()
    • bpExcludes()
  • Default values on header, query, and form-data annotations:

    • @Header(def) - Default header value.
    • @Query(def) - Default query parameter value.
    • @FormData(def) - Default form data parameter value.
  • New attributes on @RestResource:

    • serializerListener()
    • parserListener()
    • widgets()
    • swagger()
    • htmldoc()
  • New attributes on @RestMethod:

    • widgets()
    • RestMethod.swagger()
    • RestMethod.htmldoc()
  • New string vars:

    • UrlVar - Resolve "$U{...}" variables to URLs.
    • WidgetVar - Resolve "$W{...}" variables to widget contents.
  • New methods on RestConfig:

    • setHtmlTitle(String)
    • setHtmlDescription(String)
    • setHtmlBranding(String)
    • setHtmlHeader(String)
    • setHtmlLinks(String)
    • setHtmlNav(String)
    • setHtmlAside(String)
    • setHtmlFooter(String)
    • setHtmlCss(String)
    • setHtmlCssUrl(String)
    • setHtmlNoWrap(boolean)
    • setHtmlNoResultsMessage(String)
    • setHtmlTemplate(Class)
    • setHtmlTemplate(HtmlDocTemplate)
    • addWidget(Class)
  • New methods on RestResponse:

    • setHtmlTitle(Object)
    • setHtmlDescription(Object)
    • setHtmlBranding(Object)
    • setHtmlHeader(Object)
    • setHtmlLinks(Object)
    • setHtmlNav(Object)
    • setHtmlAside(Object)
    • setHtmlFooter(Object)
    • setHtmlCss(Object)
    • setHtmlCssUrl(Object)
    • setHtmlNoWrap(boolean)
    • setHtmlNoResultsMessage(Object)
    • setHtmlTemplate(Class)
    • setHtmlTemplate(HtmlDocTemplate)
  • &plainText=true parameter now works on byte-based serializers by converting the output to hex.

  • New classes for widget support:

    • Widget
    • PoweredByJuneauWidget
    • ContentTypeLinksColumnWidget
    • ContentTypeLinksRowWidget
    • QueryWidget
  • devops.css cleaned up.

  • Removed a bunch of URL-related methods from RestRequest. These all have equivalents in RestRequest.getUriContext().

  • New annotation attributes:

org.apache.juneau.rest.client​

  • New Path annotation for specifying path variables on remoteable interfaces.

  • New @RequestBean annotation for specifying beans with remoteable annotations defined on properties.

  • The following annotations (and related methods on RestCall) can now take NameValuePairs and beans as input when using "*" as the name. FormData, FormDataIfNE, Query, QueryIfNE, Header, HeaderIfNE

org.apache.juneau.microservice​

No changes listed in this release.

org.apache.juneau.examples.rest​

  • Many code enhancements made to examples to reflect new functionality.

  • All pages now render aside comments to help explain what feature they're trying to explain using the new features that allow you to customize various elements of the page.

    Release Notes 6.3.0 Example

Release 6.2.0​

Date: Apr 28, 2017

Juneau 6.2.0 is a major update.

org.apache.juneau​

  • Revamped the serializer, parser classes to use builders for creation. Serializers and parsers are now unmodifiable objects once they are created. This is a breaking code change that will require adoption.

    /* Creating a new serializer or parser */ 

    // Old way
    WriterSerializer s = new JsonSerializer().setUseWhitespace(true).pojoSwaps(BSwap.class).lock();

    // New way
    WriterSerializer s = JsonSerializer.create().ws().pojoSwaps(BSwap.class).build();

    /* Cloning an existing serializer or parser */

    // Old way
    WriterSerializer s = SimpleJsonSerializer.DEFAULT
    .clone().setUseWhitespace(true).pojoSwaps(BSwap.class).lock();

    // New way
    WriterSerializer s = SimpleJsonSerializer.DEFAULT
    .builder().ws().pojoSwaps(BSwap.class).build();
  • Also introduced the following builder classes and related architecture changes to make the built objects unmodifiable:

    • SerializerGroup.Builder
    • ParserGroup.Builder
    • EncoderGroup.Builder
  • Revamped the config file API to use a builder: ConfigFileBuilder.

  • Removed the Lockable interface.

  • New addBeanTypeProperties setting added to serializers to override the SerializerContext.SERIALIZER_addBeanTypeProperties setting for individual serializers in a serializer group:

    • HtmlSerializerContext.HTML_addBeanTypeProperties
    • JsonSerializerContext.JSON_addBeanTypeProperties
    • MsgPackSerializerContext.MSGPACK_addBeanTypeProperties
    • UonSerializerContext.UON_addBeanTypeProperties
    • XmlSerializerContext.XML_addBeanTypeProperties
    • RdfSerializerContext.RDF_addBeanTypeProperties
  • UON notation serializers and parsers moved into the new org.apache.juneau.uon package.

  • New XmlFormat.VOID format to identify HTML void elements.

  • Tweaks to HTML5 support.

    • Fixed handling of empty non-void elements in HTML serializer.
    • Added style() override methods to all elements.
  • Improvements to Swagger support.

    • New SwaggerBuilder class.
    • Fluent-style setters added to the Swagger beans.
    • Added Swagger examples here and in the swagger javadocs.
  • Improvements to VarResolver.

    • New IfVar $IF variable for if-else block logic.
    • $SWITCH variable for switch block logic.
    • Whitespace wasn't being ignored in some cases.
  • HtmlParser can now parse full body contents generated by HtmlDocSerializer.

  • Parse-args supported added to MsgPackParser to allow it to be used in remoteable proxies.

  • Added some convenience classes for constructing collections using a fluent interface:

    • AList
    • ASet
    • AMap
  • New @Bean(typePropertyName) annotation allows you to specify the name of the "_type" property at the class level.

  • New methods added to HTML5 container beans:

  • New common serializer setting: SerializerContext.SERIALIZER_abridged.

  • Support for defining interface proxies against 3rd-party REST interfaces. New package remoteable for all remoteable proxy interface annotations. @Remoteable annotation has been moved to this package.

  • Updated doc: 6 - Remoteable Services

  • New doc: 6.1 - Interface proxies against 3rd-party REST interfaces

  • New URL-encoding serializer setting: UrlEncodingSerializerContext.URLENC_paramFormat.

  • New methods on UrlEncodingSerializer.Builder:

    • Builder.paramFormat(String)
    • Builder.plainTextParams()

org.apache.juneau.rest​

  • @RestResource annotation can now be applied to any class! You're no longer restricted to subclassing your resources from RestServlet. This is a major enhancement in the API. Anything you could do by subclassing from RestServlet should have an equivalent for non-RestServlet classes. The only restriction is that the top-level resource must subclass from RestServlet. Child resources do not.

    The majority of code has been split up into two separate classes:

    • RestConfig - A modifiable configuration of a resource. Subclasses from javax.servlet.ServletConfig.
    • RestContext - A read-only configuration that's the result of a snapshot of the config.

    The RestServlet class now has the following initialization method that allows you to override the config settings define via annotations:

    • RestServlet.init(RestConfig) - A modifiable configuration of a resource.

    Non-RestServlet classes must have one of the following to allow it to be instantiated:

    • A public T(RestConfig) constructor.
    • A public T() constructor.
    • The parent resource must have a customized RestResourceResolver for instantiating it.

    Non-RestServlet classes can optionally include the following init methods to gain access to the config and context:

    • public init(RestConfig)
    • public init(RestContext)
  • New annotations added to @RestResource to allow non-RestServlet resources to do the same as subclassing directly from RestServlet:

    • RestResource.resourceResolver() - Specify a RestResourceResolver class for resolving child resources.
    • RestResource.callHandler() - Specify a RestCallHandler class for handling the lifecycle of a REST call.
    • RestResource.infoProvider() - Specify a RestInfoProvider class for customizing title/description/Swagger information on a REST resource.
    • RestResource.logger() - Specify a RestLogger class for handling logging.
  • New annotations added to @RestResource and @RestMethod to simplify defining page title, text, and links on HTML views:

    • @RestResource(pageTitle)
    • @RestMethod(pageTitle)
    • @RestResource(pageText)
    • @RestMethod(pageText)
    • @RestResource(pageLinks)
    • @RestMethod(pageLinks)
    // Old method
    @RestResource(
    properties={
    @Property(name=HTMLDOC_title, value="System properties resource"),
    @Property(name=HTMLDOC_description, value="REST interface for performing CRUD operations on system properties."),
    @Property(name=HTMLDOC_navlinks, value="{up:'$R{requestParentURI}',options:'?method=OPTIONS'}")
    }
    )

    // New method
    @RestResource(
    pageTitle="System properties resource",
    pageDescription="REST interface for performing CRUD operations on system properties.",
    pageLinks="{up:'$R{requestParentURI}',options:'?method=OPTIONS'}"
    )

    Typically you're going to simply want to use the title and description annotations which apply to both the page title/text and the swagger doc:

    @RestResource(
    title="System properties resource",
    description="REST interface for performing CRUD operations on system properties.",
    pageLinks="{up:'$R{requestParentURI}',options:'?method=OPTIONS'}"
    )
  • RestResource.stylesheet() can now take in a comma-delimited list of stylesheet paths.

  • StreamResource can now contain multiple sources from a variety of source types (e.g. byte[] arrays, InputStreams, Files, etc...) and is now immutable. It also includes a new StreamResourceBuilder class.

  • Simplified remoteable proxies using the @RestMethod(name="PROXY") annotation on REST methods. Used to expose interface proxies without the need for RemoteableServlet.

    // Server side
    @RestMethod(name="PROXY", path="/myproxy/*")
    public IAddressBook getProxy() {
    return addressBook;
    }

    // Client side
    RestClient client = RestClient.create().rootUrl(samplesUrl).build();
    IAddressBook ab = client.getRemoteableProxy(IAddressBook.class, "/addressBook/myproxy");

    See @RestMethod(name) for more information.

  • RestRequest.toString() can be called at any time to view the headers and content of the request without affecting functionality. Very useful for debugging.

  • @RestMethod(name) annotation is now optional. Defaults to "GET".

org.apache.juneau.rest.client​

  • Revamped the client API to use builders.

  • New doc: 1.5 - Debugging

  • The RestClient class doX(Object url) methods now handle HttpClient URIBuilder instances.

  • New methods added/updated to RestClient:

    • RestClient.getRemoteableProxy(Class,Object) - For interface proxies defined using @RestMethod(name="PROXY").
    • RestClient.getRemoteableProxy(Class,Object,Serializer,Parser) - Same as above but overrides the serializer and parser defined on the client.
    • RestClient.doPost(Object)
    • RestClient.doCall(HttpMethod,Object,Object) - Can now pass in instances of NameValuePairs for easy form posts. This extends to all methods that take in the input.
  • New methods on RestCall:

    • RestCall.uri(Object)
    • query(String,Object,boolean,PartSerializer)
    • RestCall.query(String,Object)
    • RestCall.queryIfNE(String,Object)
    • RestCall.query(Map)
    • RestCall.queryIfNE(Map)
    • RestCall.query(String)
    • formData(String,Object,boolean,PartSerializer)
    • RestCall.formData(String,Object)
    • RestCall.formDataIfNE(String,Object)
    • RestCall.formData(Map)
    • RestCall.formDataIfNE(Map)
    • header(String,Object,boolean,PartSerializer)
    • RestCall.header(String,Object)
    • RestCall.headerIfNE(String,Object)
    • RestCall.headers(Map)
    • RestCall.headersIfNE(Map)
    • RestCall.host(String)
    • RestCall.port(int)
    • RestCall.userInfo(String,String)
    • RestCall.userInfo(String)
    • RestCall.scheme(String)
  • New methods added to RestClient.Builder:

    • executorService(ExecutorService,boolean)
    • Builder.paramFormat(String)
    • Builder.plainTextParams()
    • noTrace() - Adds a No-Trace: true header on all requests to prevent the servlet from logging errors. Useful for testing scenarios when you don't want the console to end up showing errors done on purpose.
    • debug() now adds a Debug: true header on all requests.
  • New methods added/updated to RestCall:

    • RestCall.runFuture()

    • RestCall.getResponseFuture(Class)

    • RestCall.getResponseFuture(Type,Type...)

    • RestCall.getResponseAsStringFuture()

    • RestCall.serializer(Serializer) - Override the serializer defined on the client for a single call.

    • RestCall.parser(Parser) - Override the parser defined on the client for a single call.

    • input(Object) - Now accepts instances of NameValuePairs.

    • RestCall.getResponse(Class) - Can now pass in any of the following:

      • HttpResponse - Returns the raw HttpResponse returned by the inner HttpClient.
      • Reader - Returns access to the raw reader of the response.
      • InputStream - Returns access to the raw input stream of the response.
  • New methods added to NameValuePairs:

    • NameValuePairs.append(String,Object)
    • append(String,Object,PartSerializer)
  • RetryOn is now an abstract class with an additional method:

  • RetryOn.onResponse(HttpResponse)

org.apache.juneau.microservice​

  • "REST/port" configuration setting can now be a comma-limited list of port numbers to try. You can also specify one or more 0s to try a random port.

  • Methods added to RestMicroservice class:

    • getPort()
    • getURI()
    • Override methods added from Microservice class for easier method chaining.

Release 6.1.0​

Date: Feb 25, 2017

Juneau 6.1.0 is a major update.

In particular, this release cleans up the BeanContext API to match the PropertyStore/Context/ Session paradigm previously used in the serializer and parser APIs. It also makes several improvements to the HTML and XML serialization support and introduces HTML5 DTO beans.

org.apache.juneau​

  • Improvements to XML serialization support.

    • New supported XML formats:

      • XmlFormat.ATTRS format can now be applied to bean classes to have all bean properties serialized as attributes instead of elements by default.
      • XmlFormat.ELEMENT format can now be applied to bean properties to override the XmlFormat.ATTRS setting above on specific bean properties.
      • New XmlFormat.ELEMENTS format can be applied to a bean property of type array/Collection to represent the child elements.
      • New XmlFormat.MIXED format can be applied to a bean property of type array/Collection to represent mixed content (text + child elements).
      • New XmlFormat.MIXED_PWS format. Identical to MIXED except preserves whitespace.
      • New XmlFormat.TEXT format can be applied to a bean property of a single object to represent a text node as a child.
      • New XmlFormat.TEXT_PWS format. Identical to TEXT except preserves whitespace.
      • New XmlFormat.XMLTEXT format that's identical to XmlFormat.TEXT except XML content is not escaped and serialized directly as the child content. The parser will reconvert this to the original XML text during parsing.
    • New support methodology and other improvements to xml documentation.

    • Eliminated unnecessary <string> elements.

    • Eliminated XmlContentHandler class.

    • Parser efficiency improvements through reuse of string builders.

    • Reworked and simplified the default XML serializers. The XmlSerializer.DEFAULT serializer now has namespaces disabled, and XmlSerializer.DEFAULT_NS has namespaces enabled. The 'XML-JSON' serializers have been eliminated.

    • Eliminated the addJsonTypeAttrs and addJsonStringTypeAttrs settings.

    • Namespace support is now disabled by default.

  • Significant modifications and improvements to HTML serialization support.

    • Parser converted from XMLEventReader-based to XMLStreamReader.
    • Eliminated many unnecessary type tags and <string> elements and improved the readable layout. The new format is much leaner.
    • New exhaustive support methodology section added to html documentation.
  • New HTML5 DTO support: html5.

  • BeanContext class split into separate BeanContext and BeanSession classes.

    • Session object meant to be single-use that can be discarded after use and contains session-level object cache and overridable Locale and TimeZone.
  • SerializerContext and ParserContext now extend directly from BeanContext.

  • SerializerSession and ParserSession now extend directly from BeanSession.

  • New settings in BeanContext:

    • BEAN_debug - Debug setting. Replaces individual debug properties in the serializer and parser contexts.
    • BEAN_locale - Specifies a default locale at the context level.
    • BEAN_timeZone - Specifies a default timezone at the context level.
    • BEAN_mediaType - Specifies a default media type at the context level.
  • Improvements to Parser class:

    • Simplified the parse methods (e.g. parseMap(), parseCollection()) by replacing them with two simple methods:

      Using these methods, you can construct arbitrarily complex objects consisting of maps and collections. You could do this before but it required constructing a ClassMeta object.

      For example:

      // Old way:
      ClassMeta<?> cm = parser.getMapClassMeta(
      HashMap.class,
      String.class,
      parser.getCollectionClassMeta(
      LinkedList.class,
      MyBean.class
      )
      );
      Map<String,List<MyBean>> map = (Map<String,List<MyBean>>)parser.parse(input, cm);

      // New way:
      Map<String,List<MyBean>> map = parser.parse(input, HashMap.class, String.class, LinkedList.class, MyBean.class);
    • Arbitrarily-complex parameterized maps and collections can now be parsed without the need for creating intermediate ClassMeta objects.

    • No need for casting anymore if you were using the old parseMap() and parseCollection() methods!

    • Changes allow me to eliminate BeanContext.normalizeClassMeta() method.

    • Convenience methods added for setting parser properties:

      // Old way:
      new JsonParser().setProperty(PARSER_strict, true).setProperty(BEAN_locale, mylocale);

      // New way:
      new JsonParser().setStrict(true).setLocale(mylocale);
  • Improvements to Serializer class:

    • Convenience methods added for setting serializer properties:

      // Old way:
      new JsonSerializer().setProperty(JSON_simpleMode, true).setProperty(SERIALIZER_quoteChar, '"');

      // New way:
      new JsonSerializer().setSimpleMode(true).setQuoteChar('"');
  • Simplified PojoSwap class. Now just two methods:

    • PojoSwap.swap(BeanSession,Object)
    • PojoSwap.unswap(BeanSession,Object,ClassMeta)
  • General code improvements made to ClassMeta class.

    • All fields are now final which should improve overall performance.
    • Replaced support for toObjectMap() and fromObjectMap()/T(ObjectMap) methods with generalized swap(BeanSession)/unswap(BeanSession,X)/T(BeanSession,X) methods. See new section Swap methods for information.
  • Session-level media type now available through BeanSession.getMediaType() method. Allows for swaps and serializer/parser behavior to be tailored to individual media types.

  • Several new Calendar and Date swaps:

    • ToString, ToString - To Strings using the Date.toString() method.
    • ISO8601DT, ISO8601DT - To ISO8601 date-time strings.
    • ISO8601DTZ, ISO8601DTZ - Same as ISO8601DT, except always serializes in GMT.
    • ISO8601DTP, ISO8601DTP - Same as ISO8601DT except with millisecond precision.
    • ISO8601DTPZ, ISO8601DTPZ - Same as ISO8601DTZ except with millisecond precision.
    • RFC2822DT, RFC2822DT - To RFC2822 date-time strings.
    • RFC2822DTZ, RFC2822DTZ - Same as RFC2822DT, except always serializes in GMT.
    • RFC2822D, RFC2822D - To RFC2822 date strings.
    • DateTimeSimple, DateTimeSimple - To simple "yyyy/MM/dd HH:mm:ss" date-time strings.
    • DateSimple, DateSimple - To simple "yyyy/MM/dd" date strings.
    • TimeSimple, TimeSimple - To simple "HH:mm:ss" time strings.
    • DateFull, DateFull - To DateFormat.FULL date strings.
    • DateLong, DateLong - To DateFormat.LONG date strings.
    • DateMedium, DateMedium - To DateFormat.MEDIUM date strings.
    • DateShort, DateShort - To DateFormat.SHORT date strings.
    • TimeFull, TimeFull - To DateFormat.FULL time strings.
    • TimeLong, TimeLong - To DateFormat.LONG time strings.
    • TimeMedium, TimeMedium - To DateFormat.MEDIUM time strings.
    • TimeShort, TimeShort - To DateFormat.SHORT time strings.
    • DateTimeFull, DateTimeFull - To DateFormat.FULL date-time strings.
    • DateTimeLong, DateTimeLong - To DateFormat.LONG date-time strings.
    • DateTimeMedium, DateTimeMedium - To DateFormat.MEDIUM date-time strings.
    • DateTimeShort, DateTimeShort - To DateFormat.SHORT date-time strings.
  • New method SerializerGroup.getSerializerMatch(String) that returns the matched serializer and media type.

  • New method ParserGroup.getParserMatch(String) that returns the matched parser and media type.

  • New method EncoderGroup.getEncoderMatch(String) that returns the matched encoder and encoding.

  • General improvements to Bean Dictionary support.

    • New BeanDictionaryList class can be used for defining reusable sets of bean dictionaries consisting of classes annotated with @Bean(typeName).
    • New BeanDictionaryMap class can be used for defining reusable sets of bean dictionaries consisting of classes not annotated with @Bean(typeName).
    • New @Bean(beanDictionary) annotation.
  • Removed restriction on getters and setters to be prefixed with "getX/setX/isX" if a @BeanProperty(name) annotation is used.

  • Improvements to ATOM DTO:

    • New AtomBuilder class.
    • New setter method names for a better fluent design.
    • Updated atom documentation.
  • New MapSwap and StringSwap classes.

  • New WriterSerializer.println(Object) method. Useful for debugging purposes.

  • New BeanContext.getClassMeta(Type,Type...) and BeanSession.getClassMeta(Type,Type...) methods for retrieving Map and Collection class metas. Replaces the various getMapClassMeta()/getCollectionClassMeta() methods.

  • New section added to this document: Juneau Data Transfer Objects (org.apache.juneau.dto)

  • Modified the UON specification to work with mixed content.

    • The new specification is considerably cleaner and eliminates the need for separate normal/simple modes. It also allows for arbitrary whitespace to be added to the output without any confusion.
    • Eliminated the UonParser.DEFAULT_WS_AWARE and UrlEncodingParser.DEFAULT_WS_AWARE parsers. The normal UonParser.DEFAULT and UrlEncodingParser.DEFAULT parsers will now handle whitespace.
    • Eliminated the UonParserContext.UON_whitespaceAware configuration setting.
    • Eliminated the UonSerializer.DEFAULT_SIMPLE, UonSerializer.DEFAULT_SIMPLE_ENCODING and UrlEncodingSerializer.DEFAULT_SIMPLE serializers since there is no separate simple mode anymore.
    • Eliminated the UonParserContext.UON_simpleMode configuration setting.
  • Added new OutputStreamSerializer.serializeToHex(Object) method. Useful mostly for testing purposes. Equivalently, the InputStreamParser.parse(Object,Class) method can now read the output from this method.

  • Eliminated the @Bean(subTypeProperty) and @Bean(subTypes) annotations and replaced them with the ability to define subtypes using the existing @Bean(beanDictionary) annotation on parent classes and interfaces. This has the added benefit of simplifying the overall code.

  • The SerializerContext.SERIALIZER_addBeanTypeProperties setting is now enabled by default.

  • Combined the SERIALIZER_addIndentation/JSON_addWhitespace/UON_addWhitespace properties into a single SerializerContext.SERIALIZER_useWhitespace setting.

org.apache.juneau.rest​

  • RestRequest now passes locale and timezone to serializers/parsers/transforms.

  • RestRequest.getTimeZone() method.

  • Standardized the following methods in RestRequest to remove dependency on ClassMeta objects and eliminate the need for casts:

    • RestRequest.getHeader(String,Class)
    • RestRequest.getHeader(String,Object,Class)
    • RestRequest.getHeader(String,Type,Type...)
    • RestRequest.getQueryParameter(String,Class)
    • RestRequest.getQueryParameter(String,Object,Class)
    • RestRequest.getQueryParameter(String,Type,Type...)
    • RestRequest.getQueryParameter(String,Object,Type,Type...)
    • RestRequest.getQueryParameters(String,Class)
    • RestRequest.getQueryParameters(String,Type,Type...)
    • RestRequest.getFormDataParameter(String,Class)
    • RestRequest.getFormDataParameter(String,Object,Class)
    • RestRequest.getFormDataParameters(String,Class)
    • RestRequest.getFormDataParameter(String,Type,Type...)
    • RestRequest.getFormDataParameters(String,Type,Type...)
    • RestRequest.getPathParameter(String,Class)
    • RestRequest.getPathParameter(String,Type,Type...)
    • RestRequest.getBody(Class)
    • RestRequest.getBody(Type,Type...)
  • New methods on NameValuePairs

  • Fixed issue where whitespace was not added to UON/URL-Encoding output when &plainText=true specified.

Release 6.0.1​

Date: Jan 3, 2017

Juneau 6.0.1 is a minor update.

org.apache.juneau​

  • General improvements to JSON parser.

    • Several fixes to handle obscure edge cases.
  • New properties in ParserContext.

    • ParserContext.PARSER_strict
    • ParserContext.PARSER_inputStreamCharset
    • ParserContext.PARSER_fileCharset
  • Removed JsonParserContext.JSON_strictMode. Replaced by PARSER_strict.

  • byte[] arrays can now be passed to Parser.parse(Object,Class) for reader-based parsers.

Release 6.0.0​

Date: Oct 3, 2016

Juneau 6.0.0 is a major update.

The major change is rebranding from "Juno" to "Juneau" in preparation for donation to the Apache Foundation.

org.apache.juneau​

  • Major changes around how serializer and parser class properties are defined to improve performance and concurrency.

    • New PropertyStore class - Used for creating context objects.
    • New Context class - Read-only configurations for serializers and parsers.
    • New Session class - One-time use objects used by serializers and parsers.
    • All context context properties can now also be specified via system properties.
  • Refactored serializer and parser APIs for more consistency between stream-based and character-based serializers and parsers.

    • More consistent handling of exceptions.
    • More consistent method declarations.
  • Refactored var resolver API and added them to a new package - org.apache.juneau.svl.

    • Support for stream-based variables - StreamedVar.
    • Added support for context and session objects.
  • Eliminated "_class" properties and replaced them with "_type" properties. The class properties were a little-used feature where we would serialize fully-qualified class names when the class type could not be inferred through reflection. It's been replaced with bean type names and bean dictionaries. Instead of class names, we serialize "_type" properties whose name is the type name defined on the bean being serialized. The parsers use a 'dictionary' of bean classes to resolve those names to actual bean classes. The following features were added to enable this support:

    • @Bean(typeName) - Annotation that defines an identifying name for a bean class.
    • BeanFilterBuilder.typeName(String) - Programmatic equivalent to annotation above.
    • BeanContext.BEAN_beanDictionary - List of bean classes that make up the bean dictionary for lookup during parsing.
    • BEAN_beanTypePropertyName - The overridable type property name. Default is "_type".
    • @BeanProperty(beanDictionary) - Define a type dictionary for a particular bean property value. This overrides the value specified using BeanContext.BEAN_beanDictionary.
    • SerializerContext.SERIALIZER_addBeanTypeProperties - Controls whether type properties are serialized.

    In addition, the @Bean(typeName) value replaces the @Xml(name) annotation, and the "type" and "_class" attributes in the XML and HTML serializers have been standardized on a single "_type" attribute.

  • Refactor bean filter support to use BeanFilterBuilder class. Allows the BeanFilter class to use final fields.

  • MessagePack support.

  • Serializers can now serialize directly to Files. See Serializer.serialize(Object,Object)

  • Parsers can now parse directly from Files and other types. See Parser.parse(Object,ClassMeta)

  • Parsers will automatically covert numeric input to POJOs that have numeric constructors (e.g. java.util.Date).

  • Renamed 'Filters' to 'BeanFilters' and 'PojoSwaps'. Filters is just too overloaded a term.

  • Internal utility classes moved to a new org.apache.juneau.internal package. These internal utility classes are not meant for consumption outside the Juneau codebase.

  • New methods on Parser:

    • org.apache.juneau.parser.Parser.createSession(ObjectMap,Method,Object)
    • Parser.getMediaRanges()
  • New methods on Serializer:

    • org.apache.juneau.serializer.Serializer.createSession(ObjectMap,Method)
    • Serializer.getMediaRanges()
  • New @Bean(sort) annotation.

  • Added @Bean.properties annotations on various DTO beans to make the ordering consistent between IBM and Oracle JVMs. IBM JVMs maintain the order of methods in a class, whereas Oracle JVMs do not.

  • Serializers and parsers now automatically convert Class objects to readable names via ClassUtils.getReadableClassName(Class).

  • Eliminated the ClassFilter class since it's no longer needed.

  • Code and concurrency improvements to SerializerGroup and ParserGroup.

  • Various enhancements to BeanContext.convertToType(Object,Class).

  • New properties on HtmlSerializer:

    • HtmlSerializerContext.HTML_detectLinksInStrings - Automatically detect hyperlinks in strings.
    • HtmlSerializerContext.HTML_lookForLabelParameters - Specify anchor text by appending &label=MyLabel to URL.
    • HtmlSerializerContext.HTML_labelParameter - Specify what URL parameter to use as the anchor text label.
    • HtmlSerializerContext.URI_ANCHOR option for HtmlSerializerContext.HTML_uriAnchorText.
  • Removed generics from BeanPropertyMeta.

  • Introduced new classes to eliminate the references to language-specific metadata in the core metadata classes:

    • ClassMetaExtended / ClassMeta.getExtendedMeta(Class)
    • BeanMetaExtended / BeanMeta.getExtendedMeta(Class)
    • BeanPropertyMetaExtended / BeanPropertyMeta.getExtendedMeta(Class)
  • Renamed @Transform annotation to @Pojo so that it can be used for various POJO-related behavior, not just associating transforms.

  • Introduced Swagger DTOs.

org.apache.juneau.rest​

  • OPTIONS pages replaced with Swagger documents. Lots of changes related to supporting Swagger.

    • Annotation name changes to conform to Swagger specs: @Attr→@Path, @QParam→@Query, @Param→@FormData, @Content→@Body

    • Eliminated ResourceOptions and related code.

    • New annotations and related methods:

      • @RestResource(title) / RestInfoProvider.getTitle(RestRequest)
      • @RestResource(description) / RestInfoProvider.getDescription(RestRequest)
      • @RestResource(termsOfService) / RestInfoProvider.getTermsOfService(RestRequest)
      • @RestResource(contact) / RestInfoProvider.getContact(RestRequest)
      • @RestResource(license) / RestInfoProvider.getLicense(RestRequest)
      • @RestResource(version) / RestInfoProvider.getVersion(RestRequest)
      • @RestResource(tags) / RestInfoProvider.getTags(RestRequest)
      • @RestResource(externalDocs) / RestInfoProvider.getExternalDocs(RestRequest)
      • @RestMethod(summary) / ~~ RestInfoProvider.getMethodSummary(String,RestRequest)~~
      • @RestMethod(description) / RestInfoProvider.getMethodDescription(String,RestRequest)
      • @RestMethod(externalDocs)
      • @RestMethod(tags)
      • @RestMethod(deprecated)
      • @RestMethod(parameters)
      • @RestMethod(responses)
  • New RestServletContext.paramFormat context property.

  • New/updated methods on RestServlet:

    • RestServlet.createProperties()
    • RestServlet.createBeanContext(ObjectMap,Class[],Class[])
    • RestServlet.createBeanFilters()
    • RestServlet.createPojoSwaps()
    • RestServlet.createParsers(ObjectMap,Class[],Class[])
    • RestServlet.createUrlEncodingSerializer(ObjectMap,Class[],Class[])
    • RestServlet.createUrlEncodingParser(ObjectMap,Class[],Class[])
    • RestServlet.createConverters(ObjectMap)
    • RestServlet.createDefaultRequestHeaders(ObjectMap)
    • RestServlet.createDefaultResponseHeaders(ObjectMap)
    • RestServlet.createEncoders(ObjectMap)
    • RestServlet.createGuards(ObjectMap)
    • RestServlet.createMimetypesFileTypeMap(ObjectMap)
    • RestServlet.createResponseHandlers(ObjectMap)
  • New client-version annotations:

    • RestResource.clientVersionHeader - The name of the header used to identify the client version.
    • RestMethod.clientVersion - The client version range applied to a Java method.

org.apache.juneau.rest.client​

  • Removed the JazzRestClient class.

  • New method RestClient.setClientVersion(String).