Source Code Cross Referenced for DefaultMapper.java in  » XML » xstream-1.3 » com » thoughtworks » xstream » mapper » 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 » xstream 1.3 » com.thoughtworks.xstream.mapper 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2005, 2006 Joe Walnes.
003:         * Copyright (C) 2006, 2007, 2008 XStream Committers.
004:         * All rights reserved.
005:         *
006:         * The software in this package is published under the terms of the BSD
007:         * style license a copy of which has been included with this distribution in
008:         * the LICENSE.txt file.
009:         * 
010:         * Created on 22. January 2005 by Joe Walnes
011:         */
012:        package com.thoughtworks.xstream.mapper;
013:
014:        import com.thoughtworks.xstream.converters.Converter;
015:        import com.thoughtworks.xstream.converters.SingleValueConverter;
016:
017:        /**
018:         * Default mapper implementation with 'vanilla' functionality. To build up the functionality required, wrap this mapper
019:         * with other mapper implementations.
020:         *
021:         * @author Joe Walnes
022:         * @author Jörg Schaible
023:         */
024:        public class DefaultMapper implements  Mapper {
025:
026:            private final ClassLoader classLoader;
027:            /**
028:             * @deprecated since 1.2, no necessity for field anymore.
029:             */
030:            private transient String classAttributeIdentifier;
031:
032:            public DefaultMapper(ClassLoader classLoader) {
033:                this .classLoader = classLoader;
034:                this .classAttributeIdentifier = "class";
035:            }
036:
037:            /**
038:             * @deprecated since 1.2, use XStream.aliasAttrbute() for a different attribute name.
039:             */
040:            public DefaultMapper(ClassLoader classLoader,
041:                    String classAttributeIdentifier) {
042:                this (classLoader);
043:                this .classAttributeIdentifier = classAttributeIdentifier == null ? "class"
044:                        : classAttributeIdentifier;
045:            }
046:
047:            /**
048:             * @deprecated since 1.2, no necessity for method anymore.
049:             */
050:            private Object readResolve() {
051:                classAttributeIdentifier = "class";
052:                return this ;
053:            }
054:
055:            public String serializedClass(Class type) {
056:                return type.getName();
057:            }
058:
059:            public Class realClass(String elementName) {
060:                try {
061:                    return classLoader.loadClass(elementName);
062:                } catch (ClassNotFoundException e) {
063:                    throw new CannotResolveClassException(elementName + " : "
064:                            + e.getMessage());
065:                }
066:            }
067:
068:            public Class defaultImplementationOf(Class type) {
069:                return type;
070:            }
071:
072:            /**
073:             * @deprecated since 1.2, use aliasForAttribute instead.
074:             */
075:            public String attributeForClassDefiningField() {
076:                return "defined-in";
077:            }
078:
079:            /**
080:             * @deprecated since 1.2, use aliasForAttribute instead.
081:             */
082:            public String attributeForReadResolveField() {
083:                return "resolves-to";
084:            }
085:
086:            /**
087:             * @deprecated since 1.2, use aliasForAttribute instead.
088:             */
089:            public String attributeForEnumType() {
090:                return "enum-type";
091:            }
092:
093:            /**
094:             * @deprecated since 1.2, use aliasForAttribute instead.
095:             */
096:            public String attributeForImplementationClass() {
097:                return classAttributeIdentifier;
098:            }
099:
100:            public String aliasForAttribute(String attribute) {
101:                return attribute;
102:            }
103:
104:            public String attributeForAlias(String alias) {
105:                return alias;
106:            }
107:
108:            public boolean isImmutableValueType(Class type) {
109:                return false;
110:            }
111:
112:            public String getFieldNameForItemTypeAndName(Class definedIn,
113:                    Class itemType, String itemFieldName) {
114:                return null;
115:            }
116:
117:            public Class getItemTypeForItemFieldName(Class definedIn,
118:                    String itemFieldName) {
119:                return null;
120:            }
121:
122:            public ImplicitCollectionMapping getImplicitCollectionDefForFieldName(
123:                    Class itemType, String fieldName) {
124:                return null;
125:            }
126:
127:            public boolean shouldSerializeMember(Class definedIn,
128:                    String fieldName) {
129:                return true;
130:            }
131:
132:            public String lookupName(Class type) {
133:                return serializedClass(type);
134:            }
135:
136:            public Class lookupType(String elementName) {
137:                return realClass(elementName);
138:            }
139:
140:            public String serializedMember(Class type, String memberName) {
141:                return memberName;
142:            }
143:
144:            public String realMember(Class type, String serialized) {
145:                return serialized;
146:            }
147:
148:            /**
149:             * @deprecated since 1.3, use {@link #getConverterFromAttribute(Class, String)}
150:             */
151:            public SingleValueConverter getConverterFromAttribute(String name) {
152:                return null;
153:            }
154:
155:            /**
156:             * @deprecated since 1.3, use {@link #getConverterFromItemType(String, Class, Class)}
157:             */
158:            public SingleValueConverter getConverterFromItemType(
159:                    String fieldName, Class type) {
160:                return null;
161:            }
162:
163:            /**
164:             * @deprecated since 1.3, use {@link #getConverterFromItemType(String, Class, Class)}
165:             */
166:            public SingleValueConverter getConverterFromItemType(Class type) {
167:                return null;
168:            }
169:
170:            public SingleValueConverter getConverterFromItemType(
171:                    String fieldName, Class type, Class definedIn) {
172:                return null;
173:            }
174:
175:            public Converter getLocalConverter(Class definedIn, String fieldName) {
176:                return null;
177:            }
178:
179:            public Mapper lookupMapperOfType(Class type) {
180:                return null;
181:            }
182:
183:            /**
184:             * @deprecated since 1.3, use combination of {@link #serializedMember(Class, String)} and {@link #getConverterFromItemType(String, Class, Class)} 
185:             */
186:            public String aliasForAttribute(Class definedIn, String fieldName) {
187:                return fieldName;
188:            }
189:
190:            /**
191:             * @deprecated since 1.3, use combination of {@link #realMember(Class, String)} and {@link #getConverterFromItemType(String, Class, Class)} 
192:             */
193:            public String attributeForAlias(Class definedIn, String alias) {
194:                return alias;
195:            }
196:
197:            public SingleValueConverter getConverterFromAttribute(Class type,
198:                    String attribute) {
199:                return null;
200:            }
201:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.