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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindLinksWithRel(LinkRelation relation, InputStream representation) Returns all links with the givenLinkRelationfound in the givenInputStreamrepresentation.findLinksWithRel(LinkRelation relation, String representation) Returns all links with the givenLinkRelationfound in the givenStringrepresentation.findLinkWithRel(LinkRelation relation, InputStream representation) Finds a single link with the givenLinkRelationin the givenInputStreamrepresentation.findLinkWithRel(LinkRelation relation, String representation) Finds a single link with the givenLinkRelationin the givenStringrepresentation.Methods inherited from class org.springframework.hateoas.client.JsonPathLinkDiscoverer
extractLink, supportsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:LinkDiscovererFinds a single link with the givenLinkRelationin the givenStringrepresentation.- Specified by:
findLinkWithRelin interfaceLinkDiscoverer- Overrides:
findLinkWithRelin 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:LinkDiscovererFinds a single link with the givenLinkRelationin the givenInputStreamrepresentation.- Specified by:
findLinkWithRelin interfaceLinkDiscoverer- Overrides:
findLinkWithRelin classJsonPathLinkDiscoverer- Parameters:
relation- must not be null.representation- must not be null.- Returns:
- the first
Linkwith the givenLinkRelationfound, orOptional.empty()if none was found.
-
findLinksWithRel
Description copied from interface:LinkDiscovererReturns all links with the givenLinkRelationfound in the givenStringrepresentation.- Specified by:
findLinksWithRelin interfaceLinkDiscoverer- Overrides:
findLinksWithRelin classJsonPathLinkDiscoverer- Parameters:
relation- must not be null.representation- must not be null.- Returns:
- will never be null.
-
findLinksWithRel
Description copied from interface:LinkDiscovererReturns all links with the givenLinkRelationfound in the givenInputStreamrepresentation.- Specified by:
findLinksWithRelin interfaceLinkDiscoverer- Overrides:
findLinksWithRelin classJsonPathLinkDiscoverer- Parameters:
relation- must not be null.representation- must not be null.- Returns:
- will never be null.
-