mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
Javadocs
This commit is contained in:
@@ -16,6 +16,13 @@ public interface LinkRestRepository {
|
|||||||
default boolean isEmbeddableRelation(Object data, String name) {
|
default boolean isEmbeddableRelation(Object data, String name) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines whether a relation can create a link to it on the resource or not
|
||||||
|
* @param data The data for the link
|
||||||
|
* @param name The name of the link
|
||||||
|
* @return A boolean indicating whether it's allowed or not
|
||||||
|
*/
|
||||||
default boolean isLinkableRelation(Object data, String name) {
|
default boolean isLinkableRelation(Object data, String name) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -537,11 +537,23 @@ public class Utils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls on the LinkRepository to ask whether it's allowed to embed said relation
|
||||||
|
* @param resource The current HalResource
|
||||||
|
* @param rel The relation to be asked if it can be embedded
|
||||||
|
* @return A boolean indicating the result
|
||||||
|
*/
|
||||||
private boolean allowEmbeddingFromLinkRepository(HALResource<? extends RestAddressableModel> resource, String rel) {
|
private boolean allowEmbeddingFromLinkRepository(HALResource<? extends RestAddressableModel> resource, String rel) {
|
||||||
return getLinkResourceRepository(resource.getContent().getCategory(),
|
return getLinkResourceRepository(resource.getContent().getCategory(),
|
||||||
resource.getContent().getType(), rel).isEmbeddableRelation(resource.getContent(), rel);
|
resource.getContent().getType(), rel).isEmbeddableRelation(resource.getContent(), rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls on the LinkRepository to ask whether it's allowed to link to said relation
|
||||||
|
* @param resource The current HalResource
|
||||||
|
* @param rel The relation to be asked if it can be linked to
|
||||||
|
* @return A boolean indicating the result
|
||||||
|
*/
|
||||||
private boolean allowLinkingFromLinkRepository(HALResource<? extends RestAddressableModel> resource, String rel) {
|
private boolean allowLinkingFromLinkRepository(HALResource<? extends RestAddressableModel> resource, String rel) {
|
||||||
|
|
||||||
return getLinkResourceRepository(resource.getContent().getCategory(),
|
return getLinkResourceRepository(resource.getContent().getCategory(),
|
||||||
|
Reference in New Issue
Block a user