Source Code Cross Referenced for DefaultDataTypeTranslationMetadataImplementation.java in  » UML » MetaBoss » com » metaboss » enterprise » datatypes » 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 » UML » MetaBoss » com.metaboss.enterprise.datatypes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.enterprise.datatypes;
016:
017:        import java.util.Properties;
018:
019:        import com.metaboss.util.ReflectionUtils;
020:
021:        /** Default implementation of the DataTypeTranslationMetadata interface. It can be 
022:         *  constructed in the static initialiser of the datatype and returned via
023:         *  getMetadata() method */
024:        public class DefaultDataTypeTranslationMetadataImplementation implements 
025:                DataTypeTranslationMetadata {
026:            private DataTypeTranslationMetadata.SqlType mSqlType;
027:            private Properties mSqlTypeProperties;
028:            private DataTypeTranslationMetadata.SqlTranslator mSqlTranslator;
029:            private DataTypeTranslationMetadata.PrimitiveType mPrimitiveType;
030:            private Properties mPrimitiveTypeProperties;
031:            private DataTypeTranslationMetadata.PrimitiveTranslator mPrimitiveTranslator;
032:            private DataTypeTranslationMetadata.XmlType mXmlType;
033:            private Properties mXmlTypeProperties;
034:            private DataTypeTranslationMetadata.XmlTranslator mXmlTranslator;
035:
036:            /** Constructs the metadata object which will report given types
037:             * @param pSqlType Sql type descriptor
038:             * @param pSqlTypeProperties Sql type properties
039:             * @param pSqlTranslator Sql type translator
040:             * @param pPrimitiveType Primitive type descriptor
041:             * @param pPrimitiveTypeProperties Primitive type properties
042:             * @param pPrimitiveTranslator Primitive type translator
043:             * @param pXmlType Xml type descriptor
044:             * @param pXmlTypeProperties Xml type properties
045:             * @param pXmlTranslator Xml type translator
046:             * @exception java.lang.IllegalArgumentException thrown if supplied type descriptor
047:             * does not match with supplied translator. */
048:            public DefaultDataTypeTranslationMetadataImplementation(
049:                    DataTypeTranslationMetadata.SqlType pSqlType,
050:                    Properties pSqlTypeProperties,
051:                    DataTypeTranslationMetadata.SqlTranslator pSqlTranslator,
052:                    DataTypeTranslationMetadata.PrimitiveType pPrimitiveType,
053:                    Properties pPrimitiveTypeProperties,
054:                    DataTypeTranslationMetadata.PrimitiveTranslator pPrimitiveTranslator,
055:                    DataTypeTranslationMetadata.XmlType pXmlType,
056:                    Properties pXmlTypeProperties,
057:                    DataTypeTranslationMetadata.XmlTranslator pXmlTranslator) {
058:                // Validate that translators match types (good idea just to eliminate unexpected condition)
059:                if (!ReflectionUtils.isSubtype(pSqlTranslator.getClass(),
060:                        pSqlType.getTranslatorType()))
061:                    throw new IllegalArgumentException(
062:                            "Datatype translation metadata instantiation error. Actual type of SqlConvertor does not match type of SqlConvertor declared in Sql type metadata.");
063:                if (!ReflectionUtils.isSubtype(pPrimitiveTranslator.getClass(),
064:                        pPrimitiveType.getTranslatorType()))
065:                    throw new IllegalArgumentException(
066:                            "Datatype translation metadata instantiation error. Actual type of PrimitiveConvertor does not match type of PrimitiveConvertor declared in Primitive type metadata.");
067:                if (!ReflectionUtils.isSubtype(pXmlTranslator.getClass(),
068:                        pXmlType.getTranslatorType()))
069:                    throw new IllegalArgumentException(
070:                            "Datatype translation metadata instantiation error. Actual type of XmlConvertor does not match type of XmlConvertor declared in Xml type metadata.");
071:                mSqlType = pSqlType;
072:                mSqlTypeProperties = pSqlTypeProperties != null ? pSqlTypeProperties
073:                        : new Properties();
074:                mSqlTranslator = pSqlTranslator;
075:                mPrimitiveType = pPrimitiveType;
076:                mPrimitiveTypeProperties = pPrimitiveTypeProperties != null ? pPrimitiveTypeProperties
077:                        : new Properties();
078:                mPrimitiveTranslator = pPrimitiveTranslator;
079:                mXmlType = pXmlType;
080:                mXmlTypeProperties = pXmlTypeProperties != null ? pXmlTypeProperties
081:                        : new Properties();
082:                mXmlTranslator = pXmlTranslator;
083:            }
084:
085:            /** Hidden default constructor */
086:            private DefaultDataTypeTranslationMetadataImplementation() {
087:            }
088:
089:            /** Returns the SqlType associated with the datatype. */
090:            public DataTypeTranslationMetadata.SqlType getSqlType() {
091:                return mSqlType;
092:            }
093:
094:            /** Returns the property bag pertained to particular SqlType. */
095:            public Properties getSqlTypeProperties() {
096:                return mSqlTypeProperties;
097:            }
098:
099:            /** Returns the SqlTranslator for the datatype. */
100:            public DataTypeTranslationMetadata.SqlTranslator getSqlTranslator() {
101:                return mSqlTranslator;
102:            }
103:
104:            /** Returns the class describing the primitive supported by the datatype. */
105:            public DataTypeTranslationMetadata.PrimitiveType getPrimitiveType() {
106:                return mPrimitiveType;
107:            }
108:
109:            /** Returns the property bag pertained to particular PrimitiveType. */
110:            public Properties getPrimitiveTypeProperties() {
111:                return mPrimitiveTypeProperties;
112:            }
113:
114:            /** Returns the PrimitiveTranslator for the datatype. */
115:            public DataTypeTranslationMetadata.PrimitiveTranslator getPrimitiveTranslator() {
116:                return mPrimitiveTranslator;
117:            }
118:
119:            /** Returns the class describing the xml type supported by the datatype. */
120:            public DataTypeTranslationMetadata.XmlType getXmlType() {
121:                return mXmlType;
122:            }
123:
124:            /** Returns the property bag pertained to particular XmlType. */
125:            public Properties getXmlTypeProperties() {
126:                return mXmlTypeProperties;
127:            }
128:
129:            /** Returns the PrimitiveTranslator for the datatype. */
130:            public DataTypeTranslationMetadata.XmlTranslator getXmlTranslator() {
131:                return mXmlTranslator;
132:            }
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.