Class HalLinkFactory<RESOURCE,CONTROLLER>

java.lang.Object
org.dspace.app.rest.link.HalLinkFactory<RESOURCE,CONTROLLER>
Direct Known Subclasses:
AuthenticationTokenHalLinkFactory, AuthnHalLinkFactory, BrowseEntryHalLinkFactory, CollectionResourceWorkflowGroupHalLinkFactory, ContentReportSupportHalLinkFactory, DiscoveryRestHalLinkFactory, DSpaceResourceHalLinkFactory, ExternalSourceEntryHalLinkFactory, ExternalSourceHalLinkFactory, HarvestedCollectionRestHalLinkFactory, OrcidQueueHalLinkFactory, ProcessHalLinkFactory, RelationshipHalLinkFactory, RootHalLinkFactory, SearchConfigurationResourceHalLinkFactory, SearchSupportHalLinkFactory, StatisticsSupportHalLinkFactory, SubmissionCCLicenseUrlResourceHalLinkFactory, SubmissionSectionHalLinkFactory

@Component public abstract class HalLinkFactory<RESOURCE,CONTROLLER> extends Object
This is the factory that will be called to add the links to the hal resources.
  • Constructor Details

    • HalLinkFactory

      public HalLinkFactory()
  • Method Details

    • supports

      public boolean supports(Class clazz)
    • getLinksFor

      public List<org.springframework.hateoas.Link> getLinksFor(HALResource halResource, org.springframework.data.domain.Pageable pageable) throws Exception
      Throws:
      Exception
    • buildLink

      protected <T> org.springframework.hateoas.Link buildLink(String rel, T data)
      Please note that this method could lead to double encoding. See: https://github.com/DSpace/DSpace/issues/8333
    • uriBuilder

      protected <T> UriComponentsBuilder uriBuilder(T data)
    • buildLink

      protected org.springframework.hateoas.Link buildLink(String rel, String href)
    • getMethodOn

      protected CONTROLLER getMethodOn(Object... parameters)
    • getMethodOn

      protected <C> C getMethodOn(Class<C> clazz)
    • addLinks

      protected abstract void addLinks(RESOURCE halResource, org.springframework.data.domain.Pageable pageable, LinkedList<org.springframework.hateoas.Link> list) throws Exception
      Throws:
      Exception
    • getControllerClass

      protected abstract Class<CONTROLLER> getControllerClass()
    • getResourceClass

      protected abstract Class<RESOURCE> getResourceClass()