@@ -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 {
|
||||
|
||||
|
||||
@@ -32,10 +32,6 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
class HalExplorerConfiguration implements StaticResourceProvider {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.StaticResourceProvider#customizeResources(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry, org.springframework.data.rest.core.config.RepositoryRestConfiguration)
|
||||
*/
|
||||
public void customizeResources(ResourceHandlerRegistry registry, RepositoryRestConfiguration configuration) {
|
||||
|
||||
String basePath = configuration.getBasePath().toString().concat(HalExplorer.EXPLORER);
|
||||
|
||||
@@ -142,10 +142,6 @@ public class ResourceTester {
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.ResourceTester.ContentResourceHandler#doWith(org.springframework.data.rest.webmvc.ResourceTester)
|
||||
*/
|
||||
@Override
|
||||
public void doWith(ResourceTester content) {
|
||||
|
||||
|
||||
@@ -39,19 +39,11 @@ public class TestMatchers {
|
||||
|
||||
return new TypeSafeMatcher<String>(String.class) {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.hamcrest.SelfDescribing#describeTo(org.hamcrest.Description)
|
||||
*/
|
||||
@Override
|
||||
public void describeTo(Description description) {
|
||||
description.appendText("contains " + number + " lines");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.hamcrest.TypeSafeMatcher#describeMismatchSafely(java.lang.Object, org.hamcrest.Description)
|
||||
*/
|
||||
@Override
|
||||
protected void describeMismatchSafely(String item, Description mismatchDescription) {
|
||||
|
||||
@@ -61,10 +53,6 @@ public class TestMatchers {
|
||||
.appendText(" lines");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.hamcrest.TypeSafeMatcher#matchesSafely(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected boolean matchesSafely(String item) {
|
||||
return numberOfLines(item) == number;
|
||||
|
||||
@@ -44,10 +44,6 @@ public class AbstractPersistentEntity {
|
||||
this.id = null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
@@ -64,10 +60,6 @@ public class AbstractPersistentEntity {
|
||||
return this.id.equals(that.getId());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id == null ? 0 : id.hashCode();
|
||||
|
||||
@@ -60,19 +60,11 @@ public final class EmailAddress {
|
||||
return candidate == null ? false : PATTERN.matcher(candidate).matches();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
@@ -88,10 +80,6 @@ public final class EmailAddress {
|
||||
return this.value.equals(that.value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return value.hashCode();
|
||||
@@ -100,10 +88,6 @@ public final class EmailAddress {
|
||||
@Component
|
||||
static class EmailAddressToStringConverter implements Converter<EmailAddress, String> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public String convert(EmailAddress source) {
|
||||
return source == null ? null : source.value;
|
||||
@@ -113,10 +97,6 @@ public final class EmailAddress {
|
||||
@Component
|
||||
static class StringToEmailAddressConverter implements Converter<String, EmailAddress> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
public EmailAddress convert(String source) {
|
||||
return StringUtils.hasText(source) ? new EmailAddress(source) : null;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
@ContextConfiguration(classes = GeodeRepositoryConfig.class)
|
||||
class GeodeWebTests extends CommonWebTests {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#expectedRootLinkRels()
|
||||
*/
|
||||
@Override
|
||||
protected Iterable<LinkRelation> expectedRootLinkRels() {
|
||||
return LinkRelation.manyOf("products");
|
||||
|
||||
@@ -29,19 +29,11 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class BookIdConverter implements BackendIdConverter {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.BackendIdConverter#fromRequestId(java.lang.String, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Serializable fromRequestId(String id, Class<?> entityType) {
|
||||
return Long.parseLong(id.substring(0, id.indexOf('-')));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.BackendIdConverter#toRequestId(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public String toRequestId(Serializable id, Class<?> entityType) {
|
||||
|
||||
@@ -55,10 +47,6 @@ public class BookIdConverter implements BackendIdConverter {
|
||||
return StringUtils.collectionToDelimitedString(ids, "-");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> delimiter) {
|
||||
return Book.class.equals(delimiter);
|
||||
|
||||
@@ -107,10 +107,6 @@ public class JpaWebTests extends CommonWebTests {
|
||||
*/
|
||||
static class RepositoryLinkAffordanceAdder implements RepresentationModelProcessor<RepositoryLinksResource> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.RepresentationModelProcessor#process(org.springframework.hateoas.RepresentationModel)
|
||||
*/
|
||||
@Override
|
||||
public RepositoryLinksResource process(RepositoryLinksResource model) {
|
||||
|
||||
@@ -119,10 +115,6 @@ public class JpaWebTests extends CommonWebTests {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#setUp()
|
||||
*/
|
||||
@Override
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
@@ -130,28 +122,16 @@ public class JpaWebTests extends CommonWebTests {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#expectedRootLinkRels()
|
||||
*/
|
||||
@Override
|
||||
protected Iterable<LinkRelation> expectedRootLinkRels() {
|
||||
return LinkRelation.manyOf("people", "authors", "books");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#getPayloadToPost()
|
||||
*/
|
||||
@Override
|
||||
protected Map<LinkRelation, String> getPayloadToPost() throws Exception {
|
||||
return Collections.singletonMap(LinkRelation.of("people"), readFileFromClasspath("person.json"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#getRootAndLinkedResources()
|
||||
*/
|
||||
@Override
|
||||
protected MultiValueMap<LinkRelation, String> getRootAndLinkedResources() {
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@ public interface UserRepository extends PagingAndSortingRepository<User, BigInte
|
||||
|
||||
List<User> findByColleaguesContains(@Param("colleagues") User colleague);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.QuerydslBinderCustomizer#customize(org.springframework.data.querydsl.binding.QuerydslBindings, com.querydsl.core.types.EntityPath)
|
||||
*/
|
||||
@Override
|
||||
default void customize(QuerydslBindings bindings, QUser root) {
|
||||
bindings.bind(root.firstname).first((path, value) -> path.containsIgnoreCase(value));
|
||||
|
||||
@@ -32,28 +32,16 @@ import com.mongodb.client.MongoClients;
|
||||
@EnableMongoAuditing
|
||||
public class MongoDbRepositoryConfig extends AbstractMongoClientConfiguration {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.config.AbstractMongoConfiguration#getDatabaseName()
|
||||
*/
|
||||
@Override
|
||||
protected String getDatabaseName() {
|
||||
return "spring-data-rest-sample";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.config.AbstractMongoConfiguration#getMappingBasePackage()
|
||||
*/
|
||||
@Override
|
||||
protected String getMappingBasePackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.config.AbstractMongoConfiguration#mongo()
|
||||
*/
|
||||
@Override
|
||||
public MongoClient mongoClient() {
|
||||
return MongoClients.create();
|
||||
|
||||
@@ -128,10 +128,6 @@ class MongoWebTests extends CommonWebTests {
|
||||
userRepository.deleteAll();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#expectedRootLinkRels()
|
||||
*/
|
||||
@Override
|
||||
protected Iterable<LinkRelation> expectedRootLinkRels() {
|
||||
return LinkRelation.manyOf("profiles", "users");
|
||||
|
||||
@@ -32,10 +32,6 @@ public class Address {
|
||||
private @Id UUID id = UUID.randomUUID();
|
||||
private final String street, zipCode, city, state;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return String.format("%s, %s %s, %s", street, zipCode, city, state);
|
||||
}
|
||||
|
||||
@@ -47,10 +47,6 @@ class ShopConfiguration {
|
||||
public RepresentationModelProcessor<EntityModel<LineItem>> lineItemResourceProcessor() {
|
||||
return new RepresentationModelProcessor<EntityModel<LineItem>>() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.RepresentationModelProcessor#process(org.springframework.hateoas.RepresentationModel)
|
||||
*/
|
||||
@Override
|
||||
public EntityModel<LineItem> process(EntityModel<LineItem> resource) {
|
||||
resource.add(Link.of("foo", "bar"));
|
||||
@@ -64,10 +60,6 @@ class ShopConfiguration {
|
||||
|
||||
return new RepresentationModelProcessor<EntityModel<ProductNameOnlyProjection>>() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.RepresentationModelProcessor#process(org.springframework.hateoas.RepresentationModel)
|
||||
*/
|
||||
@Override
|
||||
public EntityModel<ProductNameOnlyProjection> process(EntityModel<Product.ProductNameOnlyProjection> resource) {
|
||||
resource.add(Link.of("alpha", "beta"));
|
||||
|
||||
@@ -76,10 +76,6 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMethodMapping#lookupHandlerMethod(java.lang.String, jakarta.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletRequest request) throws Exception {
|
||||
|
||||
@@ -106,19 +102,11 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping {
|
||||
return super.lookupHandlerMethod(lookupPath, new CustomAcceptHeaderHttpServletRequest(request, mediaTypes));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#hasCorsConfigurationSource(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasCorsConfigurationSource(Object handler) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#getMappingForMethod(java.lang.reflect.Method, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
|
||||
|
||||
@@ -215,10 +203,6 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping {
|
||||
this.acceptMediaTypeStrings = acceptMediaTypeStrings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.servlet.http.HttpServletRequestWrapper#getHeader(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getHeader(String name) {
|
||||
|
||||
@@ -227,10 +211,6 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping {
|
||||
: super.getHeader(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.servlet.http.HttpServletRequestWrapper#getHeaders(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> getHeaders(String name) {
|
||||
|
||||
|
||||
@@ -234,10 +234,6 @@ public class PersistentEntityResource extends EntityModel<Object> {
|
||||
super(content);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.RepresentationModel#getLinks()
|
||||
*/
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public Links getLinks() {
|
||||
|
||||
@@ -62,10 +62,6 @@ public class PersistentEntityResourceAssembler
|
||||
this.embeddedAssembler = new EmbeddedResourcesAssembler(entities, associations, projector);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.RepresentationModelAssembler#toModel(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public PersistentEntityResource toModel(Object instance) {
|
||||
|
||||
|
||||
@@ -117,10 +117,6 @@ class RepositoryEntityController extends AbstractRepositoryRestController implem
|
||||
this.resourceStatus = ResourceStatus.of(headersPreparer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationEventPublisher(ApplicationEventPublisher publisher) {
|
||||
this.publisher = publisher;
|
||||
|
||||
@@ -99,10 +99,6 @@ class RepositoryPropertyReferenceController extends AbstractRepositoryRestContro
|
||||
this.repositoryInvokerFactory = repositoryInvokerFactory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
|
||||
this.publisher = applicationEventPublisher;
|
||||
@@ -491,10 +487,6 @@ class RepositoryPropertyReferenceController extends AbstractRepositoryRestContro
|
||||
String.format(message, parameters));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Throwable#getMessage()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public String getMessage() {
|
||||
|
||||
@@ -46,29 +46,17 @@ public class RepositoryRestHandlerAdapter extends RequestMappingHandlerAdapter {
|
||||
this.argumentResolvers = argumentResolvers;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.RepresentationModelProcessorInvokingHandlerAdapter#afterPropertiesSet()
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
setCustomArgumentResolvers(argumentResolvers);
|
||||
super.afterPropertiesSet();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter#getOrder()
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#supportsInternal(org.springframework.web.method.HandlerMethod)
|
||||
*/
|
||||
@Override
|
||||
protected boolean supportsInternal(HandlerMethod handlerMethod) {
|
||||
|
||||
|
||||
@@ -124,10 +124,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
this.jpaHelper = Optional.ofNullable(jpaHelper);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#setEmbeddedValueResolver(org.springframework.util.StringValueResolver)
|
||||
*/
|
||||
@Override
|
||||
public void setEmbeddedValueResolver(StringValueResolver resolver) {
|
||||
|
||||
@@ -137,10 +133,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
resolver == null ? NoOpStringValueResolver.INSTANCE : resolver, repositories);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMethodMapping#lookupHandlerMethod(java.lang.String, jakarta.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletRequest request) throws Exception {
|
||||
|
||||
@@ -168,29 +160,17 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
return handlerMethod;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping#handleNoMatch(java.util.Set, java.lang.String, jakarta.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos, String lookupPath,
|
||||
HttpServletRequest request) throws ServletException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.BasePathAwareHandlerMapping#isHandlerInternal(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isHandlerInternal(Class<?> type) {
|
||||
return AnnotatedElementUtils.hasAnnotation(type, RepositoryRestController.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#extendInterceptors(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void extendInterceptors(List<Object> interceptors) {
|
||||
|
||||
@@ -199,10 +179,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
.forEach(interceptors::add);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.BasePathAwareHandlerMapping#process(org.springframework.web.servlet.mvc.condition.ProducesRequestCondition)
|
||||
*/
|
||||
@Override
|
||||
protected ProducesRequestCondition customize(ProducesRequestCondition condition) {
|
||||
|
||||
@@ -218,9 +194,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
return new ProducesRequestCondition(mediaTypes.toArray(new String[mediaTypes.size()]));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMethodMapping#getCorsConfiguration(java.lang.Object, jakarta.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected CorsConfiguration getCorsConfiguration(Object handler, HttpServletRequest request) {
|
||||
|
||||
@@ -299,10 +272,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.util.StringValueResolver#resolveStringValue(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String resolveStringValue(String value) {
|
||||
return value;
|
||||
|
||||
@@ -65,38 +65,22 @@ public class AlpsJsonHttpMessageConverter extends MappingJackson2HttpMessageConv
|
||||
setSupportedMediaTypes(Arrays.asList(MediaTypes.ALPS_JSON, MediaType.APPLICATION_JSON, MediaType.ALL));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#canWrite(java.lang.Class, org.springframework.http.MediaType)
|
||||
*/
|
||||
@Override
|
||||
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
|
||||
return (clazz.isAssignableFrom(Alps.class) || clazz.isAssignableFrom(RootResourceInformation.class))
|
||||
&& super.canWrite(clazz, mediaType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.AbstractGenericHttpMessageConverter#canWrite(java.lang.reflect.Type, java.lang.Class, org.springframework.http.MediaType)
|
||||
*/
|
||||
@Override
|
||||
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) {
|
||||
return canWrite(clazz, mediaType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#canRead(java.lang.reflect.Type, java.lang.Class, org.springframework.http.MediaType)
|
||||
*/
|
||||
@Override
|
||||
public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#beforeBodyWrite(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.http.MediaType, java.lang.Class, org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse)
|
||||
*/
|
||||
@Override
|
||||
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
|
||||
Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request,
|
||||
@@ -107,10 +91,6 @@ public class AlpsJsonHttpMessageConverter extends MappingJackson2HttpMessageConv
|
||||
: body;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
|
||||
return converterType.equals(AlpsJsonHttpMessageConverter.class);
|
||||
|
||||
@@ -112,10 +112,6 @@ public class RootResourceInformationToAlpsDescriptorConverter {
|
||||
this.translator = translator;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
public Alps convert(RootResourceInformation resourceInformation) {
|
||||
|
||||
Class<?> type = resourceInformation.getDomainType();
|
||||
|
||||
@@ -64,28 +64,16 @@ class ArgumentResolverPagingAndSortingTemplateVariables implements PagingAndSort
|
||||
this.sortResolver = sortResolver;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.PagingAndSortingTemplateVariables#getPaginationTemplateVariables(org.springframework.core.MethodParameter, org.springframework.web.util.UriComponents)
|
||||
*/
|
||||
@Override
|
||||
public TemplateVariables getPaginationTemplateVariables(MethodParameter parameter, UriComponents components) {
|
||||
return pagingResolver.getPaginationTemplateVariables(parameter, components);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.PagingAndSortingTemplateVariables#getSortTemplateVariables(org.springframework.core.MethodParameter, org.springframework.web.util.UriComponents)
|
||||
*/
|
||||
@Override
|
||||
public TemplateVariables getSortTemplateVariables(MethodParameter parameter, UriComponents template) {
|
||||
return sortResolver.getSortTemplateVariables(parameter, template);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.mvc.UriComponentsContributor#enhance(org.springframework.web.util.UriComponentsBuilder, org.springframework.core.MethodParameter, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void enhance(UriComponentsBuilder builder, MethodParameter parameter, Object value) {
|
||||
|
||||
@@ -96,10 +84,6 @@ class ArgumentResolverPagingAndSortingTemplateVariables implements PagingAndSort
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.server.mvc.UriComponentsContributor#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return SUPPORTED_TYPES.contains(parameter.getParameterType());
|
||||
|
||||
@@ -59,65 +59,37 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable<Hand
|
||||
this.parser = parser;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.HandlerMapping#usesPathPatterns()
|
||||
*/
|
||||
@Override
|
||||
public boolean usesPathPatterns() {
|
||||
return parser != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.MatchableHandlerMapping#getPatternParser()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PathPatternParser getPatternParser() {
|
||||
return parser;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.DelegatingHandlerMapping#getDelegates()
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public List<HandlerMapping> getDelegates() {
|
||||
return this.delegates;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<HandlerMapping> iterator() {
|
||||
return delegates.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.Ordered#getOrder()
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.LOWEST_PRECEDENCE - 100;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.HandlerMapping#getHandler(jakarta.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
public HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
|
||||
return HandlerSelectionResult.from(request, delegates).resultOrException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.handler.MatchableHandlerMapping#match(jakarta.servlet.http.HttpServletRequest, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public RequestMatchResult match(HttpServletRequest request, String pattern) {
|
||||
|
||||
@@ -200,10 +172,6 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable<Hand
|
||||
this.ignoredException = ignoredException;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
|
||||
@@ -223,19 +191,11 @@ class DelegatingHandlerMapping implements MatchableHandlerMapping, Iterable<Hand
|
||||
&& Objects.equals(ignoredException, other.ignoredException);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(request, mapping, result, ignoredException);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "DelegatingHandlerMapping.HandlerSelectionResult(request=" + request + ", mapping=" + mapping + ", result="
|
||||
|
||||
@@ -48,19 +48,11 @@ class HalFormsAdaptingResponseBodyAdvice<T extends RepresentationModel<T>>
|
||||
private static final List<MediaType> SUPPORTED_MEDIA_TYPES = Arrays.asList(MediaTypes.HAL_JSON,
|
||||
MediaType.APPLICATION_JSON);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
|
||||
return TypeConstrainedMappingJackson2HttpMessageConverter.class.isAssignableFrom(converterType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#beforeBodyWrite(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.http.MediaType, java.lang.Class, org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse)
|
||||
*/
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public RepresentationModel<T> beforeBodyWrite(RepresentationModel<T> body, MethodParameter returnType,
|
||||
|
||||
@@ -53,10 +53,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
class JMoleculesConfigurer implements WebMvcConfigurer, RepositoryRestConfigurer {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.config.annotation.WebMvcConfigurer#addFormatters(org.springframework.format.FormatterRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void addFormatters(FormatterRegistry registry) {
|
||||
|
||||
@@ -72,10 +68,6 @@ class JMoleculesConfigurer implements WebMvcConfigurer, RepositoryRestConfigurer
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureConversionService(org.springframework.core.convert.support.ConfigurableConversionService)
|
||||
*/
|
||||
@Override
|
||||
public void configureConversionService(ConfigurableConversionService conversionService) {
|
||||
|
||||
@@ -121,10 +113,6 @@ class JMoleculesConfigurer implements WebMvcConfigurer, RepositoryRestConfigurer
|
||||
this.entities = entities;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.spi.BackendIdConverter#fromRequestId(java.lang.String, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Serializable fromRequestId(String id, Class<?> entityType) {
|
||||
|
||||
@@ -135,19 +123,11 @@ class JMoleculesConfigurer implements WebMvcConfigurer, RepositoryRestConfigurer
|
||||
TypeDescriptor.valueOf(idType));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.spi.BackendIdConverter#toRequestId(java.io.Serializable, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public String toRequestId(Serializable id, Class<?> entityType) {
|
||||
return (String) primitivesConverter.convert(id, TypeDescriptor.forObject(id), STRING_DESCRIPTOR);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> delimiter) {
|
||||
|
||||
|
||||
@@ -59,19 +59,11 @@ public class PersistentEntityResourceAssemblerArgumentResolver implements Handle
|
||||
this.associations = associations;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return PersistentEntityResourceAssembler.class.equals(parameter.getParameterType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
||||
|
||||
@@ -92,19 +92,11 @@ public class PersistentEntityResourceHandlerMethodArgumentResolver implements Ha
|
||||
this.lookups = lookups;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return PersistentEntityResource.class.isAssignableFrom(parameter.getParameterType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
|
||||
@@ -55,10 +55,6 @@ public class ProjectionDefinitionRegistar implements SmartInstantiationAwareBean
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter#postProcessAfterInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
|
||||
|
||||
@@ -72,10 +72,6 @@ class QuerydslAwareRootResourceInformationHandlerMethodArgumentResolver
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RootResourceInformationHandlerMethodArgumentResolver#postProcess(org.springframework.data.repository.support.RepositoryInvoker, java.lang.Class, java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
protected RepositoryInvoker postProcess(MethodParameter parameter, RepositoryInvoker invoker, Class<?> domainType,
|
||||
Map<String, String[]> parameters) {
|
||||
|
||||
@@ -29,9 +29,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
*/
|
||||
class RepositoryCorsRegistry extends CorsRegistry {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.config.annotation.CorsRegistry#getCorsConfigurations()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, CorsConfiguration> getCorsConfigurations() {
|
||||
return super.getCorsConfigurations();
|
||||
|
||||
@@ -54,10 +54,6 @@ public interface RepositoryRestConfigurer {
|
||||
|
||||
return new RepositoryRestConfigurer() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureRepositoryRestConfiguration(org.springframework.data.rest.core.config.RepositoryRestConfiguration, org.springframework.web.servlet.config.annotation.CorsRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
|
||||
consumer.accept(config);
|
||||
@@ -79,10 +75,6 @@ public interface RepositoryRestConfigurer {
|
||||
|
||||
return new RepositoryRestConfigurer() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureRepositoryRestConfiguration(org.springframework.data.rest.core.config.RepositoryRestConfiguration, org.springframework.web.servlet.config.annotation.CorsRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
|
||||
consumer.accept(config, cors);
|
||||
|
||||
@@ -52,10 +52,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
this.delegates = delegates;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureRepositoryRestConfiguration(org.springframework.data.rest.core.config.RepositoryRestConfiguration, org.springframework.web.servlet.config.annotation.CorsRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
|
||||
|
||||
@@ -64,10 +60,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureConversionService(org.springframework.core.convert.support.ConfigurableConversionService)
|
||||
*/
|
||||
@Override
|
||||
public void configureConversionService(ConfigurableConversionService conversionService) {
|
||||
|
||||
@@ -76,10 +68,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureExceptionHandlerExceptionResolver(org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver)
|
||||
*/
|
||||
@Override
|
||||
public void configureExceptionHandlerExceptionResolver(ExceptionHandlerExceptionResolver exceptionResolver) {
|
||||
|
||||
@@ -88,10 +76,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureHttpMessageConverters(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public void configureHttpMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
|
||||
|
||||
@@ -100,10 +84,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureJacksonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)
|
||||
*/
|
||||
@Override
|
||||
public void configureJacksonObjectMapper(ObjectMapper objectMapper) {
|
||||
|
||||
@@ -112,10 +92,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureValidatingRepositoryEventListener(org.springframework.data.rest.core.event.ValidatingRepositoryEventListener)
|
||||
*/
|
||||
@Override
|
||||
public void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener validatingListener) {
|
||||
|
||||
@@ -124,10 +100,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#configureAuditableBeanWrapperFactory(org.springframework.data.auditing.AuditableBeanWrapperFactory)
|
||||
*/
|
||||
@Override
|
||||
public AuditableBeanWrapperFactory customizeAuditableBeanWrapperFactory(AuditableBeanWrapperFactory factory) {
|
||||
|
||||
@@ -138,10 +110,6 @@ class RepositoryRestConfigurerDelegate implements RepositoryRestConfigurer {
|
||||
return factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer#customizeLinkCollector(org.springframework.data.rest.webmvc.mapping.LinkCollector)
|
||||
*/
|
||||
@Override
|
||||
public LinkCollector customizeLinkCollector(LinkCollector collector) {
|
||||
|
||||
|
||||
@@ -277,10 +277,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
this.defaultMessageConverters = beansOfType(context, HttpMessageConverter.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
@@ -742,10 +738,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
return new DefaultExcerptProjector(projectionFactory, resourceMappings);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter#extendHandlerExceptionResolvers(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
|
||||
|
||||
@@ -815,10 +807,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
return new AlpsJsonHttpMessageConverter(alpsConverter);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.web.config.HateoasAwareSpringDataWebConfiguration#pageableResolver()
|
||||
*/
|
||||
@Bean
|
||||
@Override
|
||||
public HateoasPageableHandlerMethodArgumentResolver pageableResolver() {
|
||||
@@ -833,10 +821,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
return resolver;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.web.config.HateoasAwareSpringDataWebConfiguration#sortResolver()
|
||||
*/
|
||||
@Bean
|
||||
@Override
|
||||
public HateoasSortHandlerMethodArgumentResolver sortResolver() {
|
||||
@@ -987,10 +971,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
// HAL Browser
|
||||
//
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter#addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
|
||||
@@ -1030,10 +1010,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.Ordered#getOrder()
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return order;
|
||||
|
||||
@@ -63,19 +63,11 @@ public class ResourceMetadataHandlerMethodArgumentResolver implements HandlerMet
|
||||
this.baseUri = baseUri;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return isAssignable(parameter.getParameterType(), ResourceMetadata.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public ResourceMetadata resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
||||
|
||||
@@ -36,10 +36,6 @@ class RestControllerImportSelector implements ImportSelector {
|
||||
private static final String HAL_EXPLORER_CONFIGURATION = "org.springframework.data.rest.webmvc.halexplorer.HalExplorerConfiguration";
|
||||
private static final String JMOLECULES_SPRING = "org.jmolecules.spring.IdentifierToPrimitivesConverter";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.annotation.ImportSelector#selectImports(org.springframework.core.type.AnnotationMetadata)
|
||||
*/
|
||||
@Override
|
||||
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
|
||||
|
||||
|
||||
@@ -63,19 +63,11 @@ public class RootResourceInformationHandlerMethodArgumentResolver implements Han
|
||||
this.resourceMetadataResolver = resourceMetadataResolver;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return RootResourceInformation.class.isAssignableFrom(parameter.getParameterType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public RootResourceInformation resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
||||
|
||||
@@ -57,10 +57,6 @@ class WebMvcRepositoryRestConfiguration extends RepositoryRestConfiguration impl
|
||||
|
||||
private final RepositoryCorsRegistry registry;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.config.CorsConfigurationAware#getCorsConfigurations()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, CorsConfiguration> getCorsConfigurations() {
|
||||
return registry.getCorsConfigurations();
|
||||
|
||||
@@ -51,10 +51,6 @@ public class UriListHttpMessageConverter implements HttpMessageConverter<Represe
|
||||
MEDIA_TYPES.add(MediaType.parseMediaType("text/uri-list"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.HttpMessageConverter#canRead(java.lang.Class, org.springframework.http.MediaType)
|
||||
*/
|
||||
@Override
|
||||
public boolean canRead(Class<?> clazz, MediaType mediaType) {
|
||||
|
||||
@@ -63,28 +59,16 @@ public class UriListHttpMessageConverter implements HttpMessageConverter<Represe
|
||||
&& mediaType.getSubtype().contains("uri-list");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.HttpMessageConverter#canWrite(java.lang.Class, org.springframework.http.MediaType)
|
||||
*/
|
||||
@Override
|
||||
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
|
||||
return canRead(clazz, mediaType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.HttpMessageConverter#getSupportedMediaTypes()
|
||||
*/
|
||||
@Override
|
||||
public List<MediaType> getSupportedMediaTypes() {
|
||||
return MEDIA_TYPES;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.HttpMessageConverter#read(java.lang.Class, org.springframework.http.HttpInputMessage)
|
||||
*/
|
||||
@Override
|
||||
public RepresentationModel<?> read(Class<? extends RepresentationModel<?>> clazz, HttpInputMessage inputMessage)
|
||||
throws IOException, HttpMessageNotReadableException {
|
||||
@@ -99,10 +83,6 @@ public class UriListHttpMessageConverter implements HttpMessageConverter<Represe
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.http.converter.HttpMessageConverter#write(java.lang.Object, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage)
|
||||
*/
|
||||
@Override
|
||||
public void write(RepresentationModel<?> resource, MediaType contentType, HttpOutputMessage outputMessage)
|
||||
throws IOException, HttpMessageNotWritableException {
|
||||
|
||||
@@ -85,10 +85,6 @@ public class AggregateReferenceResolvingModule extends SimpleModule {
|
||||
this.mappings = mappings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.deser.BeanDeserializerModifier#updateBuilder(com.fasterxml.jackson.databind.DeserializationConfig, com.fasterxml.jackson.databind.BeanDescription, com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder)
|
||||
*/
|
||||
@Override
|
||||
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription description,
|
||||
BeanDeserializerBuilder builder) {
|
||||
|
||||
@@ -588,10 +588,6 @@ public class DomainObjectReader {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimpleAssociationHandler#doWithAssociation(org.springframework.data.mapping.Association)
|
||||
*/
|
||||
@Override
|
||||
public void doWithAssociation(Association<? extends PersistentProperty<?>> association) {
|
||||
|
||||
@@ -642,10 +638,6 @@ public class DomainObjectReader {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimplePropertyHandler#doWithPersistentProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public void doWithPersistentProperty(PersistentProperty<?> property) {
|
||||
|
||||
|
||||
@@ -53,19 +53,11 @@ public class EnumTranslator implements EnumTranslationConfiguration {
|
||||
this.parseEnumNameAsFallback = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EnumTranslationConfiguration#setEnableDefaultTranslation(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setEnableDefaultTranslation(boolean enableDefaultTranslation) {
|
||||
this.enableDefaultTranslation = enableDefaultTranslation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.config.EnumTranslationConfiguration#setParseEnumNameAsFallback(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setParseEnumNameAsFallback(boolean parseEnumNameAsFallback) {
|
||||
this.parseEnumNameAsFallback = parseEnumNameAsFallback;
|
||||
@@ -191,19 +183,11 @@ public class EnumTranslator implements EnumTranslationConfiguration {
|
||||
return new TranslatedEnum(value, withDefaultTranslation);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getCodes()
|
||||
*/
|
||||
@Override
|
||||
public String[] getCodes() {
|
||||
return new String[] { String.format("%s.%s", value.getDeclaringClass().getName(), value.name()) };
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getDefaultMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getDefaultMessage() {
|
||||
return withDefaultTranslation ? toDefault(value) : value.name();
|
||||
|
||||
@@ -173,10 +173,6 @@ public class JacksonMetadata implements Iterable<BeanPropertyDefinition> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<BeanPropertyDefinition> iterator() {
|
||||
return definitions.iterator();
|
||||
|
||||
@@ -95,19 +95,11 @@ public class JacksonSerializers extends SimpleModule {
|
||||
this.translator = translator;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
||||
gen.writeString(translator.asText(value));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.JsonSchemaPropertyCustomizer#customize(org.springframework.data.rest.webmvc.json.JsonSchema.JsonSchemaProperty, org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
@Override
|
||||
public JsonSchemaProperty customize(JsonSchemaProperty property, TypeInformation<?> type) {
|
||||
|
||||
@@ -160,20 +152,12 @@ public class JacksonSerializers extends SimpleModule {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.deser.ContextualDeserializer#createContextual(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty)
|
||||
*/
|
||||
@Override
|
||||
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)
|
||||
throws JsonMappingException {
|
||||
return new EnumTranslatingDeserializer(translator, property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Enum deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
|
||||
@@ -54,19 +54,11 @@ public class MappingAwareDefaultedPageableArgumentResolver implements HandlerMet
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return DefaultedPageable.class.isAssignableFrom(parameter.getParameterType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
||||
|
||||
@@ -53,19 +53,11 @@ public class MappingAwarePageableArgumentResolver implements HandlerMethodArgume
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return delegate.supportsParameter(parameter);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.web.PageableArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public Pageable resolveArgument(MethodParameter methodParameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
|
||||
|
||||
@@ -50,19 +50,11 @@ public class MappingAwareSortArgumentResolver implements HandlerMethodArgumentRe
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return delegate.supportsParameter(parameter);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public Sort resolveArgument(MethodParameter methodParameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
|
||||
|
||||
@@ -168,10 +168,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.collector = collector;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(final PersistentEntityResource resource, final JsonGenerator jgen,
|
||||
final SerializerProvider provider) throws IOException, JsonGenerationException {
|
||||
@@ -251,10 +247,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.lookupObjectSerializer = lookupObjectSerializer;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.BeanSerializerModifier#changeProperties(com.fasterxml.jackson.databind.SerializationConfig, com.fasterxml.jackson.databind.BeanDescription, java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc,
|
||||
List<BeanPropertyWriter> beanProperties) {
|
||||
@@ -354,10 +346,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.invoker = invoker;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(Object value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
||||
|
||||
@@ -388,10 +376,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonSerializer#serializeWithType(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)
|
||||
*/
|
||||
@Override
|
||||
public void serializeWithType(Object value, JsonGenerator gen, SerializerProvider provider,
|
||||
TypeSerializer typeSerializer) throws IOException {
|
||||
@@ -448,10 +432,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.deser.BeanDeserializerModifier#updateBuilder(com.fasterxml.jackson.databind.DeserializationConfig, com.fasterxml.jackson.databind.BeanDescription, com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder)
|
||||
*/
|
||||
@Override
|
||||
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc,
|
||||
BeanDeserializerBuilder builder) {
|
||||
@@ -609,10 +589,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.converter = converter;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)
|
||||
*/
|
||||
@Override
|
||||
public Object deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
|
||||
@@ -675,10 +651,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.unwrapping = unwrapping;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(TargetAware value, JsonGenerator jgen, SerializerProvider provider)
|
||||
throws IOException, JsonGenerationException {
|
||||
@@ -697,19 +669,11 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonSerializer#isUnwrappingSerializer()
|
||||
*/
|
||||
@Override
|
||||
public boolean isUnwrappingSerializer() {
|
||||
return unwrapping;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonSerializer#unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)
|
||||
*/
|
||||
@Override
|
||||
public JsonSerializer<TargetAware> unwrappingSerializer(NameTransformer unwrapper) {
|
||||
return new ProjectionSerializer(collector, associations, invoker, true);
|
||||
@@ -780,10 +744,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.unwrapping = unwrapping;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(ProjectionResourceContent value, JsonGenerator jgen, SerializerProvider provider)
|
||||
throws IOException, JsonGenerationException {
|
||||
@@ -794,19 +754,11 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
serialize(value.getProjection(), jgen, provider);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonSerializer#isUnwrappingSerializer()
|
||||
*/
|
||||
@Override
|
||||
public boolean isUnwrappingSerializer() {
|
||||
return unwrapping;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonSerializer#unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)
|
||||
*/
|
||||
@Override
|
||||
public JsonSerializer<ProjectionResourceContent> unwrappingSerializer(NameTransformer unwrapper) {
|
||||
return new ProjectionResourceContentSerializer(true);
|
||||
@@ -836,19 +788,11 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.deser.ValueInstantiator#getValueTypeDesc()
|
||||
*/
|
||||
@Override
|
||||
public String getValueTypeDesc() {
|
||||
return property.getType().getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.deser.ValueInstantiator#createUsingDefault(com.fasterxml.jackson.databind.DeserializationContext)
|
||||
*/
|
||||
@Override
|
||||
public Object createUsingDefault(DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
|
||||
@@ -870,10 +814,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.invoker = factory.getInvokerFor(_valueClass);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)
|
||||
*/
|
||||
@Override
|
||||
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
|
||||
@@ -896,10 +836,6 @@ public class PersistentEntityJackson2Module extends SimpleModule {
|
||||
this.lookups = lookups;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.fasterxml.jackson.databind.ser.std.ToStringSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
|
||||
*/
|
||||
@Override
|
||||
public void serialize(Object value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
||||
|
||||
|
||||
@@ -116,20 +116,12 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (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 Class.class.isAssignableFrom(sourceType.getType())
|
||||
&& JsonSchema.class.isAssignableFrom(targetType.getType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.GenericConverter#getConvertibleTypes()
|
||||
*/
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return convertiblePairs;
|
||||
@@ -145,10 +137,6 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric
|
||||
return convert(domainType, STRING_TYPE, SCHEMA_TYPE);
|
||||
}
|
||||
|
||||
/*
|
||||
* (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 JsonSchema convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
|
||||
@@ -338,10 +326,6 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric
|
||||
|
||||
return new JsonSchemaPropertyCustomizer() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.JsonSchemaPropertyCustomizer#customize(org.springframework.data.rest.webmvc.json.JsonSchema.JsonSchemaProperty, org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
@Override
|
||||
public JsonSchemaProperty customize(JsonSchemaProperty property, TypeInformation<?> type) {
|
||||
|
||||
@@ -540,28 +524,16 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getArguments()
|
||||
*/
|
||||
@Override
|
||||
public Object[] getArguments() {
|
||||
return delegate.getArguments();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getCodes()
|
||||
*/
|
||||
@Override
|
||||
public String[] getCodes() {
|
||||
return delegate.getCodes();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.MessageSourceResolvable#getDefaultMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getDefaultMessage() {
|
||||
String defaultMessage = delegate.getDefaultMessage();
|
||||
|
||||
@@ -40,19 +40,11 @@ class AddOperation extends PatchOperation {
|
||||
return new AddOperation(SpelPath.untyped(path), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object targetObject, Class<?> type) {
|
||||
path.bindTo(type).addValue(targetObject, evaluateValueFromTarget(targetObject, type));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#evaluateValueFromTarget(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
protected Object evaluateValueFromTarget(Object targetObject, Class<?> entityType) {
|
||||
|
||||
|
||||
@@ -77,10 +77,6 @@ class CopyOperation extends PatchOperation {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object target, Class<?> type) {
|
||||
path.bindTo(type).copyFrom(from, target);
|
||||
|
||||
@@ -42,10 +42,6 @@ class JsonLateObjectEvaluator implements LateObjectEvaluator {
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.LateObjectEvaluator#evaluate(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Object evaluate(Class<?> type) {
|
||||
|
||||
|
||||
@@ -70,10 +70,6 @@ class MoveOperation extends PatchOperation {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object target, Class<?> type) {
|
||||
path.bindTo(type).moveFrom(from, target);
|
||||
|
||||
@@ -85,10 +85,6 @@ public class Patch implements Streamable<PatchOperation> {
|
||||
return in;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<PatchOperation> iterator() {
|
||||
return operations.iterator();
|
||||
|
||||
@@ -39,10 +39,6 @@ class RemoveOperation extends PatchOperation {
|
||||
return new RemoveOperation(SpelPath.untyped(path));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object target, Class<?> type) {
|
||||
path.bindTo(type).removeFrom(target);
|
||||
|
||||
@@ -53,10 +53,6 @@ class ReplaceOperation extends PatchOperation {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object target, Class<?> type) {
|
||||
path.bindTo(type).setValue(target, evaluateValueFromTarget(target, type));
|
||||
|
||||
@@ -95,19 +95,11 @@ class SpelPath {
|
||||
return path.endsWith("-");
|
||||
}
|
||||
|
||||
/*
|
||||
* (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) {
|
||||
|
||||
@@ -124,10 +116,6 @@ class SpelPath {
|
||||
return this.path.equals(that.path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return path.hashCode();
|
||||
@@ -186,10 +174,6 @@ class SpelPath {
|
||||
return new CacheKey(type, path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -207,19 +191,11 @@ class SpelPath {
|
||||
&& Objects.equals(path, that.path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(type, path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "SpelPath.TypedSpelPath.CacheKey(type=" + type + ", path=" + path + ")";
|
||||
@@ -430,10 +406,6 @@ class SpelPath {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.SpelPath#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s on %s -> %s", path, type.getName(), getExpressionString());
|
||||
@@ -535,10 +507,6 @@ class SpelPath {
|
||||
: SkippedPropertyPath.of(path.nested(segment), false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -555,19 +523,11 @@ class SpelPath {
|
||||
&& skipped == other.skipped;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(path, skipped);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "SpelPath.TypedSpelPath.SkippedPropertyPath(path=" + path + ", skipped=" + skipped + ")";
|
||||
@@ -707,10 +667,6 @@ class SpelPath {
|
||||
return nested(segment);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -729,19 +685,11 @@ class SpelPath {
|
||||
&& skipped == that.skipped;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(basePath, type, spelSegment, skipped);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String toString() {
|
||||
return "SpelPath.TypedSpelPath.SpelExpressionBuilder(basePath=" + this.getBasePath() + ", type="
|
||||
@@ -749,10 +697,6 @@ class SpelPath {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.SpelPath#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
|
||||
@@ -770,10 +714,6 @@ class SpelPath {
|
||||
&& Objects.equals(type, that.type);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.SpelPath#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(expression, type);
|
||||
|
||||
@@ -66,10 +66,6 @@ class TestOperation extends PatchOperation {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.json.patch.PatchOperation#perform(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
void perform(Object target, Class<?> type) {
|
||||
|
||||
|
||||
@@ -161,10 +161,6 @@ public class DefaultLinkCollector implements LinkCollector {
|
||||
return Links.of(links);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimpleAssociationHandler#doWithAssociation(org.springframework.data.mapping.Association)
|
||||
*/
|
||||
@Override
|
||||
public void doWithAssociation(final Association<? extends PersistentProperty<?>> association) {
|
||||
|
||||
@@ -207,10 +203,6 @@ public class DefaultLinkCollector implements LinkCollector {
|
||||
return this.links.toList();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.SimpleAssociationHandler#doWithAssociation(org.springframework.data.mapping.Association)
|
||||
*/
|
||||
@Override
|
||||
public void doWithAssociation(Association<? extends PersistentProperty<?>> association) {
|
||||
|
||||
|
||||
@@ -53,28 +53,16 @@ public interface BackendIdConverter extends Plugin<Class<?>> {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.BackendIdConverter#fromRequestId(java.lang.String, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Serializable fromRequestId(String id, Class<?> entityType) {
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.webmvc.support.BackendIdConverter#toRequestId(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public String toRequestId(Serializable id, Class<?> entityType) {
|
||||
return id.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> delimiter) {
|
||||
return true;
|
||||
|
||||
@@ -64,19 +64,11 @@ public class BackendIdHandlerMethodArgumentResolver implements HandlerMethodArgu
|
||||
this.baseUri = baseUri;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
return parameter.hasParameterAnnotation(BackendId.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
|
||||
*/
|
||||
@Override
|
||||
public Serializable resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||
NativeWebRequest request, WebDataBinderFactory binderFactory) throws Exception {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user