Class CollectionJsonLinkDiscoverer
java.lang.Object
org.springframework.hateoas.client.JsonPathLinkDiscoverer
org.springframework.hateoas.mediatype.collectionjson.CollectionJsonLinkDiscoverer
- All Implemented Interfaces:
LinkDiscoverer
,org.springframework.plugin.core.Plugin<MediaType>
LinkDiscoverer
implementation based on JSON Collection link structure. NOTE: Since links can appear in two
different places in a Collection+JSON document, this discoverer uses two.- Author:
- Greg Turnquist, Oliver Drotbohm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindLinksWithRel
(LinkRelation relation, InputStream representation) Returns all links with the givenLinkRelation
found in the givenInputStream
representation.findLinksWithRel
(LinkRelation relation, String representation) Returns all links with the givenLinkRelation
found in the givenString
representation.findLinkWithRel
(LinkRelation relation, InputStream representation) Finds a single link with the givenLinkRelation
in the givenInputStream
representation.findLinkWithRel
(LinkRelation relation, String representation) Finds a single link with the givenLinkRelation
in the givenString
representation.Methods inherited from class org.springframework.hateoas.client.JsonPathLinkDiscoverer
extractLink, supports
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.hateoas.client.LinkDiscoverer
findLinksWithRel, findLinksWithRel, findLinkWithRel, findLinkWithRel, findRequiredLinkWithRel, findRequiredLinkWithRel
-
Constructor Details
-
CollectionJsonLinkDiscoverer
public CollectionJsonLinkDiscoverer()
-
-
Method Details
-
findLinkWithRel
Description copied from interface:LinkDiscoverer
Finds a single link with the givenLinkRelation
in the givenString
representation.- Specified by:
findLinkWithRel
in interfaceLinkDiscoverer
- Overrides:
findLinkWithRel
in classJsonPathLinkDiscoverer
- Parameters:
relation
- must not be null.representation
- must not be null.- Returns:
- the first link with the given relation type found, or
Optional.empty()
if none was found.
-
findLinkWithRel
Description copied from interface:LinkDiscoverer
Finds a single link with the givenLinkRelation
in the givenInputStream
representation.- Specified by:
findLinkWithRel
in interfaceLinkDiscoverer
- Overrides:
findLinkWithRel
in classJsonPathLinkDiscoverer
- Parameters:
relation
- must not be null.representation
- must not be null.- Returns:
- the first
Link
with the givenLinkRelation
found, orOptional.empty()
if none was found.
-
findLinksWithRel
Description copied from interface:LinkDiscoverer
Returns all links with the givenLinkRelation
found in the givenString
representation.- Specified by:
findLinksWithRel
in interfaceLinkDiscoverer
- Overrides:
findLinksWithRel
in classJsonPathLinkDiscoverer
- Parameters:
relation
- must not be null.representation
- must not be null.- Returns:
- will never be null.
-
findLinksWithRel
Description copied from interface:LinkDiscoverer
Returns all links with the givenLinkRelation
found in the givenInputStream
representation.- Specified by:
findLinksWithRel
in interfaceLinkDiscoverer
- Overrides:
findLinksWithRel
in classJsonPathLinkDiscoverer
- Parameters:
relation
- must not be null.representation
- must not be null.- Returns:
- will never be null.
-