EMMA Coverage Report (generated Mon Jan 28 16:15:17 GMT 2013)
[all classes][org.springframework.data.elasticsearch.core.convert]

COVERAGE SUMMARY FOR SOURCE FILE [MappingElasticsearchConverter.java]

nameclass, %method, %block, %line, %
MappingElasticsearchConverter.java100% (1/1)75%  (3/4)83%  (19/23)78%  (7/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MappingElasticsearchConverter100% (1/1)75%  (3/4)83%  (19/23)78%  (7/9)
setApplicationContext (ApplicationContext): void 0%   (0/1)0%   (0/4)0%   (0/2)
MappingElasticsearchConverter (MappingContext): void 100% (1/1)100% (13/13)100% (5/5)
getConversionService (): ConversionService 100% (1/1)100% (3/3)100% (1/1)
getMappingContext (): MappingContext 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * Copyright 2012 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.springframework.data.elasticsearch.core.convert;
17 
18import org.springframework.beans.BeansException;
19import org.springframework.context.ApplicationContext;
20import org.springframework.context.ApplicationContextAware;
21import org.springframework.core.convert.ConversionService;
22import org.springframework.core.convert.support.DefaultConversionService;
23import org.springframework.core.convert.support.GenericConversionService;
24import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity;
25import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty;
26import org.springframework.data.mapping.context.MappingContext;
27import org.springframework.util.Assert;
28 
29 
30public class MappingElasticsearchConverter implements ElasticsearchConverter, ApplicationContextAware{
31 
32        private final MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext;
33        private final GenericConversionService conversionService;
34 
35        @SuppressWarnings("unused")
36        private ApplicationContext applicationContext;
37 
38        public MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext) {
39                Assert.notNull(mappingContext);
40                this.mappingContext = mappingContext;
41                this.conversionService = new DefaultConversionService();
42        }
43 
44        @Override
45        public MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> getMappingContext() {
46                return mappingContext;
47        }
48 
49        @Override
50        public ConversionService getConversionService() {
51                return this.conversionService;
52        }
53 
54        @Override
55        public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
56                this.applicationContext = applicationContext;
57        }
58 
59}

[all classes][org.springframework.data.elasticsearch.core.convert]
EMMA 2.0.5312 (C) Vladimir Roubtsov