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

COVERAGE SUMMARY FOR SOURCE FILE [FlowStepBuilder.java]

nameclass, %method, %block, %line, %
FlowStepBuilder.java100% (1/1)100% (3/3)83%  (29/35)85%  (11/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FlowStepBuilder100% (1/1)100% (3/3)83%  (29/35)85%  (11/13)
build (): Step 100% (1/1)77%  (20/26)78%  (7/9)
FlowStepBuilder (StepBuilderHelper): void 100% (1/1)100% (4/4)100% (2/2)
flow (Flow): FlowStepBuilder 100% (1/1)100% (5/5)100% (2/2)

1/*
2 * Copyright 2006-2011 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.builder;
17 
18import org.springframework.batch.core.Step;
19import org.springframework.batch.core.job.flow.Flow;
20import org.springframework.batch.core.job.flow.FlowStep;
21 
22/**
23 * A step builder for {@link FlowStep} instances. A flow step delegates processing to a nested flow composed of other
24 * steps.
25 * 
26 * @author Dave Syer
27 * 
28 * @since 2.2
29 */
30public class FlowStepBuilder extends StepBuilderHelper<FlowStepBuilder> {
31 
32        private Flow flow;
33 
34        /**
35         * Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.
36         * 
37         * @param parent a parent helper containing common step properties
38         */
39        public FlowStepBuilder(StepBuilderHelper<?> parent) {
40                super(parent);
41        }
42 
43        /**
44         * Provide a flow to execute during the step.
45         * 
46         * @param flow the flow to execute
47         * @return this for fluent chaining
48         */
49        public FlowStepBuilder flow(Flow flow) {
50                this.flow = flow;
51                return this;
52        }
53 
54        /**
55         * Build a step that executes the flow provided, normally composed of other steps. The flow is not executed in a
56         * transaction because the individual steps are supposed to manage their own transaction state.
57         * 
58         * @return a flow step
59         */
60        public Step build() {
61                FlowStep step = new FlowStep();
62                step.setName(getName());
63                step.setFlow(flow);
64                super.enhance(step);
65                try {
66                        step.afterPropertiesSet();
67                }
68                catch (Exception e) {
69                        throw new StepBuilderException(e);
70                }
71                return step;
72        }
73 
74}

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