|
1 | | -/******************************************************************************* |
2 | | - Copyright 2013 Benjamin Fagin |
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 | | -
|
16 | | -
|
17 | | - Read the included LICENSE.TXT for more information. |
18 | | - ******************************************************************************/ |
19 | | - |
20 | 1 | // # Flapi |
21 | 2 | // ### _A fluent API generator for Java_ |
22 | 3 |
|
|
38 | 19 | * runtime classes and generated interfaces. The generated sources should |
39 | 20 | * be included in your project, perhaps as a module dependency. (This project |
40 | 21 | * also contains a maven plugin which allows you to regenerate your sources |
41 | | - * on the fly. See more [here](https://github.com/UnquietCode/Flapi/wiki)). |
| 22 | + * on the fly. See more [here](https://github.com/UnquietCode/Flapi/wiki/Maven-Build-Plugin)). |
42 | 23 | * |
43 | 24 | * |
44 | 25 | * ### At Run Time |
|
154 | 135 | * moving in to and out of blocks, by way of Java's type system, until |
155 | 136 | * you finally 'escape' the top block or a value is returned from the |
156 | 137 | * current block. |
157 | | - * |
158 | | - * A new block is defined by calling the `startBlock(...)` method, |
159 | | - * passing in the method signature and the optional name. This |
160 | | - * returns a `MethodBuilder` object which allows you to customize |
161 | | - * the invocation in the parent block. Methods will be discussed in |
162 | | - * just a moment. |
| 138 | + * |
| 139 | + * A block is comprised of methods, and these roughly correspond |
| 140 | + * to the methods found in the generated interfaces. Methods will |
| 141 | + * be discussed in just a moment. |
163 | 142 | */ |
164 | 143 |
|
165 | 144 | .startBlock("SomeBlock", "beginSomething()").any() |
|
176 | 155 | /** |
177 | 156 | * ### BlockBuilder Methods |
178 | 157 | * |
179 | | - * A block consists is started with `startBlock(...)` and must |
180 | | - * end with a call to `endBlock()`. This is due to an important |
181 | | - * disadvantage of method chaining: it's impossible to know |
182 | | - * when the user is 'done' without an explicit method call. |
| 158 | + * A new block is started with `startBlock(...)` and must |
| 159 | + * end with a call to `endBlock()`. There should |
| 160 | + * be at least one method in every block which is marked as a |
| 161 | + * terminal method (via `last(...)`). There is one exception to |
| 162 | + * this rule, which is when all of your methods are disappearing |
| 163 | + * (via `atMost(...)`). In that case, a warning is printed and |
| 164 | + * the last method available in each state is marked as terminal. |
183 | 165 | */ |
184 | 166 |
|
185 | 167 | // Start a new block. This can be called either from the top level |
|
191 | 173 | // generated, and so they cannot be referenced. |
192 | 174 | .startBlock(String methodSignature) |
193 | 175 |
|
194 | | -// end the current block (**required**) |
| 176 | +// End the current block. Returns a `MethodBuilder` to |
| 177 | +// configure the invocation in the parent. (**required**) |
195 | 178 | .endBlock() |
196 | 179 |
|
197 | | -/** |
198 | | - * ### Block Methods |
199 | | - * |
200 | | - * A block is comprised of methods, and these roughly correspond |
201 | | - * to the methods found in the generated interfaces. There should |
202 | | - * be at least one method in every block which is marked as a |
203 | | - * terminal method (via `last(...)`). There is one exception to |
204 | | - * this rule, which is when all of your methods are disappearing |
205 | | - * (via `atMost(...)`). In that case, a warning is printed and |
206 | | - * the last method available in each state is marked as terminal. |
207 | | - */ |
208 | | - |
209 | 180 | // Add a new method to the block. If no return type is provided |
210 | 181 | // then `void` is inferred. |
211 | 182 | .addMethod("someMethod()").any() |
|
0 commit comments