EMMA Coverage Report (generated Mon Jan 28 10:01:43 GMT 2013)
[all classes][org.springframework.data.elasticsearch.repository.support]

COVERAGE SUMMARY FOR SOURCE FILE [ElasticsearchRepositoryFactoryBean.java]

nameclass, %method, %block, %line, %
ElasticsearchRepositoryFactoryBean.java100% (1/1)100% (4/4)100% (22/22)100% (8/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ElasticsearchRepositoryFactoryBean100% (1/1)100% (4/4)100% (22/22)100% (8/8)
ElasticsearchRepositoryFactoryBean (): void 100% (1/1)100% (3/3)100% (1/1)
afterPropertiesSet (): void 100% (1/1)100% (7/7)100% (3/3)
createRepositoryFactory (): RepositoryFactorySupport 100% (1/1)100% (6/6)100% (1/1)
setElasticsearchOperations (ElasticsearchOperations): void 100% (1/1)100% (6/6)100% (3/3)

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.repository.support;
17 
18import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
19import org.springframework.data.repository.Repository;
20import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
21import org.springframework.data.repository.core.support.RepositoryFactorySupport;
22import org.springframework.util.Assert;
23 
24import java.io.Serializable;
25 
26/**
27 * Spring {@link org.springframework.beans.factory.FactoryBean} implementation to ease container based configuration for XML namespace and JavaConfig.
28 * 
29 */
30public class ElasticsearchRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends
31        RepositoryFactoryBeanSupport<T, S, ID> {
32 
33        private ElasticsearchOperations operations;
34 
35        /**
36         * Configures the {@link ElasticsearchOperations} to be used to create Elasticsearch repositories.
37         * 
38         * @param operations the operations to set
39         */
40        public void setElasticsearchOperations(ElasticsearchOperations operations) {
41                Assert.notNull(operations);
42                this.operations = operations;
43        }
44 
45        /*
46         * (non-Javadoc)
47         * @see org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport#afterPropertiesSet()
48         */
49        @Override
50        public void afterPropertiesSet() {
51        super.afterPropertiesSet();
52                Assert.notNull(operations, "ElasticsearchOperations must be configured!");
53        }
54 
55 
56    @Override
57    protected RepositoryFactorySupport createRepositoryFactory() {
58        return new ElasticsearchRepositoryFactory(operations);
59    }
60 
61}

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