1 package com.mockobjects.vaj; 2 3 import java.util.*; 4 import com.ibm.ivj.util.builders.*; 5 import com.ibm.ivj.util.base.Package; 6 7 import com.mockobjects.*; 8 9 public class MockBuilderFactory implements BuilderFactory { 10 private ArrayList myTypeBuilders = new ArrayList(); 11 private SourceVerifier mySourceVerifier; 12 13 14 public MockBuilderFactory(SourceVerifier verifier) { 15 super(); 16 mySourceVerifier = verifier; 17 } 18 19 22 public MethodBuilder createMethodBuilder(String builderName) throws java.lang.IllegalArgumentException { 23 return new MockMethodBuilder(mySourceVerifier,builderName); 24 } 25 26 29 public com.ibm.ivj.util.builders.TypeBuilder createTypeBuilder(com.ibm.ivj.util.base.Type aType) throws java.lang.IllegalArgumentException , com.ibm.ivj.util.base.IvjException { 30 return createTypeBuilder(aType.getName(),null); 31 } 32 33 36 public com.ibm.ivj.util.builders.TypeBuilder createTypeBuilder(String typeName, Package pkg) throws java.lang.IllegalArgumentException , com.ibm.ivj.util.base.IvjException { 37 MockTypeBuilder builder = new MockTypeBuilder(mySourceVerifier,typeName); 38 myTypeBuilders.add(builder); 39 return builder; 40 } 41 42 45 public java.lang.String createUserCodeBlock(java.lang.String arg1, java.lang.String arg2) { 46 return null; 47 } 48 49 52 53 public void verify() { 54 for(Iterator it = myTypeBuilders.iterator();it.hasNext();) { 55 ((MockTypeBuilder)it.next()).verify(); 56 } 57 } 58 } 59 | Popular Tags |