KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > vaj > MockBuilderFactory


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     /**
20      * createMethodBuilder method comment.
21      */

22     public MethodBuilder createMethodBuilder(String JavaDoc builderName) throws java.lang.IllegalArgumentException JavaDoc {
23         return new MockMethodBuilder(mySourceVerifier,builderName);
24     }
25
26     /**
27      * createTypeBuilder method comment.
28      */

29     public com.ibm.ivj.util.builders.TypeBuilder createTypeBuilder(com.ibm.ivj.util.base.Type aType) throws java.lang.IllegalArgumentException JavaDoc, com.ibm.ivj.util.base.IvjException {
30         return createTypeBuilder(aType.getName(),null);
31     }
32
33     /**
34      * createTypeBuilder method comment.
35      */

36     public com.ibm.ivj.util.builders.TypeBuilder createTypeBuilder(String JavaDoc typeName, Package JavaDoc pkg) throws java.lang.IllegalArgumentException JavaDoc, com.ibm.ivj.util.base.IvjException {
37         MockTypeBuilder builder = new MockTypeBuilder(mySourceVerifier,typeName);
38         myTypeBuilders.add(builder);
39         return builder;
40     }
41
42     /**
43      * createUserCodeBlock method comment.
44      */

45     public java.lang.String JavaDoc createUserCodeBlock(java.lang.String JavaDoc arg1, java.lang.String JavaDoc arg2) {
46         return null;
47     }
48
49     /**
50      * Mock method
51      */

52
53     public void verify() {
54         for(Iterator it = myTypeBuilders.iterator();it.hasNext();) {
55             ((MockTypeBuilder)it.next()).verify();
56         }
57     }
58 }
59
Popular Tags