01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2004 TOPP - www.openplans.org
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * Created on Apr 27, 2004
18: */
19: package org.geotools.validation.relate;
20:
21: import java.beans.IntrospectionException;
22: import java.beans.PropertyDescriptor;
23: import java.util.ResourceBundle;
24:
25: import org.geotools.validation.DefaultIntegrityValidationBeanInfo;
26:
27: /**
28: * RelateIntegrityBeanInfo<br>
29: * @author bowens<br>
30: * Created Apr 27, 2004<br>
31: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/relate/RelateIntegrityBeanInfo.java $
32: * @version <br>
33: *
34: * <b>Puropse:</b><br>
35: * <p>
36: * DOCUMENT ME!!
37: * </p>
38: *
39: * <b>Description:</b><br>
40: * <p>
41: * DOCUMENT ME!!
42: * </p>
43: *
44: * <b>Usage:</b><br>
45: * <p>
46: * DOCUMENT ME!!
47: * </p>
48: */
49: public class RelateIntegrityBeanInfo extends
50: DefaultIntegrityValidationBeanInfo {
51:
52: /**
53: *
54: */
55: public RelateIntegrityBeanInfo() {
56: super ();
57: }
58:
59: /**
60: *
61: *
62: * (non-Javadoc)
63: * @see java.beans.BeanInfo#getPropertyDescriptors()
64: **/
65: public PropertyDescriptor[] getPropertyDescriptors() {
66: PropertyDescriptor[] pd2 = super .getPropertyDescriptors();
67: ResourceBundle resourceBundle = getResourceBundle();
68: if (pd2 == null) {
69: pd2 = new PropertyDescriptor[0];
70: }
71:
72: PropertyDescriptor[] pd = new PropertyDescriptor[pd2.length + 1];
73: int i = 0;
74:
75: for (; i < pd2.length; i++)
76: pd[i] = pd2[i];
77:
78: try {
79: pd[i] = createPropertyDescriptor("de9imString",
80: resourceBundle);
81: pd[i].setExpert(false);
82:
83: } catch (IntrospectionException e) {
84: pd = pd2;
85:
86: // TODO error, log here
87: e.printStackTrace();
88: }
89:
90: return pd;
91: }
92: }
|