Source Code Cross Referenced for ClassRep.java in  » Scripting » jacl » tcl » lang » 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 » Scripting » jacl » tcl.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ClassRep.java --
003:         *
004:         *	This class implements the internal representation of a Java
005:         *	class name.
006:         *
007:         * Copyright (c) 1997 Sun Microsystems, Inc.
008:         *
009:         * See the file "license.terms" for information on usage and
010:         * redistribution of this file, and for a DISCLAIMER OF ALL
011:         * WARRANTIES.
012:         *
013:         * RCS: @(#) $Id: ClassRep.java,v 1.3 2000/10/29 06:00:42 mdejong Exp $
014:         *
015:         */
016:
017:        package tcl.lang;
018:
019:        import java.lang.reflect.*;
020:
021:        /**
022:         * This class implements the internal representation of a Java class
023:         * name.
024:         */
025:
026:        class ClassRep implements  InternalRep {
027:
028:            // The class referred to by this ClassRep.
029:
030:            Class cls;
031:
032:            /*
033:             *----------------------------------------------------------------------
034:             *
035:             * ClassRep --
036:             *
037:             *	Creates a new ClassRep instance.
038:             *
039:             * Side effects:
040:             *	Member fields are initialized.
041:             *
042:             *----------------------------------------------------------------------
043:             */
044:
045:            ClassRep(Class c) // Initial value for cls.
046:            {
047:                cls = c;
048:            }
049:
050:            /*
051:             *----------------------------------------------------------------------
052:             *
053:             * duplicate --
054:             *
055:             *	Make a copy of an object's internal representation.
056:             *
057:             * Results:
058:             *	Returns a newly allocated instance of the appropriate type.
059:             *
060:             * Side effects:
061:             *	None.
062:             *
063:             *----------------------------------------------------------------------
064:             */
065:
066:            public InternalRep duplicate() {
067:                return new ClassRep(cls);
068:            }
069:
070:            /**
071:             * Implement this no-op for the InternalRep interface.
072:             */
073:
074:            public void dispose() {
075:            }
076:
077:            /*
078:             *----------------------------------------------------------------------
079:             *
080:             * get --
081:             *
082:             *	Returns the Class object referred to by the TclObject.
083:             *
084:             * Results:
085:             *	The Class object referred to by the TclObject.
086:             *
087:             * Side effects:
088:             *	When successful, the internalRep of the signature object is
089:             *	converted to ClassRep.
090:             *
091:             *----------------------------------------------------------------------
092:             */
093:
094:            static Class get(Interp interp, // Current interpreter.
095:                    TclObject tclObj) // TclObject that contains a valid Java
096:                    // class name.
097:                    throws TclException // If the TclObject doesn't contain a valid
098:            // class name.
099:            {
100:                InternalRep rep = tclObj.getInternalRep();
101:
102:                if (rep instanceof  ClassRep) {
103:                    // If a ClassRep is already cached, return it right away.
104:                    return ((ClassRep) rep).cls;
105:                } else {
106:                    Class c = JavaInvoke.getClassByName(interp, tclObj
107:                            .toString());
108:                    tclObj.setInternalRep(new ClassRep(c));
109:                    return c;
110:                }
111:            }
112:
113:        } // end ClassRep
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.