01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on Jan 24, 2004
17: */
18: package org.geotools.validation;
19:
20: import java.beans.IntrospectionException;
21: import java.beans.PropertyDescriptor;
22: import java.util.ResourceBundle;
23:
24: /**
25: * DefaultFeatureValidationBeanInfo purpose.
26: *
27: * <p>
28: * Description of DefaultFeatureValidationBeanInfo ...
29: * </p>
30: *
31: * @author dzwiers, Refractions Research, Inc.
32: * @author $Author: dmzwiers $ (last modification)
33: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/DefaultFeatureValidationBeanInfo.java $
34: * @version $Id: DefaultFeatureValidationBeanInfo.java 22266 2006-10-19 11:30:55Z acuster $
35: */
36: public class DefaultFeatureValidationBeanInfo extends
37: ValidationBeanInfo {
38: /**
39: * DefaultFeatureValidationBeanInfo constructor.
40: *
41: * <p>
42: * super
43: * </p>
44: */
45: public DefaultFeatureValidationBeanInfo() {
46: super ();
47: }
48:
49: /**
50: * Implementation of getPropertyDescriptors. This method should be called
51: * by all overriding sub-class methods. Property names 'name',
52: * 'description', 'typeNames'
53: *
54: *
55: * @see java.beans.BeanInfo#getPropertyDescriptors()
56: */
57: public PropertyDescriptor[] getPropertyDescriptors() {
58: try {
59: PropertyDescriptor[] tmp = super .getPropertyDescriptors();
60: PropertyDescriptor[] pd = new PropertyDescriptor[1 + tmp.length];
61: ResourceBundle resourceBundle = getResourceBundle(DefaultFeatureValidation.class);
62: int i = 0;
63:
64: for (; i < tmp.length; i++)
65: pd[i] = tmp[i];
66:
67: pd[i] = createPropertyDescriptor("typeRef",
68: DefaultFeatureValidation.class, resourceBundle);
69: pd[i].setExpert(false);
70:
71: return pd;
72: } catch (IntrospectionException e) {
73: // TODO error, log here
74: e.printStackTrace();
75:
76: return new PropertyDescriptor[0];
77: }
78: }
79: }
|