Source Code Cross Referenced for AttributeMapping.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » complex » config » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.data.complex.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    Geotools2 - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         *
016:         */
017:        package org.geotools.data.complex.config;
018:
019:        import java.io.Serializable;
020:        import java.util.Collections;
021:        import java.util.HashMap;
022:        import java.util.Map;
023:
024:        /**
025:         * Configuration object for the mapping of a community schema attribute.
026:         * 
027:         * @author Gabriel Roldan, Axios Engineering
028:         * @version $Id: AttributeMapping.java 25814 2007-06-12 12:03:41Z groldan $
029:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/community-schemas/community-schema-ds/src/main/java/org/geotools/data/complex/config/AttributeMapping.java $
030:         * @since 2.4
031:         */
032:        public class AttributeMapping implements  Serializable {
033:            private static final long serialVersionUID = 3624951889528331592L;
034:
035:            /**
036:             * XPath expression addressing the target attribute in a target FeatureType.
037:             */
038:            private String targetAttributePath;
039:
040:            /**
041:             * Expression whose evaluation result against a Feature of the source
042:             * FeatureType is going to be the value of the target attribute in output
043:             * FeatureType.
044:             * 
045:             * <p>
046:             * At this stage, the expression must be a valid OpenGIS Common Query
047:             * Language expression.
048:             * </p>
049:             */
050:            private String sourceExpression;
051:
052:            /**
053:             * Expression whose evaluation result against a Feature of the source
054:             * FeatureType is going to be the value of the id attribute property
055:             * 
056:             * <p>
057:             * At this stage, the expression must be a valid OpenGIS Common Query
058:             * Language expression.
059:             * </p>
060:             */
061:            private String identifierExpression;
062:
063:            /**
064:             * Name of the target element instance this attribute mapping applies to, or
065:             * <code>null</code> if its fully addressable by the FeatureType.
066:             * 
067:             * <p>
068:             * for example, the target FeatureType may define a property as
069:             * GeometryAttributeType, but the actual instance should be
070:             * PointPropertyType.
071:             * </p>
072:             */
073:            private String targetAttributeSchemaElement;
074:
075:            /**
076:             * If <code>true</code>, indicates that one instance of this attribute
077:             * mapping must be created for every repeating group of attributes. In other
078:             * words, indicates wether this attribute corresponds to a multivalued or a
079:             * single valued attribute.
080:             */
081:            private boolean isMultiple;
082:
083:            /**
084:             * Client properties definitions for instances of the target attribute. The
085:             * map is keys are strings representing the name of the client properties,
086:             * and the map values are strings representing OCG's CQL expressions whose
087:             * evaluated value against the instances of the source features are going to
088:             * be the client properties values.
089:             * <p>
090:             * for example: srsName/strConcat("#bh.", BGS_ID)
091:             * </p>
092:             */
093:            private Map clientProperties;
094:
095:            /**
096:             * Returns the expression whose evaluation result against a Feature of the
097:             * source FeatureType is going to be the value of the target attribute in
098:             * output FeatureType.
099:             * 
100:             * <p>
101:             * At this stage, the expression must be a valid OpenGIS Common Query
102:             * Language expression.
103:             * </p>
104:             * 
105:             * @return OGC CQL expression for the attribute value
106:             */
107:            public String getSourceExpression() {
108:                return sourceExpression;
109:            }
110:
111:            /**
112:             * Sets the OGC CQL expression for the attribute value.
113:             * 
114:             * @param sourceExpression
115:             *            OGC CQL expression for the attribute value.
116:             */
117:            public void setSourceExpression(String sourceExpression) {
118:                this .sourceExpression = sourceExpression;
119:            }
120:
121:            /**
122:             * Returns the XPath expression addressing the target attribute in a target
123:             * FeatureType.
124:             * 
125:             * @return the XPath location path for the target attribute of the mapping.
126:             */
127:            public String getTargetAttributePath() {
128:                return targetAttributePath;
129:            }
130:
131:            /**
132:             * Sets the XPath expression addressing the target attribute in a target
133:             * FeatureType.
134:             * 
135:             * @param targetAttributePath
136:             *            the XPath location path for the target attribute of the
137:             *            mapping.
138:             */
139:            public void setTargetAttributePath(String targetAttributePath) {
140:                this .targetAttributePath = targetAttributePath;
141:            }
142:
143:            /**
144:             * Returns the name of the target element instance this attribute mapping
145:             * applies to, or <code>null</code> if its fully addressable by the
146:             * FeatureType.
147:             * 
148:             * <p>
149:             * For example, the target FeatureType may define a property as
150:             * GeometryAttributeType, but the actual instance should be
151:             * PointPropertyType. In which case, it should be set to
152:             * "gml:PointPropertyType" so ComplexDataStore knows it should create a
153:             * point property an thus its subelements are to be addressable by
154:             * subsequent mappings.
155:             * </p>
156:             * 
157:             * @return name of the target element instance in the output schema or
158:             *         <code>null</code> if not set.
159:             */
160:            public String getTargetAttributeSchemaElement() {
161:                return targetAttributeSchemaElement;
162:            }
163:
164:            /**
165:             * Sets the name of the target element instance in the output schema.
166:             * 
167:             * @param targetAttributeSchemaElement
168:             *            name of the target element instance in the output schema.
169:             *            Could be prefixed, in which case the prefix mapping has to be
170:             *            available in the corresponding {@link
171:             *            ComplexDataStoreDTO#getNamespaces()}
172:             */
173:            public void setTargetAttributeSchemaElement(
174:                    String targetAttributeSchemaElement) {
175:                this .targetAttributeSchemaElement = targetAttributeSchemaElement;
176:            }
177:
178:            /**
179:             * Returns wether this attribute should be treated as a single or multi
180:             * valued property.
181:             * 
182:             * @return <code>true</code> if this attribute corresponds to a
183:             *         multivalued property, <code>false</code> otherwise.
184:             */
185:            public boolean isMultiple() {
186:                return isMultiple;
187:            }
188:
189:            /**
190:             * Sets wether this attribute should be treated as a single or multi valued
191:             * property.
192:             * 
193:             * @param isMultiple
194:             *            <code>true</code> if this attribute corresponds to a
195:             *            multivalued property, <code>false</code> otherwise.
196:             */
197:            public void setMultiple(boolean isMultiple) {
198:                this .isMultiple = isMultiple;
199:            }
200:
201:            /**
202:             * Helper method to allow config digester passing a string.
203:             * 
204:             * @see #setMultiple(boolean)
205:             * @param isMultiple
206:             */
207:            public void setMultiple(String isMultiple) {
208:                boolean multiple = Boolean.valueOf(isMultiple).booleanValue();
209:                setMultiple(multiple);
210:            }
211:
212:            /**
213:             * Returns a string representation of this config object.
214:             * 
215:             * @return String representation of this config object.
216:             */
217:            public String toString() {
218:                return "AttributeMappingDTO[id > "
219:                        + identifierExpression
220:                        + ", "
221:                        + sourceExpression
222:                        + " -> "
223:                        + targetAttributePath
224:                        + ", isMultiple: "
225:                        + isMultiple
226:                        + ((targetAttributeSchemaElement == null) ? ""
227:                                : (", target node: " + targetAttributeSchemaElement))
228:                        + "]";
229:            }
230:
231:            public Map getClientProperties() {
232:                return clientProperties == null ? Collections.EMPTY_MAP
233:                        : clientProperties;
234:            }
235:
236:            public void setClientProperties(Map clientProperties) {
237:                this .clientProperties = clientProperties == null ? null
238:                        : new HashMap(clientProperties);
239:            }
240:
241:            public void putClientProperty(String name, String expression) {
242:                if (name == null || expression == null) {
243:                    throw new NullPointerException("name=" + name
244:                            + ", expression=" + expression);
245:                }
246:                if (clientProperties == null) {
247:                    clientProperties = new HashMap();
248:                }
249:                clientProperties.put(name, expression);
250:            }
251:
252:            public String getIdentifierExpression() {
253:                return identifierExpression;
254:            }
255:
256:            public void setIdentifierExpression(String identifierExpression) {
257:                this.identifierExpression = identifierExpression;
258:            }
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.