Source Code Cross Referenced for BindingConfiguration.java in  » Library » Apache-commons-betwixt-0.8-src » org » apache » commons » betwixt » 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 » Library » Apache commons betwixt 0.8 src » org.apache.commons.betwixt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.commons.betwixt;
018:
019:        import java.io.Serializable;
020:
021:        import org.apache.commons.betwixt.strategy.DefaultObjectStringConverter;
022:        import org.apache.commons.betwixt.strategy.IdStoringStrategy;
023:        import org.apache.commons.betwixt.strategy.ObjectStringConverter;
024:        import org.apache.commons.betwixt.strategy.ValueSuppressionStrategy;
025:
026:        /** <p>Stores mapping phase binding configuration.</p>
027:         *
028:         * <p>There are two phase in Betwixt's processing.
029:         * The first phase is the introspection of the bean.
030:         * Strutural configuration settings effect this phase.
031:         * The second phase comes when Betwixt dynamically uses
032:         * reflection to execute the mapping.
033:         * This object stores configuration settings pertaining 
034:         * to the second phase.</p>
035:         *
036:         * <p>These common settings have been collected into one class
037:         * to make round tripping easier since the same <code>BindingConfiguration</code>
038:         * can be shared.</p> 
039:         *
040:         * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
041:         * @since 0.5
042:         */
043:        public class BindingConfiguration implements  Serializable {
044:
045:            /** Should <code>ID</code>'s and <code>IDREF</code> be used cross-reference matching objects? */
046:            private boolean mapIDs = true;
047:            /** Converts objects &lt-&gt; strings */
048:            private ObjectStringConverter objectStringConverter;
049:            /** The name of the classname attribute used when creating derived beans */
050:            private String classNameAttribute = "className";
051:            /** Strategy for suppressing attributes with certain values when writing */
052:            private ValueSuppressionStrategy valueSuppressionStrategy = ValueSuppressionStrategy.DEFAULT;
053:            /** Strategy for storing and accessing ID values */
054:            private IdStoringStrategy idStoringStrategy = IdStoringStrategy
055:                    .createDefault();
056:
057:            /**
058:             * Constructs a BindingConfiguration with default properties.
059:             */
060:            public BindingConfiguration() {
061:                this (new DefaultObjectStringConverter(), true);
062:            }
063:
064:            /** 
065:             * Constructs a BindingConfiguration
066:             * @param objectStringConverter the <code>ObjectStringConverter</code>
067:             * to be used to convert Objects &lt;-&gt; Strings
068:             * @param mapIDs should <code>ID</code>'s and <code>IDREF</code> be used to cross-reference
069:             */
070:            public BindingConfiguration(
071:                    ObjectStringConverter objectStringConverter, boolean mapIDs) {
072:                setObjectStringConverter(objectStringConverter);
073:                setMapIDs(mapIDs);
074:            }
075:
076:            /**
077:             * Gets the Object &lt;-&gt; String converter.
078:             * @return the ObjectStringConverter to use, not null
079:             */
080:            public ObjectStringConverter getObjectStringConverter() {
081:                return objectStringConverter;
082:            }
083:
084:            /**
085:             * Sets the Object &lt;-&gt; String converter.
086:             * @param objectStringConverter the ObjectStringConverter to be used, not null
087:             */
088:            public void setObjectStringConverter(
089:                    ObjectStringConverter objectStringConverter) {
090:                this .objectStringConverter = objectStringConverter;
091:            }
092:
093:            /** 
094:             * Should <code>ID</code>'s and <code>IDREF</code> attributes 
095:             * be used to cross-reference matching objects? 
096:             *
097:             * @return true if <code>ID</code> and <code>IDREF</code> 
098:             * attributes should be used to cross-reference instances
099:             */
100:            public boolean getMapIDs() {
101:                return mapIDs;
102:            }
103:
104:            /**
105:             *Should <code>ID</code>'s and <code>IDREF</code> attributes 
106:             * be used to cross-reference matching objects? 
107:             *
108:             * @param mapIDs pass true if <code>ID</code>'s should be used to cross-reference
109:             */
110:            public void setMapIDs(boolean mapIDs) {
111:                this .mapIDs = mapIDs;
112:            }
113:
114:            /**
115:             * The name of the attribute which can be specified in the XML to override the
116:             * type of a bean used at a certain point in the schema.
117:             *
118:             * <p>The default value is 'className'.</p>
119:             * 
120:             * @return The name of the attribute used to overload the class name of a bean
121:             */
122:            public String getClassNameAttribute() {
123:                return classNameAttribute;
124:            }
125:
126:            /**
127:             * Sets the name of the attribute which can be specified in 
128:             * the XML to override the type of a bean used at a certain 
129:             * point in the schema.
130:             *
131:             * <p>The default value is 'className'.</p>
132:             * 
133:             * @param classNameAttribute The name of the attribute used to overload the class name of a bean
134:             */
135:            public void setClassNameAttribute(String classNameAttribute) {
136:                this .classNameAttribute = classNameAttribute;
137:            }
138:
139:            /**
140:             * Gets the <code>ValueSuppressionStrategy</code>.
141:             * This is used to control the expression of attributes with certain values.
142:             * @since 0.7
143:             * @return <code>ValueSuppressionStrategy</code>, not null
144:             */
145:            public ValueSuppressionStrategy getValueSuppressionStrategy() {
146:                return valueSuppressionStrategy;
147:            }
148:
149:            /**
150:             * Sets the <code>ValueSuppressionStrategy</code>.
151:             * This is used to control the expression of attributes with certain values.
152:             * @since 0.7
153:             * @param valueSuppressionStrategy <code>ValueSuppressionStrategy</code>, not null
154:             */
155:            public void setValueSuppressionStrategy(
156:                    ValueSuppressionStrategy valueSuppressionStrategy) {
157:                this .valueSuppressionStrategy = valueSuppressionStrategy;
158:            }
159:
160:            /**
161:             * Gets the strategy used to manage storage and retrieval of id's.
162:             * 
163:             * @since 0.7
164:             * @return Returns the <code>IdStoringStrategy</code>, not null
165:             */
166:            public IdStoringStrategy getIdMappingStrategy() {
167:                return idStoringStrategy;
168:            }
169:
170:            /**
171:             * Sets the strategy used to manage storage and retrieval of id's.
172:             * 
173:             * @since 0.7
174:             * @param idMappingStrategy
175:             *            <code>IdStoringStrategy</code> to be set, not null
176:             */
177:            public void setIdMappingStrategy(IdStoringStrategy idMappingStrategy) {
178:                this.idStoringStrategy = idMappingStrategy;
179:            }
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.