Commit Graph

126 Commits

Author SHA1 Message Date
Oliver Gierke
bc97010cad #138 - Extended MethodParameters to be able to return parameters by type.
MethodParameters now has a getParametersOfType(…) method to access parameters by type. Also, it now checks for the presence of Spring 4 and automatically uses the improved ParameterNameDiscoverer which will be able to discover interface method parameter names on Java 8.
2014-01-16 13:39:48 +01:00
Oliver Gierke
83743d80a2 #137 - Initial support for link templates.
Added LinkTemplate domain type that can deal with URI templates as defined in http://tools.ietf.org/html/rfc6570. We currently support /, ?, & and # variables up to level 3 of the spec (multiple parameter definitions). The templates can be expanded to a Link instance.

Added the necessary HAL mixins to render the instances as specified.
2014-01-15 17:04:57 +01:00
Oliver Gierke
653f28727c #122 - Fixed parameter binding for optional request parameters.
If the method arguments handed into a dummy controller method invocation are required but null we now throw an exception as we cannot build a URI that hits the very same method in the very same way. Based on that, we now inspect @RequestParam annotated parameters for null values, allow them but don't bind a parameter for them anymore.
2014-01-02 12:15:47 +01:00
Oliver Gierke
9b172631f9 #121 - Fixed Bundlor template to create correct OSGi manifest. 2014-01-01 19:43:47 +01:00
Oliver Gierke
6673f1987f #133 - Made JsonPathLinkDiscoverer more robust.
JsonPathLinkDiscoverer now handles InvalidPathExceptions that might occur if the representation doesn't contain the link container element.
2013-12-29 20:26:39 +01:00
Oliver Gierke
bc68707e73 #125 - Prevent curies from being rendered if no link is curied. 2013-12-29 16:20:03 +01:00
Oliver Gierke
3b41fc9149 #132 - Added guard to Resource to shield it from being used with Collection content.
Fixed ticket links in Jackson2HalIntegrationTests.
2013-12-29 16:02:28 +01:00
Oliver Gierke
88da0672ab #125 - Polished curies in HAL and HAL rendering in general.
Both _links and _embedded are now only rendered if there's actual content to be rendered. The curies link is now always rendered as array as specified.
2013-12-28 21:02:27 +01:00
Oliver Gierke
dfa30398b6 #130 - Removed @Inherited annotation from @EnableHypermediaSupport. 2013-12-20 18:59:27 +01:00
Oliver Gierke
7ed46deb7b #129 - ResourceSupport does not return an unmodifiable link collection anymore.
Needed to not fail during JAXB deserialization.
2013-12-19 14:12:37 +01:00
Oliver Gierke
5c737d4b53 #110 - Fixed the collection of values in HalEmbeddedBuilder.
HalEmbeddedBuilder now favors the collection rel to lookup already registered embeddeds.
2013-12-19 13:02:37 +01:00
Oliver Gierke
137e7c390f #128 - Severe refactoring regarding LinkDiscoverers.
The LinkDiscoverer interface is now a Plugin<MediaType> to allow selecting a discoverer per media type. We also provide a LinkDiscoverers wrapper around a PluginRegistry for easier injection.

Dropped DefaultLinkDiscoverer as the above mentioned changed prohibits the usage of a discoverer without a media type. Clients that previously used DefaultLinkDiscoverer should switch to JsonPathLinkDiscoverer with a custom JsonPath expression and media type.

@EnableHypermediaSupport now supports multiple HypermediaType values set to be able to set up support for multiple hypermedia formats. Admittedly, the only currently supported type is HAL but we prepare for the addition of other (e.g. Collection/JSON or the like). We changed the infrastructure setup taken care of by @EnableHypermediaSupport to not enrich all ObjectMapper instances with our HAL modules but explicitly register an ObjectMapper with the application context and then registering a custom MappingJackson(2)HttpMessageConverter with the HandlerAdapter instances present in the ApplicationContext. We skip the registration if an already registered MJ2HMC has an ObjectMapper already supporting the Spring HATEOAS mixins.

Removed some compiler warnings.
2013-12-19 13:01:35 +01:00
Oliver Gierke
9eacd07203 #126, #123 - Added support for HAL curies.
Introduced CurieProvider interface as well as a DefaultCurieProvider that can be registered as Spring Bean to enable Links being rendered in a curie namespace and an additional curie link exposing the metadata of how to lookup the rel definition.

Deprecated Jackson 1 integration. Added helper class to find out whether a relation type is defined by the IANA.
2013-12-17 11:23:30 +01:00
Oliver Gierke
fac6bbb2cc #124 - Fixed mapping annotations in ResourceSupport types.
Added @XmlAnyElement to Resource and moved annotations to accessors to avoid name clashes when overriding them using Jackson mixins.
2013-12-16 15:12:47 +01:00
Ito Zapata
27069b82d6 #112 - Added support for X-Forwarded-Ssl header during link construction. 2013-12-10 14:42:44 +01:00
Spring Buildmaster
9ec6f34a6f #105 - Prepare next development iteration. 2013-09-08 16:46:15 -07:00
Spring Buildmaster
5b8578884a #105 - Release version 0.8.0.RELEASE. 2013-09-08 16:46:13 -07:00
Oliver Gierke
d00a56fc42 #105 - Prepare 0.8.0 release.
Updated changelog and ChangelogCreator.
2013-09-08 16:42:00 -07:00
Oliver Gierke
8628da7bba #106 - Upgraded to Jackson 2.2.0. 2013-09-08 16:41:08 -07:00
Oliver Gierke
64d2554325 #89 - Tweaked assertions in PageMetadata.
PageMetadata doesn't reject empty pages anymore if they're used with 1-indexed Pageables. Also tweaked the assertions to only reject negative values for now.
2013-08-26 18:08:46 +02:00
Oliver Gierke
9ee4552bfe #101 - Enable annotation based parameter name discovery on MethodParameters.
MethodParameters can now get an AnnotationAttribute configured that will be inspected for parameter name lookup. If it's not set or no annotated parameter is found we fall back to the standard behavior of MethodParameter and use a LocalVariableTableParameterNameDiscoverer.
2013-07-24 13:35:46 +02:00
Spring Buildmaster
9e37bdfc29 #74 - Prepare next development iteration. 2013-07-16 09:16:38 -07:00
Spring Buildmaster
14de0ac36c #74 - Release version 0.7.0.RELEASE. 2013-07-16 09:16:35 -07:00
Oliver Gierke
f149c2cc36 #74 - Prepare changelog for 0.7 release. 2013-07-16 18:13:46 +02:00
ericbottard
9c4d6029cf #98, #97 - Fixed XML element name for PagedResources to allow deserialization.
We need to have a different XML element name for PagedResources as it can be used as root element and JAXB cannot tell the difference between Resource and PagedResource otherwise.
2013-07-16 18:06:20 +02:00
Eric Bottard
cb6dd51e04 #99 - HalLinkListSerializer now generate stable link lists.
We're now using a LinkedHashMap when creating link lists.
2013-07-16 17:21:58 +02:00
Eric Bottard
eed331dbe2 #93 - Fix VndErrors un-marshalling when using Jackson.
Added equals() and hashCode() methods on VndErrors and VndError.

Original pull request: #94.
2013-07-16 17:14:43 +02:00
Frank Bille
c5caea5efd #90 - Fixed port handling in X-Forwarded-Host treatment.
ControllerLinkBuilder now correctly uses the X-Fowarded-Host header by inspecting it for a port being set and configuring the discovered one on the ServletUriComponentsBuilder created.

Also added that the first host listed in the header is used.
2013-07-03 15:25:57 +02:00
Oliver Gierke
a7baafc022 #92 - Removed obsolete annotations from PagedResources.
Removed JsonAutoDetect annotations from PagedResources as the reference to Visibility was causing compile errors in case one of the 2 Jackson variants was not on the classpath (which by design will usually be the case). Generally, the annotations weren't required anymore so that we could remove them.
2013-06-29 14:25:45 +02:00
Oliver Gierke
4142140a37 #91 - Improved proxying for method link references with Objenesis.
Upgraded to Spring 3.2.3 to be able to use inlined CGLib directly. We now use Objenesis to create the proxy instances which avoids the need for a default constructor.
2013-06-28 23:25:20 +02:00
Oliver Gierke
3068a03764 #86 - Fixed test names to make sure they run during build.
Fixed some generics declaration to make sure code compiles on Java 6 as well.
2013-06-12 13:05:42 +02:00
Oliver Gierke
1db0068013 #85 - Added HeaderLinksResponseEntity.
The HeaderLinksResponseEntity wraps any HttpEntity containing a ResourceSupport and will transform it to contain the Links the ResourceSupport instance held in the first place in the entities headers now.
2013-06-12 13:05:30 +02:00
Oliver Gierke
4d4a43b88f #84 - Made constructor in Resource package private.
This change is to essentially prevent people from subclassing Resource and call the default constructor which wrecks the assumption of content never being null. For custom resources extend ResourceSupport.

Added missing license header in ResourcesMixin.
2013-06-12 11:01:51 +02:00
Dietrich Schulten
693faae0fe #81, #83 - Fixed potential NullPointerExceptions in HalEmbeddedBuilder. 2013-06-12 10:00:11 +02:00
Spring Buildmaster
23e78a7418 #61 - Prepare next development iteration. 2013-05-31 05:18:27 -07:00
Spring Buildmaster
a8adbdd791 #61 - Release version 0.6.0.RELEASE. 2013-05-31 05:18:24 -07:00
Oliver Gierke
2619d52285 #61 - Prepared 0.6 release.
Updated change log. Added tiny tool to generate change log for closed tickets of a particular milestone.
2013-05-31 14:06:01 +02:00
Dietrich Schulten
3f995ee8f0 #70 - Fixed link build for controllers with type-level mapping parameters. 2013-05-27 14:15:27 +02:00
Oliver Gierke
0f5afe02ab #69 - Removed formatted output from VndError tests.
Turned off JAXB output formatting as it creates OS-specific line-breaks which cause the assertions to fail.
2013-05-27 14:03:25 +02:00
Oliver Gierke
85e3a2462f #73 - ControllerLinkBuilder does not reject unmapped types anymore.
ControllerLinkBuilder now simply assumes an empty mapping if no type-level mapping can be found.
2013-05-27 13:57:15 +02:00
Oliver Gierke
a46e662632 #72 - Improved mapping discovery in AnnotationMappingDiscoverer.
AnnotationMappingDiscoverer now returns a polished mapping in case the type mapping consists of a plain slash only.
2013-05-27 13:51:44 +02:00
Oliver Gierke
45c05a3203 Polishing in annotations of PagedResources. 2013-05-27 13:40:26 +02:00
Lyle Hanson
a984f12d5a #65 - Fixed typo in readme.md. 2013-05-16 00:10:02 +02:00
Oliver Gierke
a9ccfc6782 #64 - Extended support for PagedResources.
Changed Relation type to identify previous links to standardized value of prev. Added integration tests for HAL rendering of PagedResources.
2013-05-16 00:07:57 +02:00
Oliver Gierke
17d91aca55 #63 - Added unit test for HalEmbeddedBuilder. 2013-05-15 17:46:58 +02:00
Oliver Gierke
0df0f2aab8 #63 - Use collection relation types for embedded collections.
When embedding values into HAL representations we now correctly expose the collection relation type as exposed by RelProvider.getCollectionResourceRelFor(…). Added EmbeddedHalBuilder to ease building these kinds of nested maps easily and use the commonly shared code between Jackson 1 and 2 implementations.
2013-05-07 19:08:03 +02:00
Oliver Gierke
4af8c917c2 #62 - Added support for application/vnd.error+(json|xml).
Introduced representation models for the application/vnd.error media type as specified in [0]. Added default mapping annotations to get it rendered in XML (via JAXB), and JSON (via Jackson 1 and 2).

[0] https://github.com/blongden/vnd.error
2013-05-01 22:03:44 +02:00
Oliver Gierke
05bd3ddb44 #44 - Updated readme.md to document new features introduced in 0.5. 2013-04-30 19:27:02 +02:00
Spring Buildmaster
1fe02aaab7 #44 - Prepare next development iteration. 2013-04-30 08:59:35 -07:00
Spring Buildmaster
5f0c35fa48 #44 - Release version 0.5.0.RELEASE. 2013-04-30 08:59:32 -07:00