KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > tools > OPP > srcgen > resolve > CompositeMethodResolver


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: CompositeMethodResolver.java,v 1.2 2003/11/07 21:34:22 per_nyfelt Exp $
8
package org.ozoneDB.tools.OPP.srcgen.resolve;
9
10 import org.ozoneDB.tools.OPP.srcgen.MethodResolver;
11 import org.ozoneDB.tools.OPP.srcgen.ResolverException;
12
13 import java.util.*;
14
15 /**
16  * Merges the result from all composed resolvers.
17  */

18 public class CompositeMethodResolver implements MethodResolver {
19     private Set resolvers;
20
21     public CompositeMethodResolver() {
22         resolvers = new HashSet();
23     }
24
25     public void resolveMethods(String JavaDoc className, MethodResolver.UpdateMethodBag result) throws ResolverException {
26         for (Iterator iter = resolvers.iterator(); iter.hasNext();) {
27             final MethodResolver methodResolver = (MethodResolver) iter.next();
28             methodResolver.resolveMethods(className, result);
29         }
30     }
31
32     public void addResolver(MethodResolver resolver) {
33         resolvers.add(resolver);
34     }
35
36     public void removeResolver(MethodResolver resolver) {
37         resolvers.remove(resolver);
38     }
39 }
40
Popular Tags