Source Code Cross Referenced for ConverterManager.java in  » Ajax » dwr » org » directwebremoting » extend » 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 » Ajax » dwr » org.directwebremoting.extend 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Joe Walker
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.directwebremoting.extend;
017:
018:        import java.util.Collection;
019:        import java.util.Map;
020:
021:        /**
022:         * A class to manage the converter types and the instantiated class name matches.
023:         * @author Joe Walker [joe at getahead dot ltd dot uk]
024:         */
025:        public interface ConverterManager {
026:            /**
027:             * Add a new converter type
028:             * @param id The name of the converter type
029:             * @param className The class to do the conversion
030:             */
031:            void addConverterType(String id, String className);
032:
033:            /**
034:             * Add a new converter
035:             * @param match The class name(s) to match
036:             * @param type The name of the converter type
037:             * @param params The extra parameters to allow the creator to configure itself
038:             * @throws InstantiationException If reflection based creation fails
039:             * @throws IllegalAccessException If reflection based creation fails
040:             * @throws IllegalArgumentException If we have a duplicate name
041:             */
042:            void addConverter(String match, String type,
043:                    Map<String, String> params)
044:                    throws IllegalArgumentException, InstantiationException,
045:                    IllegalAccessException;
046:
047:            /**
048:             * Add a new converter
049:             * @param match The class name(s) to match
050:             * @param converter The converter to add
051:             * @throws IllegalArgumentException If we have a duplicate name
052:             */
053:            void addConverter(String match, Converter converter)
054:                    throws IllegalArgumentException;
055:
056:            /**
057:             * In order to be able to create stub remote objects we need to know what
058:             * they are so you can get a collection of all match strings.
059:             * @return A Collection of all the converter match strings
060:             * @see #getConverterByMatchString(String)
061:             */
062:            Collection<String> getConverterMatchStrings();
063:
064:            /**
065:             * In order to be able to create stub remote objects we need to know what
066:             * they are so you can lookup match strings and retrieve the converter.
067:             * @param match The match string to lookup
068:             * @return The matching converter
069:             * @see #getConverterMatchStrings()
070:             */
071:            Converter getConverterByMatchString(String match);
072:
073:            /**
074:             * Check if we can coerce the given type
075:             * @param paramType The type to check
076:             * @return true iff <code>paramType</code> is coercable
077:             */
078:            boolean isConvertable(Class<?> paramType);
079:
080:            /**
081:             * Convert an object from being a string into an object of some type.
082:             * Designed for use with converters that have a working map passed to them
083:             * @param paramType The type that you want the object to be
084:             * @param data The string version of the object
085:             * @param inctx The map of data that we are working on
086:             * @param incc The context of this type conversion
087:             * @return The coerced object or null if the object could not be coerced
088:             * @throws MarshallException If the conversion failed for some reason
089:             */
090:            Object convertInbound(Class<?> paramType, InboundVariable data,
091:                    InboundContext inctx, TypeHintContext incc)
092:                    throws MarshallException;
093:
094:            /**
095:             * Convert an object into a Javavscript representation of the same.
096:             * This method is for use by converters wishing to recurse into some object.
097:             * @param data The object to convert
098:             * @param converted The list of converted objects so far
099:             * @return A Javascript string version of the object
100:             * @throws MarshallException If the conversion failed for some reason
101:             */
102:            OutboundVariable convertOutbound(Object data,
103:                    OutboundContext converted) throws MarshallException;
104:
105:            /**
106:             * We don't know enough from a method signature like setUsers(Set s) to be
107:             * able to cast the inbound data to a set of Users. This method enables us
108:             * to specify this extra information.
109:             * @param thc The context to find any extra type information from
110:             * @param type The type of the specified parameter.
111:             */
112:            void setExtraTypeInfo(TypeHintContext thc, Class<?> type);
113:
114:            /**
115:             * The extra type information that we have learnt about a method parameter.
116:             * This method will return null if there is nothing extra to know
117:             * @param thc The context to find any extra type information from
118:             * @return A type to use to fill out the generic type
119:             */
120:            Class<?> getExtraTypeInfo(TypeHintContext thc);
121:
122:            /**
123:             * Sets the converters for this converter manager.
124:             * @param converters the map of match pattern and their converter instances
125:             */
126:            void setConverters(Map<String, Converter> converters);
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.