Commit Graph

240 Commits

Author SHA1 Message Date
Oliver Gierke
ab613f85ac #360 - Improved TypeConstrainedHttpMessageConverter on generics matching.
We now locally resolve the generic type using Jackson's JavaType in canRead(Type, Class, MediaType) to avoid having to call the non-generic method as this caused us having to tweak it's implementation to avoid the super.canRead(Class, MediaType) check as this in turn forwards to the generic method (which then would've caused a stack overflow.
2015-08-04 10:35:43 +02:00
Oliver Gierke
28234e16a5 #360 - Tweaked TypeConstrainedMappingJackson2HttpMessageConverter to reject all types not matching the configured one.
We now also override canRead(Type, Class<?>, MediaType) to make sure we can opt out of being used for generic type matching.
2015-08-04 10:35:43 +02:00
Oliver Gierke
a356dc3b89 #353 - Updated dependencies.
Logback 1.1.2 -> 1.1.3
Jackson 2.4.3 -> 2.4.6
Minidev JSON 2.1.0 -> 2.1.1
Slf4j 1.7.10 -> 1.7.12
Spring 4.1.5 -> 4.1.6
Spring Data Build resources 1.5.2 -> 1.6.0

Maven Antrun Plugin 1.7 -> 1.8
Maven Assembly Plugin 2.4 -> 2.5.4
Wagon Maven Plugin 1.0-beta-5 -> 1.0
Maven Compiler Plugin 3.2 -> 3.3
Maven JAR Plugin 2.5 -> 2.6
Maven Javadoc Plugin 2.10.1 -> 2.10.3
Maven Deploy Plugin 2.8.1 -> 2.8.2
2015-08-04 10:35:40 +02:00
Oliver Gierke
3b30c7832e #346 - Polishing.
Turned hop into a real value object by making it immutable. Added unit tests for Hop. use verbose concept names instead of abbreviations (e.g. parameters instead of params). Additional assertions and the documentation of such in JavaDoc. @since tag in new Hop class.

Original pull request: #350
2015-05-23 18:50:32 +02:00
Greg Turnquist
2c1797d9b7 #346 - Enhance Traverson.follow() to customize individual hops.
Introduced a dedicated value object to abstract a Hop within a relation traversal. The Hop consists of a relation name and optional local template parameters that are applied to this particular hop when traversing it.

Changed the implementation of Traverson to work with Hops instead of plain rels and merges the global template parameters with the hop-local ones before expanding the templates found.

Original pull request: #350.
2015-05-23 18:47:24 +02:00
Oliver Gierke
96166f9ede #347 - Added exclusions for Intellij files. 2015-05-21 14:56:58 +02:00
Oliver Gierke
bbb75885d5 #342 - Polishing.
Extracted exception message into a constant. Added author where necessary and extended copyright headers. Fixed import order. Moved unit test into ControllerLinkBuilderUnitTest. Tweaked it to use JUnit rule.

Original pull request: #344.
2015-05-21 14:56:55 +02:00
Greg Turnquist
b592ddda92 #342 - Augment error message when building link without a web request.
We now explicitly check whether we could look up request attributes and throw an exception with a message indicating the cause of the failure.

Original pull request: #344.
2015-05-21 14:47:39 +02:00
Oliver Gierke
4c2c6d5a4a #341 - Default ObjectMapper for HAL now ignores unknown properties.
We now explicitly disable the "fail on unknown properties" deserialization feature for the ObjectMapper instance used with our default HAL setup to be able to use it with a RestTemplate out of the box.
2015-05-17 17:26:33 +02:00
Oemer Yildiz
312fa3ead9 #331 - Fixed handling of @RequestParam with default value set.
ControllerLinkBuilderFactory now checks the default value of an @RequestParam annotated handler method parameter before triggering strict validation.

Original pull request: #332.
2015-04-13 16:41:34 +02:00
Oliver Gierke
22488e0c05 #322 - Upgrade to Spring Plugin 1.2.0. 2015-03-19 16:12:50 +01:00
Oliver Gierke
2bcfd92c3b #321 - Remove dependency to Objenesis.
We're now using the inlined version of Objenesis in Spring Framework to avoid the additional dependency.
2015-03-19 13:34:41 +01:00
Oliver Gierke
dc90d23da7 #314 - HalLinkDiscoverer now also works for URI rels.
Relation names can be fully qualified URIs. HalLinkDiscoverer now quotes the relation name handed into the constructor so that the expression parsing works as expected.
2015-03-09 23:30:24 +01:00
Spring Buildmaster
15e2eb1f75 #308 - Prepare next development iteration. 2015-03-05 01:34:30 -08:00
Spring Buildmaster
9985e7055b #308 - Release version 0.17.0.RELEASE. 2015-03-05 01:34:25 -08:00
Oliver Gierke
2d329603af #308 - Prepare 0.17.0.RELEASE.
Updated changelog, notice.txt.
2015-03-05 10:31:15 +01:00
Oliver Gierke
76ae2475ec #278 - Shortened README to point to the reference documentation. 2015-03-05 10:30:39 +01:00
Oliver Gierke
51847980d2 #312 - Test case to verify Link keeps the complete base URI. 2015-03-02 16:45:48 +01:00
Oliver Gierke
de59fa40b9 #313 - Assert compatibility with JSONPath 0.9 and 1.2.
We now reflectively invoke the JSONPath.compile(…) method as the method signature has changed but we need to stay compatible with 0.9 to allow the Spring Data Evans release train to upgrade to 0.17 without a major third-party dependency upgrade.

Copied the reflective method lookup from Spring's JsonPathExpectationsHelper.

Related ticket: #297, #305.
2015-03-02 16:05:12 +01:00
Oliver Gierke
c3dcdf1b9e #306 - Renamed type references types to allow more concise usage.
Renamed the Resource, Resources and PagedResources types in TypeReferences to *Type so that new TypeReferences.Resources<User>() {} now becomes new ResourcesType<User>() {}.

Prior to this change a static import of TypeReferences would've cause the actual Resource types to be fully qualified.
2015-03-02 12:48:21 +01:00
Oliver Gierke
0021d3818a #267 - Polishing. 2015-02-27 16:08:27 +01:00
Kellen Dye
bc0737361c #267 - Added ResourceSupport.add(Link... links). 2015-02-27 16:08:04 +01:00
Oliver Gierke
6f61126989 #311 - Upgraded to Spring 4.0.9.RELEASE. 2015-02-27 15:07:12 +01:00
Oliver Gierke
1efb5a53bf #310 - Added missing package-info.java files. 2015-02-27 15:03:27 +01:00
Oliver Gierke
32d7c9bf51 #309 - Fixed calculation of total pages in PageMetadata. 2015-02-27 14:56:31 +01:00
Oliver Gierke
20bba97498 #278 - Added build setup to deploy reference docs and JavaDoc.
Build infrastructure to render Asciidoc and create and upload JavaDoc as well as the rendered reference documentation. EPub doesn't work for some reason.

Migrated reference documentation to Asciidoctor. Readme should be shrinked down to the most minimum once we have a release.
2015-02-27 14:45:06 +01:00
Matteo Castellini
1ae44c1896 #237 - Added missing variable in call to ControllerLinkBuilder.linkTo(…).
673f82d introduced a glitch in a delegation within ControllerLinkBuilder.linkTo(Class<?> controller, Method method, Object... parameters) which is fixed by this commit.

Original pull request: #300.
2015-02-27 13:03:41 +01:00
Oliver Gierke
b00bbe7504 #209 - Polishing.
Fixed imports in production code and test cases. Extended copyright range. Extracted request parameter handling into dedicated method. Added missing ticket reference.

Original pull request: #210.
2015-02-27 12:57:56 +01:00
rossturner
65f0c451d5 #209 - Added support for Map<String, String> and MultiValueMap<String, String> RequestParams in ControllerLinkBuilderFactory.
Original pull request: #210.
2015-02-27 12:56:42 +01:00
Oliver Gierke
912337669a #258 - Traverson now exposes default configuration per media types.
Introduced Traverson.getDefaultMessageConverters(…) to be able to obtain the list of default HttpMessageConverters depending on the given media types. Added overloads for varargs as well as a List for consistency.
2015-02-26 21:25:31 +01:00
Oliver Gierke
78fb2c4bc1 #307 - Introduced TraversalBuilder.asTemplatedLink().
TraversalBuilder.asTemplatedLink() allows to obtain the final link of a hypermedia traversal in unexpanded form.
2015-02-26 19:58:12 +01:00
Oliver Gierke
9c45341564 #306 - Introduced TypeReferences helper to create ParameterizedTypeReferences easily.
TypeReferences contains a set of predefined types that allows to shortcut the creation of ParameterizedTypeReference instances a bit, which is very useful for the usage on the client side (e.g., via RestTemplate).

new ParameterizedTypeReference<Resources<Resource<User>>>() {};

becomes

new TypeReferences.Resources<Resource<User>>() {};

The latter can even be abbreviated by using a static import for TypeReferences.
2015-02-26 19:52:19 +01:00
Oliver Gierke
8d5424a6db #305 - Dependency upgrades.
Spring Framework 3.2.9 -> 3.2.13
Jackson 2.4.1 -> 2.4.3
JSONPath 0.9.1 -> 1.2.0
Slf4j 1.7.7 -> 1.7.10
Evo Inflector 1.2 -> 1.2.1

Adapted HalLinkDiscoverer to stricter checking of JSONPath expression.
2015-02-26 15:08:05 +01:00
Oliver Gierke
1953e6400b #304 - Added build profiles for Spring 4.x versions.
Also added config file for Travis CI build. Adapted test cases to mitigate API changes.
2015-02-26 14:56:19 +01:00
Oliver Gierke
bf9584f91e #281 - UriTemplate now has convenience method to add a single template variable. 2015-02-10 19:48:56 +01:00
Oliver Gierke
629028a7ef #236, #286 - Added test case to show how to add empty embedded collections. 2015-02-10 15:28:13 +01:00
Ori Schwartz
ea4c1064c1 #273 - Fixed assertion in UriTemplate. 2015-02-10 14:59:47 +01:00
Oliver Gierke
a90e2f32c3 #286 - EmbeddedWrappers now allows empty collections if a rel or type is provided.
EmbeddedWrappers.wrap(Object, String) now allows empty collections. Also a new emptyCollectionOfType(Class<?>) was introduced to allow the RelProvider kick in and dynamically resolve the lazily.

Added more details to the JavaDoc of EmbeddedWrapper to make clear that we either expect a static rel returned or a type to resolve the rel from. Make HalEmbeddedBuilder detect invalid implementations and reject them although that should never occur if users use EmbeddedWrappers factory.
2015-02-10 14:49:43 +01:00
Oliver Gierke
c41b28e00d #271 - UriTemplate now correctly expands non-optional path segments. 2015-02-10 14:17:33 +01:00
Oliver Gierke
313afe1cc7 #293 - HypermediaSupportBeanDefinitionRegistrar also augments RestTemplates.
We now also augment HttpMessageConverters for RestTemplate Spring beans.
2015-02-10 14:13:29 +01:00
Amr Mostafa
2945e9994f #272 - Fix reference to non-existing interface in readme.
Reference now mentions LinkDiscoverer instead of LinkProvider.
2015-02-10 14:04:11 +01:00
Jeff Stano
3ca6fa5504 #229 - Added support for curies in HalEmbeddedBuilder.
HalEmbeddedBuilder now takes an optional CurieProvider to create namespaced rels for embeddededs.

Original pull request: #233.
2014-12-02 09:20:49 +01:00
Oliver Gierke
994347c005 #257 - Added support for Forwarded and X-Forwarded-Proto headers.
ControllerLinkBuilder now favors the value of the Forwarded and X-Forwarded-Proto header to build the scheme for the link created.

For more information on the Forwarded header, see http://tools.ietf.org/html/rfc7239.

Related issue: #107.
2014-12-02 08:17:17 +01:00
Oliver Gierke
7d0a76a54b #259 - Added test case to show how to use EnableHypermediaSupport from XML. 2014-10-29 12:53:42 +01:00
Oliver Gierke
e84e9a3f5f #224 - Fixed type in readme.
Removed trailing whitespace as well.
2014-08-22 17:38:51 +02:00
Oliver Gierke
0bb2216502 #228 - TemplateVariable now correctly rejects invalid parameters. 2014-08-22 17:14:42 +02:00
Spring Buildmaster
eedd4f06df #216 - Prepare next development iteration. 2014-07-28 00:37:00 -07:00
Spring Buildmaster
c6b65e4717 #216 - Release version 0.16.0.RELEASE. 2014-07-28 00:36:58 -07:00
Oliver Gierke
a1315058cd #216 - Prepare version 0.16.0.RELEASE. 2014-07-28 09:19:01 +02:00
Oliver Gierke
5882fcf0d6 #219 - HAL setup now registers a more strict HttpMessageConverter.
Previously we registered a special HttpMessageConverter with a custom ObjectMapper to deploy the HAL customizations. That converter was added to Spring MVC registered HandlerAdapters and registered as the first converter.

In case Spring MVC handled a request with Accept header */* or no Accept header at all, this meant that this converter kicked in and served HAL even for objects that don't need the customizations.

We now restrict the applicability of that special HttpMessageConverter to subtypes of ResourceSupport so that it will only be chosen if the object to render is of such type.
2014-07-25 10:24:30 +02:00