@@ -75,10 +75,6 @@ public class Path {
|
||||
return slash(path.toString());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return path.hashCode();
|
||||
@@ -101,19 +97,11 @@ public class Path {
|
||||
return trimmed.contains("://") ? trimmed : SLASH + trimmed;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
|
||||
@@ -31,10 +31,6 @@ public enum StringToLdapNameConverter implements Converter<String, Name> {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public LdapName convert(String source) {
|
||||
|
||||
|
||||
@@ -81,29 +81,17 @@ public class UriToEntityConverter implements ConditionalGenericConverter {
|
||||
this.repositories = repositories;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.ConditionalConverter#matches(org.springframework.core.convert.TypeDescriptor, org.springframework.core.convert.TypeDescriptor)
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
return !sourceType.equals(URI_TYPE) ? false
|
||||
: repositories.getRepositoryInformationFor(targetType.getType()).isPresent();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.GenericConverter#getConvertibleTypes()
|
||||
*/
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return convertiblePairs;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.GenericConverter#convert(java.lang.Object, org.springframework.core.convert.TypeDescriptor, org.springframework.core.convert.TypeDescriptor)
|
||||
*/
|
||||
@Override
|
||||
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
|
||||
|
||||
@@ -64,10 +64,6 @@ public class ValidationErrors extends AbstractPropertyBindingResult {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.validation.AbstractPropertyBindingResult#getPropertyAccessor()
|
||||
*/
|
||||
@Override
|
||||
public ConfigurablePropertyAccessor getPropertyAccessor() {
|
||||
|
||||
@@ -109,10 +105,6 @@ public class ValidationErrors extends AbstractPropertyBindingResult {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.validation.AbstractBindingResult#getTarget()
|
||||
*/
|
||||
@Override
|
||||
public Object getTarget() {
|
||||
return source;
|
||||
|
||||
@@ -43,10 +43,6 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
private final List<LookupInformation<Object, Object, Repository<? extends Object, ?>>> lookupInformation = new ArrayList<>();
|
||||
private final List<Class<?>> lookupTypes = new ArrayList<>();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar#forRepository(java.lang.Class, org.springframework.core.convert.converter.Converter, org.springframework.data.rest.core.config.EntityLookupRegistrar.LookupRegistrar.Lookup)
|
||||
*/
|
||||
@Override
|
||||
public <T, ID, R extends Repository<T, ?>> EntityLookupRegistrar forRepository(Class<R> repositoryType,
|
||||
Converter<T, ID> converter, Lookup<R, ID> lookup) {
|
||||
@@ -56,10 +52,6 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar#forValueRepository(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T, ID, R extends Repository<T, ?>> IdMappingRegistrar<T, R> forLookupRepository(Class<R> type) {
|
||||
|
||||
@@ -68,19 +60,11 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
return forRepository(type);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar#forRepository(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T, ID, R extends Repository<T, ?>> IdMappingRegistrar<T, R> forRepository(Class<R> type) {
|
||||
return new MappingBuilder<T, ID, R>(type);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar#forValueRepository(java.lang.Class, org.springframework.core.convert.converter.Converter, org.springframework.data.rest.core.config.EntityLookupRegistrar.LookupRegistrar.Lookup)
|
||||
*/
|
||||
@Override
|
||||
public <T, ID, R extends Repository<T, ?>> EntityLookupRegistrar forValueRepository(Class<R> type,
|
||||
Converter<T, ID> identifierMapping, Lookup<R, ID> lookup) {
|
||||
@@ -125,10 +109,6 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
this.idMapping = mapping;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar.LookupRegistrar#withLookup(org.springframework.data.rest.core.config.EntityLookupRegistrar.LookupRegistrar.Lookup)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public EntityLookupRegistrar withLookup(Lookup<R, ID> lookup) {
|
||||
@@ -140,10 +120,6 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
return EntityLookupConfiguration.this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EntityLookupRegistrar.IdMappingRegistrar#withIdMapping(org.springframework.core.convert.converter.Converter)
|
||||
*/
|
||||
@Override
|
||||
public <ID2> LookupRegistrar<T, ID2, R> withIdMapping(Converter<T, ID2> idMapping) {
|
||||
return new MappingBuilder<T, ID2, R>(repositoryType, idMapping);
|
||||
@@ -207,19 +183,11 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
MethodInvocationRecorder.forProxyOf(it).record(lookupInfo.identifierMapping::convert).getPropertyPath());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.support.EntityLookup#getResourceIdentifier(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object getResourceIdentifier(T entity) {
|
||||
return lookupInfo.getIdentifierMapping().convert(entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.support.EntityLookup#lookupEntity(java.io.Serializable)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Optional<T> lookupEntity(Object id) {
|
||||
@@ -229,19 +197,11 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
return Optional.class.isInstance(result) ? (Optional<T>) result : Optional.ofNullable((T) result);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> delimiter) {
|
||||
return domainType.isAssignableFrom(delimiter);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.support.EntityLookup#getLookupProperty()
|
||||
*/
|
||||
public Optional<String> getLookupProperty() {
|
||||
return this.lookupProperty;
|
||||
}
|
||||
@@ -277,10 +237,6 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
return this.lookup;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
|
||||
@@ -299,20 +255,11 @@ class EntityLookupConfiguration implements EntityLookupRegistrar {
|
||||
&& Objects.equals(getLookup(), that.getLookup());
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getRepositoryType(), getIdentifierMapping(), getLookup());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "EntityLookupConfiguration.LookupInformation(repositoryType=" + this.getRepositoryType()
|
||||
|
||||
@@ -29,10 +29,6 @@ public enum JsonSchemaFormat {
|
||||
|
||||
EMAIL, DATE_TIME, HOSTNAME, IPV4, IPV6, URI;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Enum#toString()
|
||||
*/
|
||||
@JsonValue
|
||||
public String toString() {
|
||||
return name().toLowerCase(Locale.US).replaceAll("_", "-");
|
||||
|
||||
@@ -47,10 +47,6 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions
|
||||
this.projectionDefinitions = new HashSet<>();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.projection.ProjectionDefinitions#getParameterName()
|
||||
*/
|
||||
public String getParameterName() {
|
||||
return parameterName;
|
||||
}
|
||||
@@ -128,19 +124,11 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.ProjectionDefinitions#getProjectionType(java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getProjectionType(Class<?> sourceType, String name) {
|
||||
return getProjectionsFor(sourceType).get(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.projection.ProjectionDefinitions#hasProjectionFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasProjectionFor(Class<?> sourceType) {
|
||||
|
||||
@@ -236,10 +224,6 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -258,19 +242,11 @@ public class ProjectionDefinitionConfiguration implements ProjectionDefinitions
|
||||
&& Objects.equals(getName(), that.getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getSourceType(), getTargetType(), getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "ProjectionDefinitionConfiguration.ProjectionDefinition(sourceType=" + this.getSourceType()
|
||||
|
||||
@@ -30,10 +30,6 @@ public abstract class AbstractRepositoryEventListener<T> implements ApplicationL
|
||||
|
||||
private final Class<?> INTERESTED_TYPE = resolveTypeArgument(getClass(), AbstractRepositoryEventListener.class);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public final void onApplicationEvent(RepositoryEvent event) {
|
||||
|
||||
@@ -52,10 +52,6 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
|
||||
|
||||
private final MultiValueMap<Class<? extends RepositoryEvent>, EventHandlerMethod> handlerMethods = new LinkedMultiValueMap<Class<? extends RepositoryEvent>, EventHandlerMethod>();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(RepositoryEvent event) {
|
||||
|
||||
@@ -88,19 +84,11 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(final Object bean, String beanName) throws BeansException {
|
||||
|
||||
@@ -197,19 +185,11 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
|
||||
return new EventHandlerMethod(targetType, method, handler);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(EventHandlerMethod o) {
|
||||
return AnnotationAwareOrderComparator.INSTANCE.compare(this.method, o.method);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
|
||||
@@ -228,19 +208,11 @@ public class AnnotatedEventHandlerInvoker implements ApplicationListener<Reposit
|
||||
&& Objects.equals(handler, other.handler);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(targetType, method, handler);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "AnnotatedEventHandlerInvoker.EventHandlerMethod(targetType=" + this.targetType + ", method=" + this.method
|
||||
|
||||
@@ -87,73 +87,41 @@ public class ValidatingRepositoryEventListener extends AbstractRepositoryEventLi
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onBeforeCreate(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onBeforeCreate(Object entity) {
|
||||
validate("beforeCreate", entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onAfterCreate(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onAfterCreate(Object entity) {
|
||||
validate("afterCreate", entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onBeforeSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onBeforeSave(Object entity) {
|
||||
validate("beforeSave", entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onAfterSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onAfterSave(Object entity) {
|
||||
validate("afterSave", entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onBeforeLinkSave(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onBeforeLinkSave(Object parent, Object linked) {
|
||||
validate("beforeLinkSave", parent);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onAfterLinkSave(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onAfterLinkSave(Object parent, Object linked) {
|
||||
validate("afterLinkSave", parent);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onBeforeDelete(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onBeforeDelete(Object entity) {
|
||||
validate("beforeDelete", entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onAfterDelete(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onAfterDelete(Object entity) {
|
||||
validate("afterDelete", entity);
|
||||
|
||||
@@ -55,19 +55,11 @@ public class AnnotationBasedResourceDescription extends ResolvableResourceDescri
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getCodes()
|
||||
*/
|
||||
@Override
|
||||
public String[] getCodes() {
|
||||
return fallback.getCodes();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceDescription#getMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return StringUtils.hasText(message) ? message : fallback.getMessage();
|
||||
@@ -80,10 +72,6 @@ public class AnnotationBasedResourceDescription extends ResolvableResourceDescri
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceDescription#isDefault()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDefault() {
|
||||
return !StringUtils.hasText(message);
|
||||
|
||||
@@ -115,10 +115,6 @@ public class ConfigurableHttpMethods implements HttpMethods {
|
||||
return ConfigurableHttpMethods.of(Stream.concat(this.methods.stream(), toAdd.stream()).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.HttpMethods#contains(org.springframework.http.HttpMethod)
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(HttpMethod method) {
|
||||
|
||||
@@ -127,10 +123,6 @@ public class ConfigurableHttpMethods implements HttpMethods {
|
||||
return methods.contains(method);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<HttpMethod> iterator() {
|
||||
return methods.iterator();
|
||||
|
||||
@@ -45,10 +45,6 @@ class ConfigurationApplyingSupportedHttpMethodsAdapter implements SupportedHttpM
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getMethodsFor(org.springframework.data.rest.core.mapping.ResourceType)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(ResourceType type) {
|
||||
|
||||
@@ -57,10 +53,6 @@ class ConfigurationApplyingSupportedHttpMethodsAdapter implements SupportedHttpM
|
||||
return configuration.filter(ConfigurableHttpMethods.of(methods), type, resourceMetadata);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getMethodsFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(PersistentProperty<?> property) {
|
||||
|
||||
@@ -76,10 +68,6 @@ class ConfigurationApplyingSupportedHttpMethodsAdapter implements SupportedHttpM
|
||||
return configuration.filter(methods, PropertyAwareResourceMapping.class.cast(mapping));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#allowsPutForCreation()
|
||||
*/
|
||||
@Override
|
||||
public boolean allowsPutForCreation() {
|
||||
return configuration.allowsPutForCreation(resourceMetadata);
|
||||
|
||||
@@ -55,10 +55,6 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods {
|
||||
this.exposedMethods = new DefaultExposureAwareCrudMethods(crudMethods, methodsExposedByDefault);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getSupportedHttpMethods(org.springframework.data.rest.core.mapping.ResourceType)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(ResourceType resourceType) {
|
||||
|
||||
@@ -107,10 +103,6 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods {
|
||||
return HttpMethods.of(methods);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getMethodsFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(PersistentProperty<?> property) {
|
||||
|
||||
@@ -159,37 +151,21 @@ public class CrudMethodsSupportedHttpMethods implements SupportedHttpMethods {
|
||||
this.exportedDefault = exportedDefault;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureAwareCrudMethods#exposesSave()
|
||||
*/
|
||||
@Override
|
||||
public boolean exposesSave() {
|
||||
return exposesSave.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureAwareCrudMethods#exposesDelete()
|
||||
*/
|
||||
@Override
|
||||
public boolean exposesDelete() {
|
||||
return exposesDelete.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureAwareCrudMethods#exposesFindOne()
|
||||
*/
|
||||
@Override
|
||||
public boolean exposesFindOne() {
|
||||
return exposesFindOne.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureAwareCrudMethods#exposesFindAll()
|
||||
*/
|
||||
@Override
|
||||
public boolean exposesFindAll() {
|
||||
return exposesFindAll.get();
|
||||
|
||||
@@ -36,10 +36,6 @@ class EvoInflectorTypeBasedCollectionResourceMapping extends TypeBasedCollection
|
||||
super(type, relProvider);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.TypeBasedCollectionResourceMapping#getDefaultPathFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
protected String getDefaultPathFor(Class<?> type) {
|
||||
return English.plural(super.getDefaultPathFor(type));
|
||||
|
||||
@@ -41,10 +41,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
|
||||
private Function<Class<?>, Boolean> creationViaPut = __ -> true;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#withCollectionExposure(org.springframework.data.rest.core.mapping.ExposureConfigurer.AggregateResourceHttpMethodsFilter)
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfiguration withCollectionExposure(AggregateResourceHttpMethodsFilter filter) {
|
||||
|
||||
@@ -52,10 +48,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#withItemExposure(org.springframework.data.rest.core.mapping.ExposureConfigurer.AggregateResourceHttpMethodsFilter)
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfiguration withItemExposure(AggregateResourceHttpMethodsFilter filter) {
|
||||
|
||||
@@ -63,10 +55,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#withAssociationExposure(org.springframework.data.rest.core.mapping.ExposureConfigurer.AssociationResourceHttpMethodsFilter)
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfiguration withAssociationExposure(AssociationResourceHttpMethodsFilter filter) {
|
||||
|
||||
@@ -74,10 +62,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#disablePutForCreation()
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfiguration disablePutForCreation() {
|
||||
|
||||
@@ -191,10 +175,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#withCollectionExposure(org.springframework.data.rest.core.mapping.ExposureConfigurer.AggregateResourceHttpMethodsFilter)
|
||||
*/
|
||||
public ExposureConfigurer withCollectionExposure(AggregateResourceHttpMethodsFilter filter) {
|
||||
|
||||
ExposureConfiguration config = ExposureConfiguration.this;
|
||||
@@ -203,10 +183,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#withItemExposure(org.springframework.data.rest.core.mapping.ExposureConfigurer.AggregateResourceHttpMethodsFilter)
|
||||
*/
|
||||
public ExposureConfigurer withItemExposure(AggregateResourceHttpMethodsFilter filter) {
|
||||
|
||||
ExposureConfiguration config = ExposureConfiguration.this;
|
||||
@@ -215,10 +191,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfiguration.ExposureConfigurer#withAssociationExposure(java.util.function.BiFunction)
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfigurer withAssociationExposure(AssociationResourceHttpMethodsFilter filter) {
|
||||
|
||||
@@ -233,10 +205,6 @@ public class ExposureConfiguration implements ExposureConfigurer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ExposureConfigurer#disableCreationViaPut()
|
||||
*/
|
||||
@Override
|
||||
public ExposureConfigurer disablePutForCreation() {
|
||||
|
||||
|
||||
@@ -61,64 +61,36 @@ class MappingResourceMetadata extends TypeBasedCollectionResourceMapping impleme
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getDomainType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getDomainType() {
|
||||
return entity.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#isExported(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported(PersistentProperty<?> property) {
|
||||
return getMappingFor(property).isExported();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getMappingFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public ResourceMapping getMappingFor(PersistentProperty<?> property) {
|
||||
return propertyMappings.getMappingFor(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getSearchResourceMappings()
|
||||
*/
|
||||
@Override
|
||||
public SearchResourceMappings getSearchResourceMappings() {
|
||||
return new SearchResourceMappings(Collections.<MethodResourceMapping> emptyList());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getSupportedHttpMethods()
|
||||
*/
|
||||
@Override
|
||||
public SupportedHttpMethods getSupportedHttpMethods() {
|
||||
return NoSupportedMethods.INSTANCE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.RootResourceMetadata#getProperty(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public PropertyAwareResourceMapping getProperty(String mappedPath) {
|
||||
return propertyMappings.getMappingFor(mappedPath);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.TypeBasedCollectionResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return explicitlyExported;
|
||||
@@ -148,19 +120,11 @@ class MappingResourceMetadata extends TypeBasedCollectionResourceMapping impleme
|
||||
this.propertyMappings = new HashMap<PersistentProperty<?>, PropertyAwareResourceMapping>();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimpleAssociationHandler#doWithAssociation(org.springframework.data.mapping.Association)
|
||||
*/
|
||||
@Override
|
||||
public void doWithAssociation(Association<? extends PersistentProperty<?>> association) {
|
||||
doWithPersistentProperty(association.getInverse());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimplePropertyHandler#doWithPersistentProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public void doWithPersistentProperty(PersistentProperty<?> property) {
|
||||
|
||||
|
||||
@@ -70,10 +70,6 @@ public final class ParameterMetadata {
|
||||
return description;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
@@ -89,10 +85,6 @@ public final class ParameterMetadata {
|
||||
return this.name.equals(that.name) && this.description.equals(that.description);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
|
||||
@@ -58,10 +58,6 @@ public class ParametersMetadata implements Iterable<ParameterMetadata> {
|
||||
return names;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<ParameterMetadata> iterator() {
|
||||
return parameterMetadata.iterator();
|
||||
|
||||
@@ -53,10 +53,6 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
this.entities = entities;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#getMappingFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public ResourceMetadata getMetadataFor(Class<?> type) {
|
||||
|
||||
@@ -85,19 +81,11 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#getSearchResourceMappings(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public SearchResourceMappings getSearchResourceMappings(Class<?> domainType) {
|
||||
return searchResourceMappings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#exportsMappingFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean exportsMappingFor(Class<?> type) {
|
||||
|
||||
@@ -109,10 +97,6 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
return metadata.isExported();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#exportsTopLevelResourceFor(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean exportsTopLevelResourceFor(String path) {
|
||||
|
||||
@@ -127,19 +111,11 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#hasMappingFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasMappingFor(Class<?> type) {
|
||||
return getMappingMetadataFor(type) != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadataProvider#getMappingFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
public ResourceMapping getMappingFor(PersistentProperty<?> property) {
|
||||
return propertyCache.computeIfAbsent(property, it -> new PersistentPropertyResourceMapping(property, this));
|
||||
}
|
||||
@@ -150,10 +126,6 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
return metadata != null && metadata.isExported();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<ResourceMetadata> iterator() {
|
||||
|
||||
|
||||
@@ -55,10 +55,6 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping
|
||||
this.description = Optional.ofNullable(property.findAnnotation(Description.class));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
|
||||
@@ -67,10 +63,6 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping
|
||||
.orElseGet(() -> new Path(property.getName()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
|
||||
@@ -79,10 +71,6 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping
|
||||
.orElseGet(() -> property.getName()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
|
||||
@@ -97,19 +85,11 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping
|
||||
: false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
|
||||
@@ -122,10 +102,6 @@ class PersistentPropertyResourceMapping implements PropertyAwareResourceMapping
|
||||
.orElse(fallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.PropertyAwareResourceMapping#getProperty()
|
||||
*/
|
||||
@Override
|
||||
public PersistentProperty<?> getProperty() {
|
||||
return property;
|
||||
|
||||
@@ -77,19 +77,11 @@ class RepositoryAwareResourceMetadata implements ResourceMetadata {
|
||||
return AnnotationUtils.findAnnotation(repositoryMetadata.getRepositoryInterface(), Primary.class) != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getDomainType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getDomainType() {
|
||||
return repositoryMetadata.getDomainType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.RootResourceMetadata#getProperty(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public PropertyAwareResourceMapping getProperty(String mappedPath) {
|
||||
|
||||
@@ -100,109 +92,61 @@ class RepositoryAwareResourceMetadata implements ResourceMetadata {
|
||||
return mappingMetadata.getProperty(mappedPath);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadataProvider#getMappingFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public ResourceMapping getMappingFor(PersistentProperty<?> property) {
|
||||
return provider.getMappingFor(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadataProvider#hasMappingFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported(PersistentProperty<?> property) {
|
||||
return provider.isMapped(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return mapping.isExported();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getCollectionRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
return mapping.getRel();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getSingleResourceRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getItemResourceRel() {
|
||||
return mapping.getItemResourceRel();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return mapping.getPath();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return mapping.isPagingResource();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
return mapping.getDescription();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getItemResourceDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getItemResourceDescription() {
|
||||
return mapping.getItemResourceDescription();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getExcerptProjection()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Class<?>> getExcerptProjection() {
|
||||
return mapping.getExcerptProjection();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getSearchResourceMappings()
|
||||
*/
|
||||
@Override
|
||||
public SearchResourceMappings getSearchResourceMappings() {
|
||||
return provider.getSearchResourceMappings(repositoryMetadata.getDomainType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMetadata#getSupportedHttpMethods()
|
||||
*/
|
||||
@Override
|
||||
public SupportedHttpMethods getSupportedHttpMethods() {
|
||||
return crudMethodsSupportedHttpMethods;
|
||||
|
||||
@@ -145,73 +145,41 @@ class RepositoryCollectionResourceMapping implements CollectionResourceMapping {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
return rel.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getSingleResourceRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getItemResourceRel() {
|
||||
return itemResourceRel.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return repositoryExported;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return metadata.isPagingRepository();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
return description.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getItemResourceDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getItemResourceDescription() {
|
||||
return itemDescription.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getExcerptProjection()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Class<?>> getExcerptProjection() {
|
||||
return excerptProjection.getOptional();
|
||||
|
||||
@@ -102,82 +102,46 @@ class RepositoryMethodResourceMapping implements MethodResourceMapping {
|
||||
return Collections.unmodifiableList(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return isExported;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
return rel;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.MethodResourceMapping#getMethod()
|
||||
*/
|
||||
@Override
|
||||
public Method getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.MethodResourceMapping#getParameterMetadata()
|
||||
*/
|
||||
@Override
|
||||
public ParametersMetadata getParametersMetadata() {
|
||||
return new ParametersMetadata(parameterMetadata);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return paging;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.MethodResourceMapping#isSortableResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isSortableResource() {
|
||||
return sorting;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.MethodResourceMapping#getProjectionSourceType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getReturnedDomainType() {
|
||||
return metadata.getReturnedDomainClass(method);
|
||||
|
||||
@@ -93,10 +93,6 @@ public class RepositoryResourceMappings extends PersistentEntitiesResourceMappin
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#getSearchResourceMappings(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public SearchResourceMappings getSearchResourceMappings(Class<?> domainType) {
|
||||
|
||||
@@ -125,10 +121,6 @@ public class RepositoryResourceMappings extends PersistentEntitiesResourceMappin
|
||||
return searchResourceMappings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMappings#hasMappingFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasMappingFor(Class<?> type) {
|
||||
|
||||
@@ -143,10 +135,6 @@ public class RepositoryResourceMappings extends PersistentEntitiesResourceMappin
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.PersistentEntitiesResourceMappings#isMapped(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public boolean isMapped(PersistentProperty<?> property) {
|
||||
return repositories.hasRepositoryFor(property.getActualType()) && super.isMapped(property);
|
||||
|
||||
@@ -24,19 +24,11 @@ import org.springframework.context.MessageSourceResolvable;
|
||||
*/
|
||||
public abstract class ResolvableResourceDescriptionSupport implements ResourceDescription {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getArguments()
|
||||
*/
|
||||
@Override
|
||||
public Object[] getArguments() {
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getDefaultMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getDefaultMessage() {
|
||||
return null;
|
||||
|
||||
@@ -130,55 +130,31 @@ public class SearchResourceMappings implements Iterable<MethodResourceMapping>,
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return PATH;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
return REL;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return !mappings.isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<MethodResourceMapping> iterator() {
|
||||
return mappings.values().iterator();
|
||||
|
||||
@@ -50,34 +50,18 @@ public class SimpleResourceDescription extends ResolvableResourceDescriptionSupp
|
||||
return new SimpleResourceDescription(String.format("%s.%s", DEFAULT_KEY_PREFIX, rel.value()), DEFAULT_MEDIA_TYPE);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceDescription#getMessage()
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceDescription#getType()
|
||||
*/
|
||||
public MediaType getType() {
|
||||
return mediaType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceDescription#isDefault()
|
||||
*/
|
||||
public boolean isDefault() {
|
||||
return StringUtils.hasText(message) && message.startsWith(DEFAULT_KEY_PREFIX);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getCodes()
|
||||
*/
|
||||
@Override
|
||||
public String[] getCodes() {
|
||||
return new String[] { message };
|
||||
|
||||
@@ -59,28 +59,16 @@ public interface SupportedHttpMethods {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getSupportedHttpMethods(org.springframework.data.rest.core.mapping.ResourceType)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(ResourceType resourcType) {
|
||||
return HttpMethods.none();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#getMethodsFor(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public HttpMethods getMethodsFor(PersistentProperty<?> property) {
|
||||
return HttpMethods.none();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.SupportedHttpMethods#allowsPutForCreation()
|
||||
*/
|
||||
@Override
|
||||
public boolean allowsPutForCreation() {
|
||||
return false;
|
||||
|
||||
@@ -109,19 +109,11 @@ class TypeBasedCollectionResourceMapping implements CollectionResourceMapping {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getPath()
|
||||
*/
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return path.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#isExported()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
|
||||
@@ -130,55 +122,31 @@ class TypeBasedCollectionResourceMapping implements CollectionResourceMapping {
|
||||
.orElseGet(() -> Modifier.isPublic(type.getModifiers()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getRel() {
|
||||
return rel.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getSingleResourceRel()
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getItemResourceRel() {
|
||||
return relProvider.getItemResourceRelFor(type);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#isPagingResource()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPagingResource() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResourceMapping#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getDescription() {
|
||||
return description.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getItemResourceDescription()
|
||||
*/
|
||||
@Override
|
||||
public ResourceDescription getItemResourceDescription() {
|
||||
return itemResourceDescription.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.CollectionResourceMapping#getExcerptProjection()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Class<?>> getExcerptProjection() {
|
||||
return Optional.empty();
|
||||
|
||||
@@ -63,19 +63,11 @@ public class TypedResourceDescription extends SimpleResourceDescription {
|
||||
return new TypedResourceDescription(message, DEFAULT_MEDIA_TYPE, type);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResolvableResourceDescriptionSupport#getArguments()
|
||||
*/
|
||||
@Override
|
||||
public Object[] getArguments() {
|
||||
return type.isEnum() ? new Object[] { getEnumValues(type) } : new Object[0];
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.mapping.ResolvableResourceDescriptionSupport#getDefaultMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getDefaultMessage() {
|
||||
return type.isEnum() ? getEnumValues(type) : null;
|
||||
|
||||
@@ -63,10 +63,6 @@ public class DefaultSelfLinkProvider implements SelfLinkProvider {
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.support.SelfLinkProvider#createSelfLinkFor(java.lang.Object)
|
||||
*/
|
||||
public Link createSelfLinkFor(Object instance) {
|
||||
|
||||
Assert.notNull(instance, "Domain object must not be null!");
|
||||
@@ -74,10 +70,6 @@ public class DefaultSelfLinkProvider implements SelfLinkProvider {
|
||||
return createSelfLinkFor(instance.getClass(), instance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.support.SelfLinkProvider#createSelfLinkFor(java.lang.Class, java.lang.Object)
|
||||
*/
|
||||
public Link createSelfLinkFor(Class<?> type, Object reference) {
|
||||
|
||||
if (type.isInstance(reference)) {
|
||||
|
||||
@@ -36,10 +36,6 @@ public abstract class EntityLookupSupport<T> implements EntityLookup<T> {
|
||||
this.domainType = GenericTypeResolver.resolveTypeArgument(getClass(), EntityLookup.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> delimiter) {
|
||||
return domainType.isAssignableFrom(delimiter);
|
||||
|
||||
@@ -44,28 +44,16 @@ public class RepositoryRelProvider implements LinkRelationProvider {
|
||||
this.mappings = mappings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.LinkRelationProvider#getCollectionResourceRelFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getCollectionResourceRelFor(Class<?> type) {
|
||||
return mappings.getObject().getMetadataFor(type).getRel();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.LinkRelationProvider#getItemResourceRelFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getItemResourceRelFor(Class<?> type) {
|
||||
return mappings.getObject().getMetadataFor(type).getItemResourceRel();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(LookupContext context) {
|
||||
return mappings.getObject().hasMappingFor(context.getType());
|
||||
|
||||
@@ -24,19 +24,11 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class SimpleRelProvider implements LinkRelationProvider {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(LookupContext context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.LinkRelationProvider#getItemResourceRelFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getItemResourceRelFor(Class<?> type) {
|
||||
|
||||
@@ -44,10 +36,6 @@ public class SimpleRelProvider implements LinkRelationProvider {
|
||||
return LinkRelation.of(String.format("%s.%s", collectionRel.value(), collectionRel.value()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.LinkRelationProvider#getCollectionResourceRelFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public LinkRelation getCollectionResourceRelFor(Class<?> type) {
|
||||
return LinkRelation.of(StringUtils.uncapitalize(type.getSimpleName()));
|
||||
|
||||
@@ -54,10 +54,6 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact
|
||||
this.lookups = PluginRegistry.of(lookups);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvokerFactory#getInvokerFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public RepositoryInvoker getInvokerFor(Class<?> domainType) {
|
||||
|
||||
@@ -86,10 +82,6 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact
|
||||
this.lookup = lookup;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindOne(java.io.Serializable)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> Optional<T> invokeFindById(Object id) {
|
||||
@@ -99,83 +91,47 @@ public class UnwrappingRepositoryInvokerFactory implements RepositoryInvokerFact
|
||||
: delegate.invokeFindById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeQueryMethod(java.lang.reflect.Method, org.springframework.util.MultiValueMap, org.springframework.data.domain.Pageable, org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Optional<Object> invokeQueryMethod(Method method, MultiValueMap<String, ? extends Object> parameters,
|
||||
Pageable pageable, Sort sort) {
|
||||
return delegate.invokeQueryMethod(method, parameters, pageable, sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasDeleteMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasDeleteMethod() {
|
||||
return delegate.hasDeleteMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindAllMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindAllMethod() {
|
||||
return delegate.hasFindAllMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindOneMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindOneMethod() {
|
||||
return delegate.hasFindOneMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasSaveMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasSaveMethod() {
|
||||
return delegate.hasSaveMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeDeleteById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void invokeDeleteById(Object id) {
|
||||
delegate.invokeDeleteById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindAll(org.springframework.data.domain.Pageable)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Pageable pageable) {
|
||||
return delegate.invokeFindAll(pageable);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindAll(org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Sort sort) {
|
||||
return delegate.invokeFindAll(sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> T invokeSave(T object) {
|
||||
return delegate.invokeSave(object);
|
||||
|
||||
@@ -25,18 +25,10 @@ import org.springframework.data.repository.CrudRepository;
|
||||
*/
|
||||
public interface OrderRepository extends CrudRepository<Order, UUID> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
Order save(Order entity);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.CrudRepository#findById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
Optional<Order> findById(UUID id);
|
||||
}
|
||||
|
||||
@@ -23,10 +23,6 @@ import org.springframework.data.rest.core.event.AbstractRepositoryEventListener;
|
||||
*/
|
||||
public class PersonBeforeSaveHandler extends AbstractRepositoryEventListener<Person> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.event.AbstractRepositoryEventListener#onBeforeSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void onBeforeSave(Person person) {
|
||||
throw new EventHandlerInvokedException();
|
||||
|
||||
@@ -225,10 +225,6 @@ class AnnotatedEventHandlerInvokerUnitTests {
|
||||
|
||||
Map<Method, Integer> invocations = new HashMap<>();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user