01: /*
02: * Copyright (C) The Spice Group. All rights reserved.
03: *
04: * This software is published under the terms of the Spice
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna.tools.verifier;
09:
10: import org.codehaus.metaclass.introspector.MetaClassAccessor;
11: import org.codehaus.metaclass.introspector.MetaClassException;
12: import org.codehaus.metaclass.model.ClassDescriptor;
13: import org.codehaus.metaclass.model.Attribute;
14: import org.codehaus.metaclass.model.FieldDescriptor;
15: import org.codehaus.metaclass.model.MethodDescriptor;
16: import java.util.Properties;
17: import java.awt.event.ActionListener;
18:
19: /**
20: *
21: * @author Peter Donald
22: * @version $Revision: 1.1 $ $Date: 2004/04/18 20:13:44 $
23: */
24: class BadServiceAccessor implements MetaClassAccessor {
25: static final String BAD_SERVICE = "I-No-Exist!";
26:
27: public ClassDescriptor getClassDescriptor(final String classname,
28: final ClassLoader classLoader,
29: final MetaClassAccessor accessor) throws MetaClassException {
30: final Properties bad = new Properties();
31: bad.setProperty("type", ActionListener.class.getName());
32:
33: final Properties good = new Properties();
34: good.setProperty("type", BAD_SERVICE);
35: final Attribute[] attributes = new Attribute[] {
36: new Attribute("dna.component"),
37: new Attribute("dna.service", bad),
38: new Attribute("dna.service", good) };
39: return new ClassDescriptor(classname, attributes, attributes,
40: FieldDescriptor.EMPTY_SET, MethodDescriptor.EMPTY_SET);
41: }
42: }
|