EMMA Coverage Report (generated Thu May 22 12:08:10 CDT 2014)
[all classes][org.springframework.batch.core.step]

COVERAGE SUMMARY FOR SOURCE FILE [StepLocatorStepFactoryBean.java]

nameclass, %method, %block, %line, %
StepLocatorStepFactoryBean.java100% (1/1)83%  (5/6)90%  (19/21)88%  (7/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StepLocatorStepFactoryBean100% (1/1)83%  (5/6)90%  (19/21)88%  (7/8)
isSingleton (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
StepLocatorStepFactoryBean (): void 100% (1/1)100% (3/3)100% (1/1)
getObject (): Step 100% (1/1)100% (6/6)100% (1/1)
getObjectType (): Class 100% (1/1)100% (2/2)100% (1/1)
setStepLocator (StepLocator): void 100% (1/1)100% (4/4)100% (2/2)
setStepName (String): void 100% (1/1)100% (4/4)100% (2/2)

1/*
2 * Copyright 2012-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.batch.core.step;
17 
18import org.springframework.batch.core.Job;
19import org.springframework.batch.core.Step;
20import org.springframework.beans.factory.FactoryBean;
21 
22/**
23 * Convenience factory for {@link Step} instances given a {@link StepLocator}.
24 * Most implementations of {@link Job} implement StepLocator, so that can be a
25 * good starting point.
26 *
27 * @author Dave Syer
28 *
29 */
30public class StepLocatorStepFactoryBean implements FactoryBean<Step> {
31 
32        public StepLocator stepLocator;
33 
34        public String stepName;
35 
36        /**
37         * @param stepLocator
38         */
39        public void setStepLocator(StepLocator stepLocator) {
40                this.stepLocator = stepLocator;
41        }
42 
43        /**
44         * @param stepName
45         */
46        public void setStepName(String stepName) {
47                this.stepName = stepName;
48        }
49 
50        /**
51         *
52         * @see FactoryBean#getObject()
53         */
54        @Override
55        public Step getObject() throws Exception {
56                return stepLocator.getStep(stepName);
57        }
58 
59        /**
60         * Tell clients that we are a factory for {@link Step} instances.
61         *
62         * @see FactoryBean#getObjectType()
63         */
64        @Override
65        public Class<? extends Step> getObjectType() {
66                return Step.class;
67        }
68 
69        /**
70         * Always return true as optimization for bean factory.
71         *
72         * @see FactoryBean#isSingleton()
73         */
74        @Override
75        public boolean isSingleton() {
76                return true;
77        }
78 
79}

[all classes][org.springframework.batch.core.step]
EMMA 2.0.5312 (C) Vladimir Roubtsov