Source Code Cross Referenced for AttributeMapping.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » complex » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - 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:        package org.geotools.data.complex;
017:
018:        import java.util.Collections;
019:        import java.util.Map;
020:
021:        import org.geotools.data.complex.filter.XPath.StepList;
022:        import org.geotools.resources.Utilities;
023:        import org.opengis.feature.type.AttributeType;
024:        import org.opengis.filter.expression.Expression;
025:
026:        /**
027:         * DOCUMENT ME!
028:         * 
029:         * @author Gabriel Roldan, Axios Engineering
030:         * @version $Id: AttributeMapping.java 25814 2007-06-12 12:03:41Z groldan $
031:         * @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/AttributeMapping.java $
032:         * @since 2.4
033:         */
034:        public class AttributeMapping {
035:
036:            /** Expression to set the Attribute's ID from, or {@linkplain Expression#NIL} */
037:            private Expression identifierExpression;
038:
039:            /** DOCUMENT ME! */
040:            private Expression sourceExpression;
041:
042:            /** DOCUMENT ME! */
043:            //private String targetXPath;
044:            private StepList targetXPath;
045:
046:            private boolean isMultiValued;
047:
048:            /**
049:             * If present, represents our way to deal polymorphic attribute instances,
050:             * so this node should be of a subtype of the one referenced by
051:             * {@link  #targetXPath}
052:             */
053:            AttributeType targetNodeInstance;
054:
055:            private Map /* <Name,Expression> */clientProperties;
056:
057:            /**
058:             * Creates a new AttributeMapping object.
059:             * 
060:             * @param sourceExpression
061:             *            DOCUMENT ME!
062:             * @param targetXPath
063:             *            DOCUMENT ME!
064:             */
065:            public AttributeMapping(Expression idExpression,
066:                    Expression sourceExpression, StepList targetXPath) {
067:                this (idExpression, sourceExpression, targetXPath, null, false,
068:                        null);
069:            }
070:
071:            public AttributeMapping(Expression idExpression,
072:                    Expression sourceExpression, StepList targetXPath,
073:                    AttributeType targetNodeInstance, boolean isMultiValued,
074:                    Map clientProperties) {
075:
076:                this .identifierExpression = idExpression == null ? Expression.NIL
077:                        : idExpression;
078:                this .sourceExpression = sourceExpression == null ? Expression.NIL
079:                        : sourceExpression;
080:                this .isMultiValued = isMultiValued;
081:                if (this .sourceExpression == null) {
082:                    this .sourceExpression = Expression.NIL;
083:                }
084:                this .targetXPath = targetXPath;
085:                this .targetNodeInstance = targetNodeInstance;
086:                this .clientProperties = clientProperties == null ? Collections.EMPTY_MAP
087:                        : clientProperties;
088:            }
089:
090:            public boolean isMultiValued() {
091:                return isMultiValued;
092:            }
093:
094:            /**
095:             * DOCUMENT ME!
096:             * 
097:             * @return DOCUMENT ME!
098:             */
099:            public Expression getSourceExpression() {
100:                return sourceExpression;
101:            }
102:
103:            /**
104:             * DOCUMENT ME!
105:             * 
106:             * @return DOCUMENT ME!
107:             */
108:            public StepList getTargetXPath() {
109:                return targetXPath;
110:            }
111:
112:            public AttributeType getTargetNodeInstance() {
113:                return targetNodeInstance;
114:            }
115:
116:            /**
117:             * DOCUMENT ME!
118:             * 
119:             * @param o
120:             *            DOCUMENT ME!
121:             * 
122:             * @return DOCUMENT ME!
123:             */
124:            public boolean equals(Object o) {
125:                if (this  == o) {
126:                    return true;
127:                }
128:
129:                if (!(o instanceof  AttributeMapping)) {
130:                    return false;
131:                }
132:
133:                AttributeMapping other = (AttributeMapping) o;
134:
135:                return Utilities.equals(identifierExpression,
136:                        other.identifierExpression)
137:                        && Utilities.equals(sourceExpression,
138:                                other.sourceExpression)
139:                        && Utilities.equals(targetXPath, other.targetXPath)
140:                        && Utilities.equals(targetNodeInstance,
141:                                other.targetNodeInstance);
142:            }
143:
144:            /**
145:             * DOCUMENT ME!
146:             * 
147:             * @return DOCUMENT ME!
148:             */
149:            public int hashCode() {
150:                return (37 * identifierExpression.hashCode() + 37 * sourceExpression
151:                        .hashCode())
152:                        ^ targetXPath.hashCode();
153:            }
154:
155:            /**
156:             * DOCUMENT ME!
157:             * 
158:             * @return DOCUMENT ME!
159:             */
160:            public String toString() {
161:                StringBuffer sb = new StringBuffer("AttributeMapping[");
162:                sb.append("sourceExpression='").append(sourceExpression)
163:                        .append("', targetXPath='").append(targetXPath);
164:                if (targetNodeInstance != null) {
165:                    sb.append(", target instance type=").append(
166:                            targetNodeInstance);
167:                }
168:                sb.append("']");
169:
170:                return sb.toString();
171:            }
172:
173:            public Map getClientProperties() {
174:                return clientProperties == null ? Collections.EMPTY_MAP
175:                        : clientProperties;
176:            }
177:
178:            public Expression getIdentifierExpression() {
179:                return identifierExpression;
180:            }
181:
182:            public void setIdentifierExpression(Expression identifierExpression) {
183:                this.identifierExpression = identifierExpression;
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.