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.dna.ResourceLocator;
11: import org.codehaus.metaclass.introspector.MetaClassAccessor;
12: import org.codehaus.metaclass.introspector.MetaClassException;
13: import org.codehaus.metaclass.model.Attribute;
14: import org.codehaus.metaclass.model.ClassDescriptor;
15: import org.codehaus.metaclass.model.FieldDescriptor;
16: import org.codehaus.metaclass.model.MethodDescriptor;
17: import org.codehaus.metaclass.model.ParameterDescriptor;
18: import java.util.Properties;
19: import java.awt.event.ActionListener;
20:
21: /**
22: *
23: * @author Peter Donald
24: * @version $Revision: 1.1 $ $Date: 2004/04/18 20:13:44 $
25: */
26: class AccessorWithDependencyMetaData implements MetaClassAccessor {
27: public ClassDescriptor getClassDescriptor(final String classname,
28: final ClassLoader classLoader,
29: final MetaClassAccessor accessor) throws MetaClassException {
30: final Properties parameters = new Properties();
31: parameters.setProperty("optional", "false");
32: parameters.setProperty("type", ActionListener.class.getName());
33: parameters.setProperty("key", ActionListener.class.getName());
34: final Attribute attribute = new Attribute("dna.dependency",
35: parameters);
36: final Attribute[] attributes = new Attribute[] { attribute };
37: final ParameterDescriptor param = new ParameterDescriptor(
38: "locator", ResourceLocator.class.getName());
39: final ParameterDescriptor[] params = new ParameterDescriptor[] { param };
40: final MethodDescriptor descriptor = new MethodDescriptor(
41: "compose", "", params, attributes, attributes);
42: return new ClassDescriptor(classname, Attribute.EMPTY_SET,
43: Attribute.EMPTY_SET, FieldDescriptor.EMPTY_SET,
44: new MethodDescriptor[] { descriptor });
45: }
46: }
|