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":
| Category | Maven Artifacts | Description | Prereqs |
|---|---|---|---|
| Juneau Core | juneau-marshall | Serializers 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-marshall | Serializers and parsers for: RDF/XML, RDF/XML-Abbrev, N-Triple, Turtle, N3 | Java 6, Apache Jena 2.7.1 | |
juneau-dto | Data Transfer Objects for: HTML5, Atom, Cognos, JSON-Schema, Swagger 2.0 | Java 6 | |
juneau-svl | Simple Variable Language API | Java 6 | |
juneau-config | Configuration file API | Java 6 | |
| Juneau REST | juneau-rest-server | REST Servlet API | Java 6, Servlet 3.1 |
juneau-rest-server-jaxrs | Optional JAX-RS support | Java 6, JAX-RS 2.0 | |
juneau-rest-client | REST Client API | Java 6, Apache HttpClient 4.5 | |
| Juneau Microservice | juneau-microservice-server | REST Microservice Server API | Java 8, Eclipse Jetty 9.4.3 |
juneau-microservice-template | Developer template project | Java 8, Eclipse Jetty 9.4.3 | |
| Examples | juneau-examples-core | Core code examples | |
juneau-examples-rest | REST code examples | ||
| Juneau All | juneau-all | Combination of: juneau-marshall, juneau-dto, juneau-svl, juneau-config, juneau-rest-server, juneau-rest-client | Java 6, Servlet 3.1, Apache HttpClient 4.5 |
juneau-marshall
-
Improvements to swap support.
-
New @Swap annotation. Replaces the
@Pojoand@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
@Swapsannotation 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
Surrogateinterface 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)andPojoSwap.unswap(BeanSession,Object,ClassMeta)can now throw arbitrary exceptions instead of having to wrap them inSerializeException/ParseException. -
New
CalendarUtilsclass that encapsulates serialization/parsing logic fromCalendarSwapandDateSwap. -
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
@Consumesand@Producesannotations. 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 togetClass()to retrieve the annotation value could not be called before calling thesuper()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 HTML5Form.toString()produces HTML.
juneau-rest-server
-
Revamped and simplified servlet and REST-call lifecycle handling through new
@RestHookannotation.-
The
RestServlet.init(ServletConfig)method is now final and can no longer be extended. Instead, useHookEvent.INITorHookEvent.POST_INITfor initialization. -
The following methods on
RestServlethave been removed:init(RestConfig)- UseHookEvent.INITinstead.onSuccess(RestRequest, RestResponse, long)- UseHookEvent.END_CALLinstead.onPreCall(RestRequest)- UseHookEvent.PRE_CALLinstead.onPostCall(RestRequest, RestResponse)- UseHookEvent.POST_CALLinstead.
-
-
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. -
RestResourceResolverinstances 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 theRestContext.REST_allowHeaderParamssetting.allowMethodParam()- Replaces theRestContext.REST_allowMethodParamsetting.allowBodyParam()- Replaces theRestContext.REST_allowBodyParamsetting.renderResponseStackTraces()- Replaces theRestContext.REST_xxxsetting.useStackTraceHashes()- Replaces theRestContext.REST_useStackTraceHashessetting.defaultCharset()- Replaces theRestContext.REST_defaultCharsetsetting.paramFormat()- Replaces theRestContext.REST_paramFormatsetting.
-
New annotations on
@RestMethod:RestMethod.defaultCharset()- Replaces theRestContext.REST_defaultCharsetsetting.RestMethod.paramFormat()- Replaces theRestContext.REST_paramFormatsetting.
-
The following implementation classes can now be defined as non-static inner classes of servlets/resources:
- Widget
RestConverterRestGuardResponseHandlerRestCallHandlerRestInfoProviderRestResourceResolverRestLogger- HtmlDocTemplate
-
New tooltip template: Tooltip
-
New dark theme available:

-
Stylesheet selection now stored in HTTP session when passed in via
?stylesheetquery parameter. -
New doc: Lifecycle Hooks
-
Eliminated the
RestServletJenaDefaultclass to remove the Jena dependency class on thejuneau-rest-serverartifact. It's simple enough to simply extendBasicRestServletand add the RDF serializers and parsers.
juneau-microservice
-
The microservice has been significantly modified to be configured via a
jetty.xmlfile for maximum flexibility instead of the hodge-podge of support in the config file. Top-level servlets should now be defined in the providedjetty.xmlfile. -
New methods on
RestMicroservice:addServlet(Servlet,String)addServletAttribute(String,Object)getServer()getInstance()getPort()getContextPath()getProtocol()getHostName()
-
New methods on Microservice:
-
New class
JettyLoggerfor directing Jetty logging to the java.util.logging framework. -
New class
DebugResourcefor 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):

Release 6.3.1
Date: Aug 1, 2017
Juneau 6.3.1 is a minor release.
org.apache.juneau
-
PojoQueryimprovements. -
New
RemoteMethod.returns()annotation. Allows you to specify whether the remote method returns the HTTP body or status code. -
Fixed bugs with
BEAN_includePropertiesandBEAN_excludePropertiessettings. -
New/modified settings in
HtmlDocSerializerContext:HTMLDOC_scriptHTMLDOC_style- WasHTMLDOC_css.HTMLDOC_stylesheet- WasHTMLDOC_cssUrl. Now an array.
-
New
ResourceFinderutility 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_descriptionSee 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:

Compared with previous 'devops':

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

-
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
@HtmlDocannotations:-
@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@RestResourceand@RestMethodannotations. -
Widget.getName() now defaults to the simple class name. So now you can just refer to the class name:
"$W{ContentTypeMenuItem}". -
Renamed widgets:
PoweredByApacheWidget→PoweredByApachePoweredByJuneauWidget→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:

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

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:

-
-
New/modified annotations on
@HtmlDoc:HtmlDoc.style()- Renamed fromcss().HtmlDoc.stylesheet()- Renamed fromcssUrl(). 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
BasicRestServletclass 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
DockerRegistryResourceexamples 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()andbpExcludes()annotations on@RestMethodhas 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
$Rvariable:"$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). -
@BeanPropertyannotation 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
PartSerializerinterface 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.serializerQuery.serializerQueryIfNE.serializerFormData.serializerFormDataIfNE.serializerHeader.serializerHeaderIfNE.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_uriContextSerializerContext.SERIALIZER_uriRelativitySerializerContext.SERIALIZER_uriResolutionSerializerContext.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_paramFormathas been moved toUonSerializer.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:
- SerializerListener
- Serializer.Builder.listener(Class)
@RestResource(serializerListener)RestConfig.serializerListener(Class)- ParserListener
- Parser.Builder.listener(Class)
@RestResource(parserListener)RestConfig.parserListener(Class)Builder.listeners(Class,Class)
-
The
BEAN_debugflag will now capture parser input and make it available through theParserSession.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:

Annotation can be applied to POJO classes and bean properties.
-
Several new properties for customizing parts of the HTML page:
HtmlDocSerializerContext.HTMLDOC_titleHtmlDocSerializerContext.HTMLDOC_descriptionHtmlDocSerializerContext.HTMLDOC_brandingHtmlDocSerializerContext.HTMLDOC_headerHtmlDocSerializerContext.HTMLDOC_navHtmlDocSerializerContext.HTMLDOC_asideHtmlDocSerializerContext.HTMLDOC_footerHtmlDocSerializerContext.HTMLDOC_noResultsMessageHtmlDocSerializerContext.HTMLDOC_cssUrlHtmlDocSerializerContext.HTMLDOC_cssHtmlDocSerializerContext.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_includePropertiesBEAN_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:
RequestBodyRequestHeadersRequestQueryRequestFormDataRequestPath
-
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 ofRestRequest.- RestResponse - The response object.
javax.servlet.http.HttpServletResponse- The superclass ofRestResponse.
The new supported types are:
AcceptAcceptCharsetAcceptEncodingAcceptLanguageAuthorizationCacheControlConnectionContentLengthContentTypeDateExpectFromHostIfMatchIfModifiedSinceIfNoneMatchIfRangeIfUnmodifiedSinceMaxForwardsPragmaProxyAuthorizationRangeRefererTEUserAgentUpgradeViaWarning- 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.
- UrlVar - Resolve
-
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=trueparameter now works on byte-based serializers by converting the output to hex. -
New classes for widget support:
- Widget
PoweredByJuneauWidgetContentTypeLinksColumnWidgetContentTypeLinksRowWidgetQueryWidget
-
devops.csscleaned 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
Pathannotation for specifying path variables on remoteable interfaces. -
New
@RequestBeanannotation for specifying beans with remoteable annotations defined on properties. -
The following annotations (and related methods on RestCall) can now take
NameValuePairsand 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 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.BuilderParserGroup.BuilderEncoderGroup.Builder
-
Revamped the config file API to use a builder:
ConfigFileBuilder. -
Removed the
Lockableinterface. -
New
addBeanTypePropertiessetting added to serializers to override theSerializerContext.SERIALIZER_addBeanTypePropertiessetting for individual serializers in a serializer group:HtmlSerializerContext.HTML_addBeanTypePropertiesJsonSerializerContext.JSON_addBeanTypePropertiesMsgPackSerializerContext.MSGPACK_addBeanTypePropertiesUonSerializerContext.UON_addBeanTypePropertiesXmlSerializerContext.XML_addBeanTypePropertiesRdfSerializerContext.RDF_addBeanTypeProperties
-
UON notation serializers and parsers moved into the new
org.apache.juneau.uonpackage. -
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
hereand in theswaggerjavadocs.
-
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:
AListASetAMap
-
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
remoteablefor all remoteable proxy interface annotations.@Remoteableannotation 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
-
@RestResourceannotation can now be applied to any class! You're no longer restricted to subclassing your resources fromRestServlet. This is a major enhancement in the API. Anything you could do by subclassing fromRestServletshould have an equivalent for non-RestServletclasses. The only restriction is that the top-level resource must subclass fromRestServlet. Child resources do not.The majority of code has been split up into two separate classes:
RestConfig- A modifiable configuration of a resource. Subclasses fromjavax.servlet.ServletConfig.- RestContext - A read-only configuration that's the result of a snapshot of the config.
The
RestServletclass 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-
RestServletclasses 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
RestResourceResolverfor instantiating it.
Non-
RestServletclasses 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
@RestResourceto allow non-RestServletresources to do the same as subclassing directly fromRestServlet:RestResource.resourceResolver()- Specify aRestResourceResolverclass for resolving child resources.RestResource.callHandler()- Specify aRestCallHandlerclass for handling the lifecycle of a REST call.RestResource.infoProvider()- Specify aRestInfoProviderclass for customizing title/description/Swagger information on a REST resource.RestResource.logger()- Specify aRestLoggerclass for handling logging.
-
New annotations added to
@RestResourceand@RestMethodto 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
titleanddescriptionannotations 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. -
StreamResourcecan 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 newStreamResourceBuilderclass. -
Simplified remoteable proxies using the
@RestMethod(name="PROXY")annotation on REST methods. Used to expose interface proxies without the need forRemoteableServlet.// 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
RestClientclassdoX(Object url)methods now handle HttpClientURIBuilderinstances. -
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 ofNameValuePairsfor 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: trueheader 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: trueheader 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 ofNameValuePairs. -
RestCall.getResponse(Class)- Can now pass in any of the following:- HttpResponse - Returns the raw
HttpResponsereturned by the innerHttpClient. - Reader - Returns access to the raw reader of the response.
- InputStream - Returns access to the raw input stream of the response.
- HttpResponse - Returns the raw
-
-
New methods added to
NameValuePairs:NameValuePairs.append(String,Object)append(String,Object,PartSerializer)
-
RetryOnis 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 more0s to try a random port. -
Methods added to
RestMicroserviceclass: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
MIXEDexcept 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
TEXTexcept 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
xmldocumentation. -
Eliminated unnecessary
<string>elements. -
Eliminated
XmlContentHandlerclass. -
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
addJsonTypeAttrsandaddJsonStringTypeAttrssettings. -
Namespace support is now disabled by default.
-
-
Significant modifications and improvements to HTML serialization support.
- Parser converted from
XMLEventReader-based toXMLStreamReader. - 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
htmldocumentation.
- Parser converted from
-
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.
-
SerializerContextandParserContextnow 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:- Parser.parse(Object,Class) - Normal method.
- Parser.parse(Object,Type,Type...) - Method for parsing into parameterized maps and collections.
Using these methods, you can construct arbitrarily complex objects consisting of maps and collections. You could do this before but it required constructing a
ClassMetaobject.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
ClassMetaobjects. -
No need for casting anymore if you were using the old
parseMap()andparseCollection()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
PojoSwapclass. 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()andfromObjectMap()/T(ObjectMap)methods with generalizedswap(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 theDate.toString()method.ISO8601DT,ISO8601DT- To ISO8601 date-time strings.ISO8601DTZ,ISO8601DTZ- Same asISO8601DT, except always serializes in GMT.ISO8601DTP,ISO8601DTP- Same asISO8601DTexcept with millisecond precision.ISO8601DTPZ,ISO8601DTPZ- Same asISO8601DTZexcept with millisecond precision.RFC2822DT,RFC2822DT- To RFC2822 date-time strings.RFC2822DTZ,RFC2822DTZ- Same asRFC2822DT, 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
atomdocumentation.
-
New
MapSwapandStringSwapclasses. -
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_AWAREandUrlEncodingParser.DEFAULT_WS_AWAREparsers. The normal UonParser.DEFAULT and UrlEncodingParser.DEFAULT parsers will now handle whitespace. - Eliminated the
UonParserContext.UON_whitespaceAwareconfiguration setting. - Eliminated the
UonSerializer.DEFAULT_SIMPLE,UonSerializer.DEFAULT_SIMPLE_ENCODINGandUrlEncodingSerializer.DEFAULT_SIMPLEserializers since there is no separate simple mode anymore. - Eliminated the
UonParserContext.UON_simpleModeconfiguration 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_addBeanTypePropertiessetting is now enabled by default. -
Combined the
SERIALIZER_addIndentation/JSON_addWhitespace/UON_addWhitespaceproperties into a singleSerializerContext.SERIALIZER_useWhitespacesetting.
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
ClassMetaobjects 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=truespecified.
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_strictParserContext.PARSER_inputStreamCharsetParserContext.PARSER_fileCharset
-
Removed
JsonParserContext.JSON_strictMode. Replaced byPARSER_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
PropertyStoreclass - Used for creating context objects. - New Context class - Read-only configurations for serializers and parsers.
- New
Sessionclass - One-time use objects used by serializers and parsers. - All context context properties can now also be specified via system properties.
- New
-
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 usingBeanContext.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
BeanFilterBuilderclass. Allows theBeanFilterclass 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.internalpackage. 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.propertiesannotations 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
ClassFilterclass since it's no longer needed. -
Code and concurrency improvements to
SerializerGroupandParserGroup. -
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=MyLabelto URL.HtmlSerializerContext.HTML_labelParameter- Specify what URL parameter to use as the anchor text label.HtmlSerializerContext.URI_ANCHORoption forHtmlSerializerContext.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
@Transformannotation to@Pojoso 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
ResourceOptionsand 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.paramFormatcontext 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
JazzRestClientclass. -
New method
RestClient.setClientVersion(String).