Source Code Cross Referenced for XPersistentPojoDataSourceEx.java in  » XML-UI » xui32 » com » xoetrope » data » pojo » 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 » XML UI » xui32 » com.xoetrope.data.pojo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.data.pojo;
002:
003:        import com.xoetrope.carousel.visualizer.TreeNodeCaption;
004:        import java.lang.reflect.Method;
005:        import net.xoetrope.xml.XmlElement;
006:        import net.xoetrope.xui.XProject;
007:        import net.xoetrope.xui.data.XModel;
008:
009:        public class XPersistentPojoDataSourceEx extends XPojoDataSourceEx {
010:
011:            /**
012:             * Creates a new instance of XPersistentPojoDataSourceEx
013:             * @param project the owner project
014:             */
015:            public XPersistentPojoDataSourceEx(XProject project) {
016:                super (project);
017:            }
018:
019:            /**
020:             * Adapts a POJO for use in the data visualiser.
021:             * @param pojo the POJO to be adapted
022:             * @param parentNode the parent model node
023:             * @return model node wrapping the specified pojo
024:             */
025:            public XPojoModelVis adaptPojo(Object pojo, XModel parentNode) {
026:                if (pojo == null)
027:                    return null;
028:                // Do not adapt existing model nodes
029:                if (pojo instanceof  XPojoModelVis)
030:                    return (XPojoModelVis) pojo;
031:                // Wrap the pojo instance.    
032:                XPojoModelVis model = new XPersistentPojoModelEx(parentNode,
033:                        pojo, this );
034:                String value = getDispValue(pojo);
035:                if (model != null)
036:                    ((TreeNodeCaption) model).setCaption(value + ": ");
037:                return model;
038:            }
039:
040:            /**
041:             * Adapts a POJO for use in the data visualiser
042:             * @param method the method, the invocation of which returns the POJO
043:             * to be adapted
044:             * @param propertyName the property name of the parent node whose
045:             * value is to be adapted
046:             * @param parentNode the parent model node
047:             * @return model node wrapping the specified pojo
048:             */
049:            public XPojoModelVis adaptPojo(Method gtr, Method str,
050:                    String propertyName, XModel parentNode) {
051:                return (new XPersistentPojoModelEx(parentNode, gtr, str,
052:                        propertyName, this ));
053:            }
054:
055:            /**
056:             * Adapts the specified POJO for use in the data visualizer.
057:             * @param pojoClass the type of the POJO to be adapted
058:             * @param propertyName the property name of the parent node whose
059:             * value is to be adapted
060:             * @param parentNode the parent model node
061:             * @return model node wrapping the specified pojo
062:             */
063:            public XPojoModelVis adaptPojo(Class pojoClass,
064:                    String propertyName, XModel parentNode) {
065:                return (new XPersistentPojoModelEx(parentNode, pojoClass,
066:                        propertyName, this ));
067:            }
068:
069:            /**
070:             * Cutsomizes the specified adapter applying the changes from the propertyElement
071:             * @param adapter the adapter to be customized
072:             * @param propertyElement xml node describing customization
073:             */
074:            protected void customizeProperty(XPojoAdapterEx adapter,
075:                    XmlElement propertyElement) {
076:                super .customizeProperty(adapter, propertyElement);
077:                if ("property".equals(propertyElement.getName())) {
078:
079:                    String propertyName = propertyElement.getAttribute("id");
080:                    String getterSig = propertyElement.getAttribute("getter");
081:                    String txRequired = propertyElement.getAttribute("lazy");
082:
083:                    propertyName += XPojoAdapterEx.getSignature(getterSig);
084:                    if ("true".equals(txRequired))
085:                        ((XPersistentPojoAdapterEx) adapter)
086:                                .setTransaction(propertyName);
087:                    else if ("false".equals(txRequired))
088:                        ((XPersistentPojoAdapterEx) adapter)
089:                                .unsetTransaction(propertyName);
090:                }
091:            }
092:
093:            /**
094:             * Creates a new instance of XPersistentPojoAdapterEx
095:             * @param pojoClass the class to be adapted
096:             */
097:            protected XPojoAdapterEx createAdapter(Class pojoClass) {
098:                return (new XPersistentPojoAdapterEx(pojoClass, this));
099:            }
100:
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.