mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
DS-3533 Drop linkClass; unused
This commit is contained in:
@@ -57,8 +57,7 @@ public class DSpaceResourceHalLinkFactory extends HalLinkFactory<DSpaceResource,
|
||||
if (StringUtils.isBlank(linkRest.method())) {
|
||||
Object linkedObject = readMethod.invoke(data);
|
||||
|
||||
if (linkedObject instanceof RestAddressableModel
|
||||
&& linkRest.linkClass().isAssignableFrom(linkedObject.getClass())) {
|
||||
if (linkedObject instanceof RestAddressableModel) {
|
||||
|
||||
linkToSubResource = utils
|
||||
.linkToSingleResource((RestAddressableModel) linkedObject, name);
|
||||
|
@@ -56,7 +56,7 @@ public class AuthenticationStatusRest extends BaseObjectRest<Integer> {
|
||||
}
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = EPersonRest.class, name = "eperson")
|
||||
@LinkRest(name = "eperson")
|
||||
@JsonIgnore
|
||||
public EPersonRest getEPersonRest() {
|
||||
return ePersonRest;
|
||||
|
@@ -16,12 +16,10 @@ import org.dspace.app.rest.RestResourceController;
|
||||
*/
|
||||
@LinksRest(links = {
|
||||
@LinkRest(name = AuthorityRest.ENTRIES,
|
||||
linkClass = AuthorityEntryRest.class,
|
||||
method = "query"
|
||||
),
|
||||
@LinkRest(
|
||||
name = AuthorityRest.ENTRY,
|
||||
linkClass = AuthorityEntryRest.class,
|
||||
method = "getResource"
|
||||
)
|
||||
})
|
||||
|
@@ -18,12 +18,10 @@ import com.fasterxml.jackson.annotation.JsonProperty.Access;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = BitstreamRest.BUNDLE,
|
||||
linkClass = BundleRest.class,
|
||||
method = "getBundle"
|
||||
),
|
||||
@LinkRest(
|
||||
name = BitstreamRest.FORMAT,
|
||||
linkClass = BitstreamFormatRest.class,
|
||||
method = "getFormat"
|
||||
)
|
||||
})
|
||||
|
@@ -21,12 +21,10 @@ import org.dspace.app.rest.RestResourceController;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = BrowseIndexRest.ITEMS,
|
||||
linkClass = ItemRest.class,
|
||||
method = "listBrowseItems"
|
||||
),
|
||||
@LinkRest(
|
||||
name = BrowseIndexRest.ENTRIES,
|
||||
linkClass = BrowseEntryRest.class,
|
||||
method = "listBrowseEntries"
|
||||
)
|
||||
})
|
||||
|
@@ -18,12 +18,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = BundleRest.BITSTREAMS,
|
||||
linkClass = BitstreamRest.class,
|
||||
method = "getBitstreams"
|
||||
),
|
||||
@LinkRest(
|
||||
name = BundleRest.PRIMARY_BITSTREAM,
|
||||
linkClass = BitstreamRest.class,
|
||||
method = "getPrimaryBitstream"
|
||||
)
|
||||
})
|
||||
|
@@ -17,22 +17,18 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = CollectionRest.DEFAULT_ACCESS_CONDITIONS,
|
||||
linkClass = ResourcePolicyRest.class,
|
||||
method = "getDefaultAccessConditions"
|
||||
),
|
||||
@LinkRest(
|
||||
name = CollectionRest.LICENSE,
|
||||
linkClass = LicenseRest.class,
|
||||
method = "getLicense"
|
||||
),
|
||||
@LinkRest(
|
||||
name = CollectionRest.LOGO,
|
||||
linkClass = BitstreamRest.class,
|
||||
method = "getLogo"
|
||||
),
|
||||
@LinkRest(
|
||||
name = CollectionRest.MAPPED_ITEMS,
|
||||
linkClass = ItemRest.class,
|
||||
method = "getMappedItems"
|
||||
)
|
||||
})
|
||||
|
@@ -17,17 +17,14 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = CommunityRest.COLLECTIONS,
|
||||
linkClass = CollectionRest.class,
|
||||
method = "getCollections"
|
||||
),
|
||||
@LinkRest(
|
||||
name = CommunityRest.LOGO,
|
||||
linkClass = BitstreamRest.class,
|
||||
method = "getLogo"
|
||||
),
|
||||
@LinkRest(
|
||||
name = CommunityRest.SUBCOMMUNITIES,
|
||||
linkClass = CommunityRest.class,
|
||||
method = "getSubcommunities"
|
||||
)
|
||||
})
|
||||
|
@@ -22,7 +22,6 @@ import org.dspace.app.rest.RestResourceController;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = EPersonRest.GROUPS,
|
||||
linkClass = GroupRest.class,
|
||||
method = "getGroups"
|
||||
)
|
||||
})
|
||||
|
@@ -20,7 +20,6 @@ import org.dspace.app.rest.RestResourceController;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = GroupRest.GROUPS,
|
||||
linkClass = GroupRest.class,
|
||||
method = "getGroups"
|
||||
)
|
||||
})
|
||||
|
@@ -156,7 +156,7 @@ public class HarvestedCollectionRest extends BaseObjectRest<Integer> {
|
||||
this.lastHarvested = lastHarvested;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = HarvesterMetadataRest.class, name = "harvestermetadata")
|
||||
@LinkRest(name = "harvestermetadata")
|
||||
@JsonIgnore
|
||||
public HarvesterMetadataRest getMetadataConfigs() {
|
||||
return metadata_configs;
|
||||
|
@@ -19,27 +19,22 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = ItemRest.BUNDLES,
|
||||
linkClass = BundleRest.class,
|
||||
method = "getBundles"
|
||||
),
|
||||
@LinkRest(
|
||||
name = ItemRest.MAPPED_COLLECTIONS,
|
||||
linkClass = CollectionRest.class,
|
||||
method = "getMappedCollections"
|
||||
),
|
||||
@LinkRest(
|
||||
name = ItemRest.OWNING_COLLECTION,
|
||||
linkClass = CollectionRest.class,
|
||||
method = "getOwningCollection"
|
||||
),
|
||||
@LinkRest(
|
||||
name = ItemRest.RELATIONSHIPS,
|
||||
linkClass = RelationshipRest.class,
|
||||
method = "getRelationships"
|
||||
),
|
||||
@LinkRest(
|
||||
name = ItemRest.TEMPLATE_ITEM_OF,
|
||||
linkClass = CollectionRest.class,
|
||||
method = "getTemplateItemOf"
|
||||
)
|
||||
})
|
||||
|
@@ -54,12 +54,4 @@ public @interface LinkRest {
|
||||
* @return the method name, or the empty string if unspecified by the annotation.
|
||||
*/
|
||||
String method() default "";
|
||||
|
||||
/**
|
||||
* The class of object returned by invoking the link method. If a list or page is returned, this should
|
||||
* specify the inner type.
|
||||
*
|
||||
* @return the class.
|
||||
*/
|
||||
Class linkClass();
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ public class RelationshipRest extends BaseObjectRest<Integer> {
|
||||
this.leftId = leftId;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = RelationshipTypeRest.class)
|
||||
@LinkRest
|
||||
@JsonIgnore
|
||||
public RelationshipTypeRest getRelationshipType() {
|
||||
return relationshipType;
|
||||
|
@@ -123,7 +123,7 @@ public class RelationshipTypeRest extends BaseObjectRest<Integer> {
|
||||
this.rightMaxCardinality = rightMaxCardinality;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = EntityTypeRest.class)
|
||||
@LinkRest
|
||||
@JsonIgnore
|
||||
public EntityTypeRest getLeftType() {
|
||||
return leftType;
|
||||
@@ -133,7 +133,7 @@ public class RelationshipTypeRest extends BaseObjectRest<Integer> {
|
||||
this.leftType = leftType;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = EntityTypeRest.class)
|
||||
@LinkRest
|
||||
@JsonIgnore
|
||||
public EntityTypeRest getRightType() {
|
||||
return rightType;
|
||||
|
@@ -48,7 +48,7 @@ public class SubmissionDefinitionRest extends BaseObjectRest<String> {
|
||||
this.panels = panels;
|
||||
}
|
||||
|
||||
@LinkRest(name = SubmissionSectionRest.ATTRIBUTE_NAME, linkClass = SubmissionSectionRest.class)
|
||||
@LinkRest(name = SubmissionSectionRest.ATTRIBUTE_NAME)
|
||||
@JsonIgnore
|
||||
public List<SubmissionSectionRest> getPanels() {
|
||||
return panels;
|
||||
@@ -77,7 +77,7 @@ public class SubmissionDefinitionRest extends BaseObjectRest<String> {
|
||||
return CATEGORY;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = CollectionRest.class)
|
||||
@LinkRest
|
||||
@JsonIgnore
|
||||
public List<CollectionRest> getCollections() {
|
||||
return collections;
|
||||
|
@@ -16,17 +16,14 @@ import org.dspace.app.rest.projection.Projection;
|
||||
@LinksRest(links = {
|
||||
@LinkRest(
|
||||
name = MockObjectRest.O_CHILDREN,
|
||||
linkClass = MockObjectRest.class,
|
||||
method = "getMockObjectChildren"
|
||||
),
|
||||
@LinkRest(
|
||||
name = MockObjectRest.A_CHILDREN,
|
||||
linkClass = MockObjectRest.class,
|
||||
method = "getMockObjectChildren"
|
||||
),
|
||||
@LinkRest(
|
||||
name = MockObjectRest.N_CHILDREN,
|
||||
linkClass = MockObjectRest.class,
|
||||
method = "getMockObjectChildren"
|
||||
)
|
||||
})
|
||||
@@ -87,7 +84,7 @@ public class MockObjectRest extends BaseObjectRest<Long> {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = MockObjectRest.class)
|
||||
@LinkRest
|
||||
public MockObjectRest getRestProp1() {
|
||||
return restProp1;
|
||||
}
|
||||
@@ -96,7 +93,7 @@ public class MockObjectRest extends BaseObjectRest<Long> {
|
||||
this.restProp1 = restProp1;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = MockObjectRest.class)
|
||||
@LinkRest
|
||||
public MockObjectRest getRestProp2() {
|
||||
return restProp2;
|
||||
}
|
||||
@@ -105,7 +102,7 @@ public class MockObjectRest extends BaseObjectRest<Long> {
|
||||
this.restProp2 = restProp2;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = MockObjectRest.class)
|
||||
@LinkRest
|
||||
public MockObjectRest getRestProp3() {
|
||||
return restProp3;
|
||||
}
|
||||
@@ -114,7 +111,7 @@ public class MockObjectRest extends BaseObjectRest<Long> {
|
||||
this.restProp3 = restProp3;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = MockObjectRest.class)
|
||||
@LinkRest
|
||||
public MockObjectRest getRestProp4() {
|
||||
return restProp4;
|
||||
}
|
||||
@@ -123,7 +120,7 @@ public class MockObjectRest extends BaseObjectRest<Long> {
|
||||
this.restProp4 = restProp4;
|
||||
}
|
||||
|
||||
@LinkRest(linkClass = MockObjectRest.class, name = "restPropFive")
|
||||
@LinkRest(name = "restPropFive")
|
||||
public MockObjectRest getRestProp5() {
|
||||
return restProp5;
|
||||
}
|
||||
|
Reference in New Issue
Block a user