Version 7.1.0 is a major update with major implementation refactoring across all aspects of the product.
juneau-marshall
-
Significant improvements made to the internals of the Serializer and Parser classes.
-
Caching improvements on serializers and parsers have reduced execution time of the core
JUnits by approximately 1/3.
The 17000+ JUnit tests now execute in less than 10 seconds and have a cache-reuse hit rate
of 98% (164104 serializers/parsers/bean-contexts retrieved, but only 1801 created from scratch).
-
All the various separate Context classes (e.g. JsonSerializerContext) have been folded into
their respective serializer or parser classes (e.g. JsonSerializer).
Additionally, these classes are their own bean contexts.
For example, the class hierarchy of JsonSerializer is now:
- {@link oaj.Context}
- {@link oaj.BeanContext}
- {@link oaj.serializer.Serializer}
- {@link oaj.serializer.WriterSerializer}
- {@link oaj.json.JsonSerializer}
All Context objects are thread-safe and read-only.
-
Session objects also now have a consistent class hierarchy.
For example, the class hierarchy of JsonSerializerSession is now:
- {@link oaj.Session}
- {@link oaj.BeanSession}
- {@link oaj.serializer.SerializerSession}
- {@link oaj.serializer.WriterSerializerSession}
- {@link oaj.json.JsonSerializerSession}
Session objects are transient objects that live for the duration of a single parse.
-
Builder objects also now have a consistent class hierarchy.
For example, the class hierarchy of JsonSerializer.Builder is now:
- {@link oaj.Context.Builder}
- {@link oaj.BeanContext.Builder}
- {@link oaj.serializer.Serializer.Builder}
- {@link oaj.json.JsonSerializer.Builder}
Builder objects are used for building up and creating Context objects.
-
The {@link oaj.PropertyStore} class has been completely rewritten.
It is now a read-only configuration store build using the {@link oaj.PropertyStoreBuilder}
class.
The previous PropertyStore class was overly-complicated with many read/write
locks to ensure thread-safety.
The new design shifts to a builder-based model with read-only PropertyStore objects
that can be used as hash keys.
-
Improvements to the HTTP-Part APIs.
The existing PartSerializer/PartParser classes
have been replaced with the following all located in the new org.apache.juneau.httppart package:
- {@link oaj.httppart}
- {@link oaj.httppart.HttpPartType}
- {@link oaj.httppart.HttpPartSerializer}
- {@del UonPartSerializer}
- {@del SimpleUonPartSerializer}
- {@link oaj.httppart.SimplePartSerializer}
- {@link oaj.httppart.HttpPartParser}
- {@del UonPartParser}
- {@del SimplePartParser}
Code for marshalling of parts have been removed from the URL-Encoding serializers and parsers.
-
Context.Builder.property(String,Object) renamed to {@del oaj.Context.Builder#set(String,Object)}.
-
ResourceFinder class has been replaced with the following:
- {@del oaj.utils.ClasspathResourceFinder}
- {@del oaj.utils.ClasspathResourceFinderSimple}
- {@del oaj.utils.ClasspathResourceFinderBasic}
- {@del oaj.utils.ClasspathResourceFinderRecursive}
- {@del oaj.utils.ClasspathResourceManager}
-
New methods on {@link oaj.serializer.SerializerSession}:
- {@link oaj.serializer.SerializerSession#getListener() getListener()}
- {@link oaj.serializer.SerializerSession#getListener(Class) getListener(Class)}
-
New methods on {@link oaj.parser.ParserSession}:
- {@link oaj.parser.ParserSession#getListener() getListener()}
- {@link oaj.parser.ParserSession#getListener(Class) getListener(Class)}
-
New {@del oaj.parser.Parser#PARSER_unbuffered} setting allows you to disable internal
buffering on the JSON and UON parsers so that they can be used to read continous streams of objects.
-
New {@del oaj.json.JsonParser#JSON_validateEnd} and {@del oaj.uon.UonParser#UON_validateEnd}
settings allow you to control whether we validate that there is no garbage at the end of the parsed input.
-
New {@del oaj.parser.Parser#PARSER_autoCloseStreams} setting allows input streams and
readers passed into parsers to be automatically closed after parsing.
-
Syntax changed on unswap method on {@del oaj.transform.Surrogate} classes.
It's now a regular method instead of a static method.
-
{@link oaj.annotation.Swap @Swap} annotation can now be used with
{@del oaj.transform.Surrogate} classes.
-
New support for {@del PojoBuilders POJO Builders}.
juneau-svl
-
New variables:
- {@link oaj.svl.vars.CoalesceVar}
- {@link oaj.svl.vars.PatternMatchVar}
- {@link oaj.svl.vars.NotEmptyVar}
- {@link oaj.svl.vars.UpperCaseVar}
- {@link oaj.svl.vars.LowerCaseVar}
-
Variables moved from juneau-microservice:
- {@link oaj.svl.vars.ArgsVar}
- {@link oaj.svl.vars.ManifestFileVar}
juneau-config
-
The Config API has been completely revamped.
New features include:
- Support for pluggable storage.
- File-system watcher integration support.
Changes made to file system files now automatically reflected in configurations
and interface proxies.
- New builder-based design.
juneau-dto
-
Enhancements to Swagger DTO:
- New methods for setting and retrieving properties via name:
- {@link oaj.dto.swagger.SwaggerElement#get(String,Class)}
- {@link oaj.dto.swagger.SwaggerElement#set(String,Object)}
-
Support for setting non-standard fields such as "$ref" via getter and setter
above.
-
Setter methods that take in beans and collections of beans can now take in
JSON strings.
juneau-rest-server
-
RestServletDefault renamed to {@del oajr.BasicRestServlet}.
-
RestServletGroupDefault renamed to {@del oajr.BasicRestServletGroup}.
-
The "$R{...}" variable has been split into the following:
- "$RA{key1[,key2...]}" - {@link oajr.vars.RequestAttributeVar}, first non-null value returned by HttpServletRequest.getAttribute(String).
- "$RF{key1[,key2...]}" - {@link oajr.vars.RequestFormDataVar}, first non-null value returned by {@del oajr.RestRequest#getFormData(String)}.
- "$RH{key1[,key2...]}" - {@link oajr.vars.RequestHeaderVar}, first non-null value returned by {@link oajr.RestRequest#getHeader(String)}.
- "$RI{key1[,key2...]}" - {@del oajr.vars.RestInfoVar}, first non-null value returned by {@del oajr.RestRequest#getInfoProvider()}.
The possible values are:
- "contact" - Value returned by {@link oaj.dto.swagger.Info#getContact()}
- "description" - Value returned by {@del oajr.RestInfoProvider#getDescription(RestRequest)}
- "externalDocs" - Value returned by {@link oaj.dto.swagger.Swagger#getExternalDocs()}
- "license" - Value returned by {@link oaj.dto.swagger.Info#getLicense()}
- "methodDescription" - Value returned by {@del RestInfoProvider#getMethodDescription(Method,RestRequest)}
- "methodSummary" - Value returned by {@del RestInfoProvider#getMethodSummary(Method,RestRequest)}
- "siteName" - Value returned by {@del RestInfoProvider#getSiteName(RestRequest)}
- "tags" - Value returned by {@link oaj.dto.swagger.Swagger#getTags()}
- "termsOfService" - Value returned by {@link oaj.dto.swagger.Info#getTermsOfService()}
- "title" - See {@del oajr.RestInfoProvider#getTitle(RestRequest)}
- "version" - See {@link oaj.dto.swagger.Info#getVersion()}
- "$RP{key1[,key2...]}" - {@link oajr.vars.RequestPathVar}, first non-null value returned by {@del oajr.RestRequest#getPath(String)}.
- "$RQ{key1[,key2...]}" - {@link oajr.vars.RequestQueryVar}, first non-null value returned by {@del RestRequest#getQuery(String)}.
- "$R{key1[,key2...]}" - {@link oajr.vars.RequestVar}, first non-null other request variable.
The possible values are:
- "contextPath" - Value returned by {@link oajr.RestRequest#getContextPath()}
- "method" - Value returned by {@link oajr.RestRequest#getMethod()}
- "methodDescription" - Value returned by {@del oajr.RestRequest#getMethodDescription()}
- "methodSummary" - Value returned by {@del oajr.RestRequest#getMethodSummary()}
- "pathInfo" - Value returned by {@link oajr.RestRequest#getPathInfo()}
- "requestParentURI" - Value returned by {@link oaj.UriContext#getRootRelativePathInfoParent()}
- "requestURI" - Value returned by {@link oajr.RestRequest#getRequestURI()}
- "resourceDescription" - Value returned by {@del oajr.RestRequest#getResourceDescription()}
- "resourceTitle" - See {@del oajr.RestRequest#getResourceTitle()}
- "servletParentURI" - Value returned by {@link oaj.UriContext#getRootRelativeServletPathParent()}
- "servletPath" - See {@link oajr.RestRequest#getServletPath()}
- "servletURI" - See {@link oaj.UriContext#getRootRelativeServletPath()}
- "siteName" - See {@del RestRequest#getSiteName()}
-
Refactored the RestConfig class into {@link oajr.RestContext.Builder}.
Settings on {@link oajr.RestContext} objects can now be set declaratively through the
following new properties:
- {@del RestContext#REST_allowHeaderParams}
- {@del RestContext#REST_allowBodyParam}
- {@del oajr.RestContext#REST_allowedMethodParams REST_allowedMethodParams}
- {@del oajr.RestContext#REST_renderResponseStackTraces REST_renderResponseStackTraces}
- {@del RestContext#REST_useStackTraceHashes}
- {@del oajr.RestContext#REST_defaultCharset REST_defaultCharset}
- {@del oajr.RestContext#REST_maxInput REST_maxInput}
- {@del RestContext#REST_paramResolvers}
- {@del oajr.RestContext#REST_converters REST_converters}
- {@del oajr.RestContext#REST_guards REST_guards}
- {@del RestContext#REST_responseHandlers}
- {@del RestContext#REST_defaultRequestHeaders}
- {@del RestContext#REST_defaultResponseHeaders}
- {@del oajr.RestContext#REST_produces REST_produces}
- {@del oajr.RestContext#REST_consumes REST_consumes}
- {@del oajr.RestContext#REST_clientVersionHeader REST_clientVersionHeader}
- {@del RestContext#REST_resourceResolver}
- {@del RestContext#REST_logger}
- {@del RestContext#REST_callHandler}
- {@del RestContext#REST_infoProvider}
- {@del oajr.RestContext#REST_path REST_path}
- {@del RestContext#REST_contextPath}
- {@del oajr.RestContext#REST_staticFiles REST_staticFiles}
- {@del RestContext#REST_staticFileResponseHeaders}
- {@del RestContext#REST_classpathResourceFinder}
- {@del RestContext#REST_useClasspathResourceCaching}
- {@del RestContext#REST_widgets}
- {@del RestContext#REST_mimeTypes}
-
Support for static files has been simplified and improved.
- Syntax on {@del @RestResource(staticFiles)} has been simplified, and
now allows you to specify response headers in the strings.
- Response headers for static files can also be configured through
{@del RestContext#REST_staticFileResponseHeaders}
- Static file in-memory caching now configurable through
{@del RestContext#REST_useClasspathResourceCaching}
- Static file retrieval can be customized through
{@del RestContext#REST_classpathResourceFinder}
-
Eliminated the RestMatcherReflecting class.
You can now simply create a {@link oajr.RestMatcher} that has a public constructor that
takes in the server and method arguments.
-
{@del @RestResource#allowMethodParam} renamed to {@del RestResource#allowedMethodParams}.
-
@RestMethod.serializersInherit and @RestMethod.parsersInherit replaced with
simplified {@del @RestMethod(inherit)}.
-
Changes to {@del oajr.RequestFormData}:
- {@del oajr.RequestFormData#addDefault(Map) addDefault(Map)} takes in a
Map<String,Object> instead of Map<String,String>.
-
Changes to {@del oajr.RequestHeaders}:
- {@del oajr.RequestHeaders#addDefault(Map) addDefault(Map)} takes in a
Map<String,Object> instead of Map<String,String>.
-
Changes to {@del oajr.RequestQuery}:
- {@del oajr.RequestQuery#addDefault(Map) addDefault(Map)} takes in a
Map<String,Object> instead of Map<String,String>.
-
Changes to {@link oajr.RestContext}:
- getResource(String,Locale) renamed to {@del getClasspathResource(String,Locale)}
- getResourceAsString(String,Locale) renamed to {@del getClasspathResourceAsString(String,Locale)}
- getResource(Class,MediaType,String,Locale) renamed to {@del getClasspathResourceAsString(Class,MediaType,String,Locale)}
- New method {@del getClasspathResource(Class,String,Locale)}.
- New method {@del getClasspathResourceAsString(Class,String,Locale)}.
- New method {@del getClasspathResource(Class,Class,MediaType,String,Locale)}.
- {@del RestContext#getDefaultRequestHeaders()} returns a
Map<String,Object> instead of Map<String,String>.
- {@del RestContext#getDefaultResponseHeaders()} returns a
Map<String,Object> instead of Map<String,String>.
-
Changes to {@link oajr.RestRequest}:
- getSupportedMediaTypes() replaced with
{@del oajr.RestRequest#getConsumes() getConsumes()} and
{@del oajr.RestRequest#getProduces() getProduces()}.
- getReaderResource(String,boolean,MediaType) renamed to
{@del getClasspathReaderResource(String,boolean,MediaType)}
- getReaderResource(String,boolean) renamed to
{@del getClasspathHttpResource(String,boolean)}
- getReaderResource(String) renamed to
{@del getClasspathHttpResource(String)}
-
Changes to {@del @RestResource}
- New {@del mimeTypes()} annotation.
-
Changes to {@del oajr.annotation.RestMethod @RestMethod}:
- New {@del oajr.annotation.RestMethod#consumes() consumes()} and
{@del oajr.annotation.RestMethod#produces() produces()}
for overriding the supported media types inferred from the serializers and parsers.
-
RestCallHandler split up into {@del oajr.RestCallHandler} and
{@del BasicRestCallHandler}
-
RestInfoProvider split up into {@del oajr.RestInfoProvider} and
{@del oajr.BasicRestInfoProvider}
-
RestLogger split up into {@del oajr.RestLogger},
{@del oajr.BasicRestLogger} and {@del oajr.NoOpRestLogger}
-
RestResourceResolverSimple renamed to {@del oajr.BasicRestResourceResolver}
-
Introduced the following classes that helps make the code more understandable:
- {@del oajr.RestContextProperties}
- {@del oajr.RestMethodProperties}
- {@del oajr.RequestProperties}
-
Eliminated the @Messages and @Properties REST java method parameter
annotations.
These aren't needed anymore since you can just pass in MessageBundle and
RestRequestProperties as unannotated parameters.
-
Revamped the {@del oajr.RestInfoProvider} class.
-
New builder classes:
- {@del ReaderResourceBuilder}
- {@del StreamResourceBuilder}
-
{@link oajr.RestResponse#getNegotiatedOutputStream()} now returns a
{@del FinishableServletOutputStream} and {@link oajr.RestResponse#getNegotiatedWriter()}
now returns a {@del FinishablePrintWriter} that allows you to finish the output
without closing the stream.
The {@del oajr.reshandlers.DefaultHandler} class now calls finish()
instead of close() on the stream.
-
Added the following annotations to the {@del oajr.BasicRestServlet} class
(which were previously defined on the {@del Resource} class):
@RestResource(
htmldoc=@HtmlDoc(
navlinks={
"up: request:/..",
"options: servlet:/?method=OPTIONS"
},
stylesheet="$C{REST/stylesheet,servlet:/styles/devops.css}"
),
// Optional external configuration file.
config="$S{juneau.configFile}"
)
juneau-rest-client
-
New configuration property {@del oajrc.RestClient#RESTCLIENT_query} and
builder method {@del oajrc.RestClient.Builder#query(String,Object)}.
-
API changes to replace PartSerializer with {@link oaj.httppart.HttpPartSerializer}.
The default value is now {@del SimpleUonPartSerializer} which will
serialize strings as plain-text and collections/arrays as comma-delimited lists.
We decided to change the default behavior in favor of practicality over purity.
-
New methods on {@del oajrc.RestCall} class:
- {@del oajrc.RestCall#getResponseHeader(String) getResponseHeader(String)}
- {@del oajrc.RestCall#getResponseCode() getResponseCode()}
-
{@del oajrc.RestCall} and {@link oajrc.RestClient}
now implement the Closeable interface.
juneau-microservice
-
Resource and ResourceGroup classes removed.
{@del oajr.BasicRestServlet} and {@del oajr.BasicRestServletGroup} can be used instead.
-
ResourceJena and ResourceJenaGroup classes renamed to
{@del BasicRestServletJena} and {@del BasicRestServletJenaGroup}.