Permalink
Browse files

Building off of newly generated classes (with a few manual fixes).

  • Loading branch information...
UnquietCode committed Apr 26, 2012
1 parent d7d5dd8 commit 2994d95690b60ab0a5c0332e8951e62b5aca1f18
Showing with 1,961 additions and 441 deletions.
  1. +4 −12 src/main/java/unquietcode/tools/flapi/BlockChainHelperImpl.java
  2. +16 −24 src/main/java/unquietcode/tools/flapi/BlockHelperImpl.java
  3. +26 −4 src/main/java/unquietcode/tools/flapi/DescriptorHelperImpl.java
  4. +2 −9 src/main/java/unquietcode/tools/flapi/MethodHelperImpl.java
  5. +12 −8 src/main/java/unquietcode/tools/flapi/builder/BlockBuilder.java
  6. +13 −9 src/main/java/unquietcode/tools/flapi/builder/BlockBuilder_addBlockChain.java
  7. +9 −7 src/main/java/unquietcode/tools/flapi/builder/BlockChainBuilder.java
  8. +10 −8 src/main/java/unquietcode/tools/flapi/builder/BlockChainBuilder_addBlockChain.java
  9. +10 −8 src/main/java/unquietcode/tools/flapi/builder/BlockChainHelper.java
  10. +13 −10 src/main/java/unquietcode/tools/flapi/builder/BlockHelper.java
  11. +12 −9 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder.java
  12. +16 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName.java
  13. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_setPackage.java
  14. +24 −0 ...r/DescriptorBuilder_setDescriptorName_setPackage_setReturnType_setStartingMethodName_showLog.java
  15. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_setReturnType.java
  16. +20 −0 ...unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_setReturnType_setPackage.java
  17. +20 −0 .../tools/flapi/builder/DescriptorBuilder_setDescriptorName_setReturnType_setStartingMethodName.java
  18. +18 −0 ...va/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_setStartingMethodName.java
  19. +20 −0 ...ode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_setStartingMethodName_setPackage.java
  20. +22 −0 ...i/builder/DescriptorBuilder_setDescriptorName_setStartingMethodName_setReturnType_setPackage.java
  21. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_showLog.java
  22. +20 −0 .../java/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_showLog_setPackage.java
  23. +20 −0 ...va/unquietcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_showLog_setReturnType.java
  24. +22 −0 ...ode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_showLog_setReturnType_setPackage.java
  25. +20 −0 ...etcode/tools/flapi/builder/DescriptorBuilder_setDescriptorName_showLog_setStartingMethodName.java
  26. +22 −0 ...s/flapi/builder/DescriptorBuilder_setDescriptorName_showLog_setStartingMethodName_setPackage.java
  27. +22 −0 ...lapi/builder/DescriptorBuilder_setDescriptorName_showLog_setStartingMethodName_setReturnType.java
  28. +12 −9 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setPackage.java
  29. +0 −14 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setPackage_showLog.java
  30. +16 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setReturnType.java
  31. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setReturnType_setPackage.java
  32. +20 −0 ...ietcode/tools/flapi/builder/DescriptorBuilder_setReturnType_setStartingMethodName_setPackage.java
  33. +16 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setStartingMethodName.java
  34. +18 −0 ...main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setStartingMethodName_setPackage.java
  35. +18 −0 ...n/java/unquietcode/tools/flapi/builder/DescriptorBuilder_setStartingMethodName_setReturnType.java
  36. +12 −9 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog.java
  37. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setPackage.java
  38. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setReturnType.java
  39. +20 −0 ...main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setReturnType_setPackage.java
  40. +20 −0 ...nquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setReturnType_setStartingMethodName.java
  41. +18 −0 src/main/java/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setStartingMethodName.java
  42. +20 −0 ...a/unquietcode/tools/flapi/builder/DescriptorBuilder_showLog_setStartingMethodName_setPackage.java
  43. +22 −0 ...tools/flapi/builder/DescriptorBuilder_showLog_setStartingMethodName_setReturnType_setPackage.java
  44. +11 −13 src/main/java/unquietcode/tools/flapi/builder/DescriptorGenerator.java
  45. +18 −11 src/main/java/unquietcode/tools/flapi/builder/DescriptorHelper.java
  46. +47 −39 src/main/java/unquietcode/tools/flapi/builder/ImplBlockBuilder.java
  47. +19 −13 src/main/java/unquietcode/tools/flapi/builder/ImplBlockBuilder_addBlockChain.java
  48. +28 −25 src/main/java/unquietcode/tools/flapi/builder/ImplBlockChainBuilder.java
  49. +20 −13 src/main/java/unquietcode/tools/flapi/builder/ImplBlockChainBuilder_addBlockChain.java
  50. +39 −34 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder.java
  51. +21 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName.java
  52. +27 −0 ...main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setPackage.java
  53. +45 −0 ...plDescriptorBuilder_setDescriptorName_setPackage_setReturnType_setStartingMethodName_showLog.java
  54. +27 −0 ...n/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setReturnType.java
  55. +33 −0 ...ietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setReturnType_setPackage.java
  56. +33 −0 ...ls/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setReturnType_setStartingMethodName.java
  57. +27 −0 ...nquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setStartingMethodName.java
  58. +33 −0 ...tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_setStartingMethodName_setPackage.java
  59. +39 −0 ...ilder/ImplDescriptorBuilder_setDescriptorName_setStartingMethodName_setReturnType_setPackage.java
  60. +27 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_showLog.java
  61. +33 −0 ...a/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_showLog_setPackage.java
  62. +33 −0 ...nquietcode/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_showLog_setReturnType.java
  63. +39 −0 ...tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_showLog_setReturnType_setPackage.java
  64. +33 −0 ...de/tools/flapi/builder/ImplDescriptorBuilder_setDescriptorName_showLog_setStartingMethodName.java
  65. +39 −0 ...api/builder/ImplDescriptorBuilder_setDescriptorName_showLog_setStartingMethodName_setPackage.java
  66. +39 −0 .../builder/ImplDescriptorBuilder_setDescriptorName_showLog_setStartingMethodName_setReturnType.java
  67. +17 −13 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setPackage.java
  68. +0 −23 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setPackage_showLog.java
  69. +21 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setReturnType.java
  70. +27 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setReturnType_setPackage.java
  71. +33 −0 ...ode/tools/flapi/builder/ImplDescriptorBuilder_setReturnType_setStartingMethodName_setPackage.java
  72. +21 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setStartingMethodName.java
  73. +27 −0 .../java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setStartingMethodName_setPackage.java
  74. +27 −0 ...va/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_setStartingMethodName_setReturnType.java
  75. +17 −13 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog.java
  76. +27 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setPackage.java
  77. +27 −0 src/main/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setReturnType.java
  78. +33 −0 .../java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setReturnType_setPackage.java
  79. +33 −0 ...etcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setReturnType_setStartingMethodName.java
  80. +27 −0 ...ain/java/unquietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setStartingMethodName.java
  81. +33 −0 ...quietcode/tools/flapi/builder/ImplDescriptorBuilder_showLog_setStartingMethodName_setPackage.java
  82. +39 −0 ...s/flapi/builder/ImplDescriptorBuilder_showLog_setStartingMethodName_setReturnType_setPackage.java
  83. +50 −48 src/main/java/unquietcode/tools/flapi/builder/ImplMethodBuilder.java
  84. +19 −13 src/main/java/unquietcode/tools/flapi/builder/ImplMethodBuilder_addBlockChain.java
  85. +17 −11 src/main/java/unquietcode/tools/flapi/builder/MethodBuilder.java
  86. +19 −13 src/main/java/unquietcode/tools/flapi/builder/MethodBuilder_addBlockChain.java
  87. +18 −13 src/main/java/unquietcode/tools/flapi/builder/MethodHelper.java
  88. +6 −6 src/test/java/unquietcode/tools/flapi/ActualDescriptorTest.java
@@ -5,10 +5,6 @@
import unquietcode.tools.flapi.outline.BlockOutline;
import unquietcode.tools.flapi.outline.MethodOutline;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author Ben Fagin
* @version 04-21-2012
@@ -31,20 +27,16 @@ public void addBlockReference(String blockName) {
}
@Override
public List<Object> startBlock(String blockName) {
public void startBlock(String methodSignature, String blockName, ObjectWrapper<BlockHelper> _helper1) {
BlockOutline anonymousBlock = new BlockOutline();
anonymousBlock.name = blockName;
blockMethod.blockChain.add(0, anonymousBlock);
List<Object> helpers = new ArrayList<Object>();
helpers.add(new BlockHelperImpl(anonymousBlock));
return helpers;
_helper1.set(new BlockHelperImpl(anonymousBlock));
}
@Override
public List<Object> addBlockChain() {
List<Object> helpers = new ArrayList<Object>();
helpers.add(new BlockChainHelperImpl(blockMethod));
return helpers;
public void addBlockChain(ObjectWrapper<BlockChainHelper> _helper1) {
_helper1.set(new BlockChainHelperImpl(blockMethod));
}
}
@@ -1,6 +1,8 @@
package unquietcode.tools.flapi;
import unquietcode.tools.flapi.builder.BlockChainHelper;
import unquietcode.tools.flapi.builder.BlockHelper;
import unquietcode.tools.flapi.builder.MethodHelper;
import unquietcode.tools.flapi.outline.BlockOutline;
import unquietcode.tools.flapi.outline.MethodOutline;
@@ -18,39 +20,34 @@
public BlockHelperImpl(BlockOutline block) {
this.block = block;
}
@Override
public List<Object> addMethod(String methodSignature) {
return _addMethod(block, methodSignature);
public void addMethod(String methodSignature, ObjectWrapper<MethodHelper> _helper1) {
_addMethod(block, methodSignature, _helper1);
}
static List<Object> _addMethod(BlockOutline block, String methodSignature) {
static void _addMethod(BlockOutline block, String methodSignature, ObjectWrapper<MethodHelper> _helper1) {
MethodOutline m = block.addMethod(methodSignature);
ArrayList<Object> helpers = new ArrayList<Object>();
helpers.add(new MethodHelperImpl(m));
return helpers;
_helper1.set(new MethodHelperImpl(m));
}
@Override
public List<Object> startBlock(String blockName, String methodSignature) {
return _startBlock(block, blockName, methodSignature);
public void startBlock(String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1, ObjectWrapper<BlockHelper> _helper2) {
_startBlock(block, blockName, methodSignature, _helper1, _helper2);
}
static List<Object> _startBlock(BlockOutline block, String blockName, String methodSignature) {
static void _startBlock(BlockOutline block, String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1, ObjectWrapper<BlockHelper> _helper2) {
BlockOutline newBlock = block.addBlock(blockName);
MethodOutline blockMethod = block.addMethod(methodSignature);
blockMethod.blockChain.add(0, newBlock);
newBlock.constructor = blockMethod;
List<Object> helpers = new ArrayList<Object>();
helpers.add(new MethodHelperImpl(blockMethod));
helpers.add(new BlockHelperImpl(newBlock));
return helpers;
_helper1.set(new MethodHelperImpl(blockMethod));
_helper2.set(new BlockHelperImpl(newBlock));
}
@Override
public List<Object> addBlockReference(String blockName, String methodSignature) {
public void addBlockReference(String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1) {
BlockReference blockReference = new BlockReference();
blockReference.name = blockName;
@@ -60,10 +57,7 @@ public BlockHelperImpl(BlockOutline block) {
block.methods.add(blockMethod);
blockReference.constructor = blockMethod;
MethodHelperImpl helper = new MethodHelperImpl(blockMethod);
List<Object> helpers = new ArrayList<Object>();
helpers.add(helper);
return helpers;
_helper1.set(new MethodHelperImpl(blockMethod));
}
@Override
@@ -72,9 +66,7 @@ public void endBlock() {
}
@Override
public List<Object> addBlockChain() {
List<Object> helpers = new ArrayList<Object>();
helpers.add(new BlockChainHelperImpl(block.constructor));
return helpers;
public void addBlockChain(ObjectWrapper<BlockChainHelper> _helper1) {
_helper1.set(new BlockChainHelperImpl(block.constructor));
}
}
@@ -1,6 +1,8 @@
package unquietcode.tools.flapi;
import unquietcode.tools.flapi.builder.BlockHelper;
import unquietcode.tools.flapi.builder.DescriptorHelper;
import unquietcode.tools.flapi.builder.MethodHelper;
import unquietcode.tools.flapi.outline.DescriptorOutline;
import java.util.List;
@@ -17,6 +19,26 @@ public Descriptor _getReturnValue() {
return new Descriptor(this);
}
@Override
public void setDescriptorName(String descriptorName) {
// nothing
}
@Override
public void setReturnType(Class returnType) {
// nothing
}
@Override
public void setStartingMethodName(String methodName) {
// nothing
}
@Override
public void build() {
// nothing
}
public void _setDescriptorName(String name) {
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException("Name cannot be empty.");
@@ -40,12 +62,12 @@ public void showLog(boolean value) {
}
@Override
public List<Object> addMethod(String methodSignature) {
return BlockHelperImpl._addMethod(outline.selfBlock, methodSignature);
public void addMethod(String methodSignature, ObjectWrapper<MethodHelper> _helper1) {
BlockHelperImpl._addMethod(outline.selfBlock, methodSignature, _helper1);
}
@Override
public List<Object> startBlock(String blockName, String methodSignature) {
return BlockHelperImpl._startBlock(outline.selfBlock, blockName, methodSignature);
public void startBlock(String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1, ObjectWrapper<BlockHelper> _helper2) {
BlockHelperImpl._startBlock(outline.selfBlock, blockName, methodSignature, _helper1, _helper2);
}
}
@@ -67,14 +67,7 @@ public void between(int atLeast, int atMost) {
}
@Override
public List<Object> addBlockChain() {
// TODO haven't thought this through yet
// Ideally a helper should not have to implement anything to handle a block reference
BlockChainHelper helper = new BlockChainHelperImpl(method);
List<Object> helpers = new ArrayList<Object>();
helpers.add(helper);
return helpers;
public void addBlockChain(ObjectWrapper<BlockChainHelper> _helper1) {
_helper1.set(new BlockChainHelperImpl(method));
}
}
@@ -1,12 +1,16 @@
package unquietcode.tools.flapi.builder;
/**
* @author Ben Fagin
* @version 03-04-2012
*/
public interface BlockBuilder<_ReturnType> {
MethodBuilder_addBlockChain<BlockBuilder<_ReturnType>> addMethod(String methodSignature);
public interface BlockBuilder<_ReturnType >{
MethodBuilder_addBlockChain<BlockBuilder<_ReturnType>> addBlockReference(String blockName, String methodSignature);
MethodBuilder_addBlockChain<BlockBuilder<_ReturnType>> addMethod(String methodSignature);
_ReturnType endBlock();
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<BlockBuilder<_ReturnType>>> startBlock(String blockName, String methodSignature);
MethodBuilder_addBlockChain<BlockBuilder<_ReturnType>> addBlockReference(String blockName, String methodSignature);
_ReturnType endBlock();
}
@@ -1,14 +1,18 @@
package unquietcode.tools.flapi.builder;
/**
* @author Ben Fagin
* @version 04-21-2012
*/
public interface BlockBuilder_addBlockChain<_ReturnType> {
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<_ReturnType>> addMethod(String methodSignature);
public interface BlockBuilder_addBlockChain<_ReturnType >{
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<_ReturnType>> addBlockReference(String blockName, String methodSignature);
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<_ReturnType>> addMethod(String methodSignature);
_ReturnType endBlock();
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<BlockBuilder_addBlockChain<_ReturnType>>> startBlock(String blockName, String methodSignature);
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<_ReturnType>> addBlockReference(String blockName, String methodSignature);
_ReturnType endBlock();
BlockChainBuilder_addBlockChain<BlockBuilder<_ReturnType>> addBlockChain();
BlockChainBuilder_addBlockChain<BlockBuilder<_ReturnType>> addBlockChain();
}
@@ -1,10 +1,12 @@
package unquietcode.tools.flapi.builder;
/**
* @author Ben Fagin
* @version 03-07-2012
*/
public interface BlockChainBuilder<_ReturnType> {
_ReturnType addBlockReference(String blockName);
_ReturnType startBlock(String blockName);
public interface BlockChainBuilder<_ReturnType >{
_ReturnType addBlockReference(String blockName);
BlockBuilder_addBlockChain<_ReturnType> startBlock(String methodSignature, String blockName);
}
@@ -1,12 +1,14 @@
package unquietcode.tools.flapi.builder;
/**
* @author Ben Fagin
* @version 04-21-2012
*/
public interface BlockChainBuilder_addBlockChain<_ReturnType> {
_ReturnType addBlockReference(String blockName);
_ReturnType startBlock(String blockName);
BlockChainBuilder<_ReturnType> addBlockChain(String blockName);
public interface BlockChainBuilder_addBlockChain<_ReturnType >{
_ReturnType addBlockReference(String blockName);
BlockBuilder_addBlockChain<_ReturnType> startBlock(String methodSignature, String blockName);
BlockChainBuilder_addBlockChain<BlockChainBuilder<_ReturnType>> addBlockChain();
}
@@ -1,13 +1,15 @@
package unquietcode.tools.flapi.builder;
import java.util.List;
import unquietcode.tools.flapi.ObjectWrapper;
/**
* @author Ben Fagin
* @version 04-21-2012
*/
public interface BlockChainHelper {
void addBlockReference(String blockName);
List<Object> startBlock(String blockName);
List<Object> addBlockChain();
void addBlockChain(ObjectWrapper<BlockChainHelper> _helper1);
void startBlock(String methodSignature, String blockName, ObjectWrapper<BlockHelper> _helper1);
void addBlockReference(String blockName);
}
@@ -1,16 +1,19 @@
package unquietcode.tools.flapi.builder;
import java.util.List;
import unquietcode.tools.flapi.ObjectWrapper;
/**
* @author Ben Fagin
* @version 03-04-2012
*/
public interface BlockHelper {
List<Object> addMethod(String methodSignature);
List<Object> startBlock(String blockName, String methodSignature);
List<Object> addBlockReference(String blockName, String methodSignature);
List<Object> addBlockChain();
void endBlock();
void addMethod(String methodSignature, ObjectWrapper<MethodHelper> _helper1);
void addBlockReference(String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1);
void endBlock();
void addBlockChain(ObjectWrapper<BlockChainHelper> _helper1);
void startBlock(String blockName, String methodSignature, ObjectWrapper<MethodHelper> _helper1, ObjectWrapper<BlockHelper> _helper2);
}
@@ -1,11 +1,14 @@
package unquietcode.tools.flapi.builder;
/**
* @author Ben Fagin
* @version 03-04-2012
*/
public interface DescriptorBuilder<_ReturnType> {
_ReturnType build();
MethodBuilder_addBlockChain<DescriptorBuilder<_ReturnType>> addMethod(String methodSignature);
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<DescriptorBuilder<_ReturnType>>> startBlock(String blockName, String methodSignature);
}
public interface DescriptorBuilder<_ReturnType >{
MethodBuilder_addBlockChain<DescriptorBuilder<_ReturnType>> addMethod(String methodSignature);
_ReturnType build();
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<DescriptorBuilder<_ReturnType>>> startBlock(String blockName, String methodSignature);
}
@@ -0,0 +1,16 @@
package unquietcode.tools.flapi.builder;
public interface DescriptorBuilder_setDescriptorName<_ReturnType >{
MethodBuilder_addBlockChain<DescriptorBuilder_setDescriptorName<_ReturnType>> addMethod(String methodSignature);
_ReturnType build();
MethodBuilder_addBlockChain<BlockBuilder_addBlockChain<DescriptorBuilder_setDescriptorName<_ReturnType>>> startBlock(String blockName, String methodSignature);
DescriptorBuilder<_ReturnType> setDescriptorName(String descriptorName);
}
Oops, something went wrong.

0 comments on commit 2994d95

Please sign in to comment.