DATAES-46 - Apply code formatting

This commit is contained in:
Mohsin Husen
2014-08-17 09:47:36 +01:00
parent a66dc08975
commit 097c5f68ce
12 changed files with 1795 additions and 395 deletions

View File

@@ -123,8 +123,8 @@ public class ElasticsearchTemplate implements ElasticsearchOperations, Applicati
public ElasticsearchTemplate(Client client, ElasticsearchConverter elasticsearchConverter, ResultsMapper resultsMapper) {
this.client = client;
this.elasticsearchConverter = (elasticsearchConverter == null) ? new MappingElasticsearchConverter(
new SimpleElasticsearchMappingContext()) : elasticsearchConverter;
this.elasticsearchConverter = (elasticsearchConverter == null) ? new MappingElasticsearchConverter(
new SimpleElasticsearchMappingContext()) : elasticsearchConverter;
this.resultsMapper = (resultsMapper == null) ? new DefaultResultMapper(this.elasticsearchConverter.getMappingContext()) : resultsMapper;
}
@@ -879,14 +879,14 @@ public class ElasticsearchTemplate implements ElasticsearchOperations, Applicati
return ids;
}
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
if(elasticsearchConverter instanceof ApplicationContextAware){
((ApplicationContextAware)elasticsearchConverter).setApplicationContext(context);
}
}
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
if (elasticsearchConverter instanceof ApplicationContextAware) {
((ApplicationContextAware) elasticsearchConverter).setApplicationContext(context);
}
}
private static String[] toArray(List<String> values) {
private static String[] toArray(List<String> values) {
String[] valuesAsArray = new String[values.size()];
return values.toArray(valuesAsArray);
}

View File

@@ -61,8 +61,8 @@ public class MappingElasticsearchConverter implements ElasticsearchConverter, Ap
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
if(mappingContext instanceof ApplicationContextAware){
((ApplicationContextAware)mappingContext).setApplicationContext(applicationContext);
}
if (mappingContext instanceof ApplicationContextAware) {
((ApplicationContextAware) mappingContext).setApplicationContext(applicationContext);
}
}
}

View File

@@ -33,19 +33,18 @@ import org.springframework.data.util.TypeInformation;
*/
public class SimpleElasticsearchMappingContext extends
AbstractMappingContext<SimpleElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> implements ApplicationContextAware{
AbstractMappingContext<SimpleElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> implements ApplicationContextAware {
private ApplicationContext context;
private ApplicationContext context;
@Override
@Override
protected <T> SimpleElasticsearchPersistentEntity<?> createPersistentEntity(TypeInformation<T> typeInformation) {
final SimpleElasticsearchPersistentEntity<T> persistentEntity =
new SimpleElasticsearchPersistentEntity<T>(typeInformation);
if(context != null)
{
persistentEntity.setApplicationContext(context);
}
return persistentEntity;
final SimpleElasticsearchPersistentEntity<T> persistentEntity =
new SimpleElasticsearchPersistentEntity<T>(typeInformation);
if (context != null) {
persistentEntity.setApplicationContext(context);
}
return persistentEntity;
}
@Override
@@ -54,8 +53,8 @@ public class SimpleElasticsearchMappingContext extends
return new SimpleElasticsearchPersistentProperty(field, descriptor, owner, simpleTypeHolder);
}
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
this.context = context;
}
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
this.context = context;
}
}

View File

@@ -61,7 +61,7 @@ public class SimpleElasticsearchPersistentEntity<T> extends BasicPersistentEntit
public SimpleElasticsearchPersistentEntity(TypeInformation<T> typeInformation) {
super(typeInformation);
this.context = new StandardEvaluationContext();
this.parser = new SpelExpressionParser();
this.parser = new SpelExpressionParser();
Class<T> clazz = typeInformation.getType();
if (clazz.isAnnotationPresent(Document.class)) {

View File

@@ -46,7 +46,7 @@ public class UpdateQuery {
public void setUpdateRequest(UpdateRequest updateRequest) {
this.updateRequest = updateRequest;
}
public String getIndexName() {
return indexName;
}

View File

@@ -41,7 +41,7 @@ public class UpdateQueryBuilder {
this.updateRequest = updateRequest;
return this;
}
public UpdateQueryBuilder withIndexRequest(IndexRequest indexRequest) {
this.indexRequest = indexRequest;
return this;
@@ -76,7 +76,7 @@ public class UpdateQueryBuilder {
if (this.indexRequest != null) {
if (this.updateRequest == null) {
updateRequest = new UpdateRequest();
}
}
updateRequest.doc(indexRequest);
}
updateQuery.setUpdateRequest(updateRequest);

View File

@@ -45,7 +45,7 @@ public class ElasticsearchRepositoryBean<T> extends CdiRepositoryBean<T> {
* @param repositoryType must not be {@literal null}.
* @param beanManager must not be {@literal null}.
* @param customImplementationBean the bean for the custom implementation of the
* {@link org.springframework.data.repository.Repository}, can be {@literal null}.
* {@link org.springframework.data.repository.Repository}, can be {@literal null}.
*/
public ElasticsearchRepositoryBean(Bean<ElasticsearchOperations> operations, Set<Annotation> qualifiers,
Class<T> repositoryType, BeanManager beanManager, Bean<?> customImplementationBean) {