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


001:        package org.geotools.xml.impl.jxpath;
002:
003:        import org.apache.commons.jxpath.ri.QName;
004:        import org.apache.commons.jxpath.ri.model.NodePointer;
005:        import org.geotools.feature.Feature;
006:
007:        /**
008:         * Pointer to a single property of a feature.
009:         * <p>
010:         * THe property of the feature is specified via index. Setting the index to 
011:         * -1 will cause the pointer to point at the feature id.
012:         * </p>
013:         * @author Justin Deoliveira, The Open Planning Project
014:         *
015:         */
016:        public class FeaturePropertyPointer extends NodePointer {
017:
018:            /**
019:             * the feature
020:             */
021:            Feature feature;
022:            /**
023:             * The parent pointer
024:             */
025:            FeaturePointer parent;
026:            /**
027:             * the indedx of hte property being pointed at
028:             */
029:            int index;
030:
031:            /**
032:             * Creates the pointer.
033:             * 
034:             * @param parent The parent pointer, pointer at the feature.
035:             * @param index The index of hte property to point to, or -1 to point 
036:             * 	to the feature id.
037:             */
038:            public FeaturePropertyPointer(FeaturePointer parent, int index) {
039:                super (parent);
040:                this .index = index;
041:                this .feature = (Feature) parent.getImmediateNode();
042:            }
043:
044:            /**
045:             * Return <code>true</code>.
046:             */
047:            public boolean isLeaf() {
048:                return true;
049:            }
050:
051:            /**
052:             * Return <code>false</code>. 
053:             */
054:            public boolean isCollection() {
055:                return false;
056:            }
057:
058:            /**
059:             * Return <code>1</code>
060:             */
061:            public int getLength() {
062:                return 1;
063:            }
064:
065:            /**
066:             * Returns the qname with prefix as <code>null</code>, and local part the name of the 
067:             * feature attribute.
068:             */
069:            public QName getName() {
070:                return index != -1 ? new QName(null, feature.getFeatureType()
071:                        .getAttributeType(index).getName()) : new QName(null,
072:                        "fid");
073:            }
074:
075:            public Object getBaseValue() {
076:                return feature;
077:            }
078:
079:            public Object getImmediateNode() {
080:                return index != -1 ? feature.getAttribute(index) : feature
081:                        .getID();
082:            }
083:
084:            public void setValue(Object value) {
085:                if (index == -1)
086:                    return; //fids arent settable
087:
088:                try {
089:                    feature.setAttribute(index, value);
090:                } catch (Exception e) {
091:                    throw new RuntimeException(e);
092:                }
093:            }
094:
095:            /**
096:             * Always return <code>0</code>, can never have child pointers.
097:             */
098:            public int compareChildNodePointers(NodePointer pointer1,
099:                    NodePointer pointer2) {
100:                return 0;
101:            }
102:
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.