Source Code Cross Referenced for InternalTables.java in  » Scripting » jython » org » python » core » 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 » jython » org.python.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // Copyright 2000 Samuele Pedroni
002:
003:        package org.python.core;
004:
005:        import java.util.StringTokenizer;
006:
007:        public abstract class InternalTables {
008:
009:            // x__ --> org.python.core.X__InternalTables
010:            // (x|X)__> --> org.python.core.X__InternalTables
011:            // >(x|X)__ --> org.python.core.InternalTablesX__
012:            // other (X__|__.__) --> other
013:            //
014:            /**
015:             * XXX: These contortions are here to decide between InternalTables1 and
016:             * InternalTables2. Since we have deprecated support for JDK 1.1 -- this
017:             * should go away and InternalTables1 and InternalTables2 should be merged
018:             * and replace this class.
019:             */
020:            static private InternalTables tryImpl(String id) {
021:                try {
022:                    if (id.indexOf('.') < 0) {
023:                        boolean glue = true;
024:                        boolean front = true;
025:                        if (id.charAt(0) == '>') {
026:                            id = id.substring(1);
027:                            front = false;
028:                        } else if (id.charAt(id.length() - 1) == '>') {
029:                            id = id.substring(0, id.length() - 1);
030:                        } else if (!Character.isLowerCase(id.charAt(0)))
031:                            glue = false;
032:                        if (glue) {
033:                            StringBuffer buf = new StringBuffer(
034:                                    "org.python.core.");
035:                            if (!front) {
036:                                buf.append("InternalTables");
037:                            }
038:                            if (Character.isLowerCase(id.charAt(0))) {
039:                                buf.append(Character.toUpperCase(id.charAt(0)));
040:                                buf.append(id.substring(1));
041:                            } else {
042:                                buf.append(id);
043:                            }
044:                            if (front) {
045:                                buf.append("InternalTables");
046:                            }
047:                            id = buf.toString();
048:                        }
049:                    }
050:                    // System.err.println("*InternalTables*-create-try: "+id);
051:                    return (InternalTables) Class.forName(id).newInstance();
052:                } catch (Throwable e) {
053:                    // System.err.println(" exc: "+e); // ??dbg
054:                    return null;
055:                }
056:            }
057:
058:            static InternalTables createInternalTables() {
059:                java.util.Properties registry = PySystemState.registry;
060:                if (registry == null) {
061:                    throw new java.lang.IllegalStateException(
062:                            "Jython interpreter state not initialized. "
063:                                    + "You need to call PySystemState.initialize or "
064:                                    + "PythonInterpreter.initialize.");
065:                }
066:                String cands = registry
067:                        .getProperty("python.options.internalTablesImpl");
068:                if (cands == null) {
069:                    String version = System.getProperty("java.version");
070:                    if (version.compareTo("1.2") >= 0) {
071:                        cands = ">2:>1";
072:                    } else {
073:                        cands = ">1";
074:                    }
075:                } else {
076:                    cands = cands + ":>2:>1";
077:                }
078:                StringTokenizer candEnum = new StringTokenizer(cands, ":");
079:                while (candEnum.hasMoreTokens()) {
080:                    InternalTables tbl = tryImpl(candEnum.nextToken().trim());
081:                    if (tbl != null) {
082:                        return tbl;
083:                    }
084:                }
085:                return null; // XXX: never reached -- throw exception instead?
086:            }
087:
088:            protected abstract boolean queryCanonical(String name);
089:
090:            protected abstract PyJavaClass getCanonical(Class c);
091:
092:            protected abstract PyJavaClass getLazyCanonical(String name);
093:
094:            protected abstract void putCanonical(Class c, PyJavaClass canonical);
095:
096:            protected abstract void putLazyCanonical(String name,
097:                    PyJavaClass canonical);
098:
099:            protected abstract Class getAdapterClass(Class c);
100:
101:            protected abstract void putAdapterClass(Class c, Class ac);
102:
103:            protected abstract Object getAdapter(Object o, String evc);
104:
105:            protected abstract void putAdapter(Object o, String evc, Object ad);
106:
107:            public boolean _doesSomeAutoUnload() {
108:                return false;
109:            }
110:
111:            public void _forceCleanup() {
112:            }
113:
114:            public abstract void _beginCanonical();
115:
116:            public abstract void _beginLazyCanonical();
117:
118:            public abstract void _beginOverAdapterClasses();
119:
120:            public abstract void _beginOverAdapters();
121:
122:            public abstract Object _next();
123:
124:            public abstract void _flushCurrent();
125:
126:            public abstract void _flush(PyJavaClass jc);
127:
128:            static public class _LazyRep {
129:                public String name;
130:
131:                public PackageManager mgr;
132:
133:                _LazyRep(String name, PackageManager mgr) {
134:                    this.name = name;
135:                    this.mgr = mgr;
136:                }
137:            }
138:
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.