8.1.0 (Aug 21, 2019)

8.1.0 introduces some significant new features including:

- {@del ConfigurableAnnotations Configurable Annotations}
- {@del DefaultPojoSwaps Default PojoSwaps}
- {@del ConfigImports Config Imports}
- {@del BasicRest BasicRest}, {@del BasicRestGroup BasicRestGroup} classes
- {@del RestPathAnnotation Path variables on resource paths}
- {@del RestmRequestAttributes Request Attributes API}
- {@del RestRoleGuards Role Guards}
- {@del RestLoggingAndDebugging Improved REST logging/debugging}
- New MockRest API

##### juneau-marshall

- New utility class for diffing beans:
  - {@link oaj.utils.BeanDiff}
- New annotation for defining bean property names:
  - {@link oaj.annotation.Name}
- New serializer properties:
  - {@link oaj.serializer.WriterSerializer}
    - {@del oaj.serializer.WriterSerializer#WSERIALIZER_fileCharset WSERIALIZER_fileCharset}
    - {@del oaj.serializer.WriterSerializer#WSERIALIZER_streamCharset WSERIALIZER_streamCharset}
- The following POJO methods can be used to convert a POJO to/from a Map before serialization and after parsing.
  It's a convenient way of defining a POJO transform.
  - public Map toMap() - Can be any type of map with string keys and object vals.
  - public ObjectMap toMap()
  - public Map toMap(BeanSession bs) - Can be any type of map with string keys and object vals.
  - public ObjectMap toMap(BeanSession bs)
  - public static T fromMap(Map m) - Can be any type of map with string keys and object vals.
  - public static T fromMap(ObjectMap m)
  - public static T fromMap(BeanSession bs, Map m) - Can be any type of map with string keys and object vals.
  - public static T fromMap(BeanSession bs, ObjectMap m)
- New convenience debugging methods on Marshall API:
  - {@link oaj.marshall.Marshall}
    - {@link oaj.marshall.Marshall#format(String,Object...) format(String,Object...)} - MessageFormat-style formatter.
    - {@link oaj.marshall.Marshall#out(String,Object...) out(String,Object...)} - Prints MessageFormat-style messages to STDOUT.
    - {@link oaj.marshall.Marshall#err(String,Object...) err(String,Object...)} - Prints MessageFormat-style messages to STDERR.
- Serializer and parser APIs now throw IOExceptions in addition to SerializeException and ParseException to make it easier to determine if problems are stream based or syntax based.
- New Java 8 date-time transforms:
  - {@del oaj.transforms.TemporalSwap} - For all Java 8 temporal types (e.g. {@link java.time.ZonedDateTime})
  - {@del oaj.transforms.TemporalDateSwap} - For {@link java.util.Date}
  - {@del oaj.transforms.TemporalCalendarSwap} - For {@link java.util.Calendar}
- All serializers and parsers now have built-in default swaps for common class types:
  - {@link java.util.Enumeration}
  - {@link java.util.Iterator}
  - {@link java.util.Locale}
  - {@link java.util.Calendar} - ISO offset date-time.
  - {@link java.util.Date} - Local date-time
  - {@link java.time.Instant} - ISO instant.
  - {@link java.time.ZonedDateTime} - ISO offset date-time.
  - {@link java.time.LocalDate} - ISO local date.
  - {@link java.time.LocalDateTime} - ISO local date-time.
  - {@link java.time.LocalTime} - ISO local time.
  - {@link java.time.OffsetDateTime} - ISO offset date-time.
  - {@link java.time.OffsetTime} - ISO offset time.
  - {@link java.time.Year} - ISO year.
  - {@link java.time.YearMonth} - ISO year-month.
  - {@link java.time.Temporal} - ISO instant.
  - {@link java.util.TimeZone}
  - {@link javax.xml.datatype.XMLGregorianCalendar}
  - {@link java.time.ZoneId}

##### juneau-config

- Support for import statements:

  # Import values from another configuration: <ParentConfig1> [Foo] bar = baz

- The {@del oaj.config.store.ConfigFileStore} now automatically resolves file extensions.
  New configuration property for specifying search paths for file extensions:
  - {@del oaj.config.store.ConfigFileStore#FILESTORE_extensions}
- Fixed a bug where instances of {@link oaj.config.store.ConfigMemoryStore} ended up resolving to the same object.
- Uses "application.properties" file as a system default if present.
  Useful when being used in a Spring Boot application.
- New {@link oaj.config.Config#setSystemProperties} method for quickly moving configuration settings into the system properties.
- Entries in the system config are automatically set as system properties.
  This mean you can set any of the various serializer and parser settings (e.g. "JsonSerializer.simpleMode.b") in the default configuration area or application.properties.

##### juneau-rest-server

- New annotations that can be applied to REST classes and methods to configure serializers and parsers.

  // Old way using generic properties. @RestResource( path="/atom", title="Sample ATOM feed resource", properties={ @Property(name=WSERIALIZER_quoteChar, value="'"), @Property(name=RDF_rdfxml_tab, value="5"), @Property(nameRDF_addRootProperty, value="true"), @Property(name=BEAN_examples, value="{'org.apache.juneau.dto.atom.Feed': $F{AtomFeedResource_example.json}}") } ... ) public class AtomFeedResource extends BasicRestServletJena { ... }

  // New way using specific annotations. @RestResource( path="/atom", title="Sample ATOM feed resource" ... ) @SerializerConfig(quoteChar="'") @RdfConfig(rdfxml_tab="5", addRootProperty="true") @BeanConfig(examples="Feed: $F{AtomFeedResource_example.json}") public class AtomFeedResource extends BasicRestServletJena { ... }

  Config annotations are provided for all serializers and parsers:

  - {@link oaj.annotation.BeanConfig BeanConfig}
  - {@link oaj.csv.annotation.CsvConfig CsvConfig}
  - {@link oaj.html.annotation.HtmlConfig HtmlConfig}
  - {@link oaj.html.annotation.HtmlDocConfig HtmlDocConfig}
  - {@del oaj.jso.annotation.JsoConfig JsoConfig}
  - {@link oaj.json.annotation.JsonConfig JsonConfig}
  - {@link oaj.jsonschema.annotation.JsonSchemaConfig JsonSchemaConfig}
  - {@link oaj.msgpack.annotation.MsgPackConfig MsgPackConfig}
  - {@link oaj.oapi.annotation.OpenApiConfig OpenApiConfig}
  - {@link oaj.parser.annotation.ParserConfig ParserConfig}
  - {@link oaj.plaintext.annotation.PlainTextConfig PlainTextConfig}
  - {@link oaj.jena.annotation.RdfConfig RdfConfig}
  - {@link oaj.serializer.annotation.SerializerConfig SerializerConfig}
  - {@link oaj.soap.annotation.SoapXmlConfig SoapXmlConfig}
  - {@link oaj.uon.annotation.UonConfig UonConfig}
  - {@link oaj.urlencoding.annotation.UrlEncodingConfig UrlEncodingConfig}
  - {@link oaj.xml.annotation.XmlConfig XmlConfig}
- New support for using Servlet request attributes.
  - {@del oajr.RequestAttributes}
  - {@link oajr.RestContext}
    - {@del REST_attrs}
  - {@link oajr.RestContext.Builder}
    - {@del attrs(String...)}
    - {@del attr(String,Object)}
  - {@del oajr.RestMethodContext}
    - {@del oajr.RestMethodContext#RESTMETHOD_attrs RESTMETHOD_attrs}
  - {@link oajr.RestRequest}
    - {@link oajr.RestRequest#getAttributes() getAttributes()}
  - {@link oajr.RestResponse}
    - {@link oajr.RestResponse#getAttributes() getAttributes()}
    - {@del oajr.RestResponse#attr(String,Object) attr(String,Object)}
  - {@link oajr.annotation.Attr}
  - {@del RestMethod#attrs()}
  - {@del RestResource#attrs()}
  This deprecates the following APIs:
  - {@del oajr.RequestProperties}
  - {@del oajr.RestMethodProperties}
  - {@link oajr.RestRequest}
    - {@del oajr.RestRequest#getProperties() getProperties()}
    - {@del oajr.RestRequest#prop(String,Object) prop(String,Object)}
- Added the following classes that provide the same support as the servlet classes but doesn't extend from HttpServlet.
  This fixes an issue where instances of {@del oajr.BasicRestServlet} are registered as top-level servlets even though you don't want them to be.
  - {@del oajr.BasicRest} - Non-servlet equivalent to {@del oajr.BasicRestServlet}
  - {@del oajr.BasicRestGroup} - Non-servlet equivalent to {@del oajr.BasicRestServletGroup}
  - {@del oajr.BasicRestJena} - Non-servlet equivalent to {@del oajr.BasicRestServletJena}
  - {@del oajr.BasicRestJenaGroup} - Non-servlet equivalent to {@del oajr.BasicRestServletJenaGroup}
- HTML widgets now have access to the RestResponse object if they need access to the output bean.
- New annotations for simplified role-based guards on classes and methods:
  - {@del RestResource}
    - {@del roleGuard()}
    - {@del rolesDeclared()}
  - {@del oajr.annotation.RestMethod}
    - {@del oajr.annotation.RestMethod#roleGuard roleGuard()}
    - {@del oajr.annotation.RestMethod#rolesDeclared rolesDeclared()}
- New annotations for fine-tuned handling of http-methods/http-headers as query parameters and others:
  - {@del RestResource}
    - {@del allowedHeaderParams()}
    - {@del allowedMethodHeaders()}
    - {@del allowedMethodParams()}
- The {@del @RestResource(path)} annotation can now use variables:

  @RestResource( path="/myResource/{foo}/{bar}" ) public class MyResource extends BasicRestServlet {...}

- New methods:
  - {@link oajr.RestRequest}
    - {@link oajr.RestRequest#getCharset() getCharset()}
  - {@link oajr.RestResponse}
    - {@link oajr.RestResponse#getCharset() getCharset()}
- New interface method for catching arbitrary thrown objects and converting them to other throwables.
  - {@del oajr.RestCallHandler}
    - {@del oajr.RestCallHandler#convertThrowable(Throwable) convertThrowable(Throwable)}
  - {@del BasicRestCallHandler}
    - {@del convertThrowable(Throwable)}
- Support for fine-tuned logging of HTTP requests and responses.

  @RestResource( debug="per-request", logging=@Logging( level="info", rules={ @LoggingRule(codes"400-499", level="warning", req="short", res="short") @LoggingRule(codes"500-", level="severe", req="long", res="long") } ) ) public class MyRest { @RestMethod( method="POST", path="foo" logging=@Logging( level="info", rules={ @LoggingRule(exceptions"NotFound*", level="info") @LoggingRule(codes"200", disabled="true") } ) ) public String myMethod() throws Exception {...}

  See {@del RestLoggingAndDebugging} for details.
- Fixed a bug where the HTTP response was returning 405 (method not found) but should really be 404 (not found) when no path patterns match on any of the Java methods.

##### juneau-rest-client

- PATCH support added.