EMMA Coverage Report (generated Tue Mar 05 16:36:55 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 2013 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/**
30 *  MappingElasticsearchConverter
31 *
32 * @author Rizwan Idrees
33 * @author Mohsin Husen
34 */
35 
36public class MappingElasticsearchConverter implements ElasticsearchConverter, ApplicationContextAware{
37 
38        private final MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext;
39        private final GenericConversionService conversionService;
40 
41        @SuppressWarnings("unused")
42        private ApplicationContext applicationContext;
43 
44        public MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext) {
45                Assert.notNull(mappingContext);
46                this.mappingContext = mappingContext;
47                this.conversionService = new DefaultConversionService();
48        }
49 
50        @Override
51        public MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> getMappingContext() {
52                return mappingContext;
53        }
54 
55        @Override
56        public ConversionService getConversionService() {
57                return this.conversionService;
58        }
59 
60        @Override
61        public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
62                this.applicationContext = applicationContext;
63        }
64 
65}

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