Source Code Cross Referenced for AnyStackTraceElement.java in  » Web-Framework » anvil » anvil » core » runtime » 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 » Web Framework » anvil » anvil.core.runtime 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: AnyStackTraceElement.java,v 1.2 2002/09/16 08:05:03 jkl Exp $
003:         *
004:         * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
005:         *
006:         * Use is subject to license terms, as defined in
007:         * Anvil Sofware License, Version 1.1. See LICENSE 
008:         * file, or http://njet.org/license-1.1.txt
009:         */
010:        package anvil.core.runtime;
011:
012:        import anvil.core.Any;
013:        import anvil.core.AnyAbstractClass;
014:        import anvil.script.Context;
015:        import anvil.script.Module;
016:        import anvil.script.Function;
017:        import anvil.script.StackFrame;
018:
019:        /// @class StackTraceElelement
020:        /// Represents a single stack frame.
021:
022:        /**
023:         * class AnyStackTraceElelement
024:         *
025:         * @author: Jani Lehtimäki
026:         */
027:        public class AnyStackTraceElement extends AnyAbstractClass {
028:
029:            public static final anvil.core.RuntimePermission CAN_USE = new anvil.core.RuntimePermission(
030:                    "anvil.runtime.StackTraceElement", false);
031:
032:            private Module _module;
033:            private Any _instance;
034:            private Function _function;
035:            private int _line;
036:
037:            public AnyStackTraceElement(Module module, Any instance,
038:                    Function function, int line) {
039:                _module = module;
040:                _instance = instance;
041:                _function = function;
042:                _line = line;
043:            }
044:
045:            public AnyStackTraceElement(StackFrame frame) {
046:                _module = frame.getModule();
047:                _instance = frame.getSelf();
048:                _function = frame.getFunction();
049:                _line = frame.getLine();
050:            }
051:
052:            public final anvil.script.ClassType classOf() {
053:                return __class__;
054:            }
055:
056:            public Object toObject() {
057:                return null;
058:            }
059:
060:            public String toString() {
061:                StringBuffer buffer = new StringBuffer(50);
062:                buffer.append(_function);
063:                buffer.append(' ');
064:                buffer.append('[');
065:                buffer.append(_module.getPathinfo());
066:                if (_line > 0) {
067:                    buffer.append(": ");
068:                    buffer.append(_line);
069:                }
070:                buffer.append("] ");
071:                return buffer.toString();
072:            }
073:
074:            /// @method getPathinfo
075:            /// Returns the path of the source file containing the execution point 
076:            /// represented by this stack trace element.
077:            /// @synopsis string getPathinfo()
078:            public Any m_getPathinfo() {
079:                return Any.create(_module.getPathinfo());
080:            }
081:
082:            /// @method getClassName
083:            /// Returns the fully qualified name of the class containing 
084:            /// the execution point represented by this stack trace element.
085:            /// @synopsis string getClassName()
086:            public Any m_getClassName() {
087:                if (_instance != null) {
088:                    return Any.create(_instance.classOf().getQualifiedName());
089:                } else {
090:                    return UNDEFINED;
091:                }
092:            }
093:
094:            /// @method getLine
095:            /// Returns the line number of the source line containing 
096:            /// the execution point represented by this stack trace element.
097:            /// @synopsis int getLine()
098:            public Any m_getLine() {
099:                return Any.create(_line);
100:            }
101:
102:            /// @method getModule
103:            /// Returns the module instance containing 
104:            /// the execution point represented by this stack trace element.
105:            /// @synopsis Scope getModule()
106:            /// @throws AccessDenied If security policy denies access to 
107:            /// path represented by this stack trace element
108:            public Any m_getModule(Context context) {
109:                context.checkImport(_module.getPathinfo());
110:                return new AnyScope(_module);
111:            }
112:
113:            /// @method getInstance
114:            /// Returns the instance of class containing 
115:            /// the execution point represented by this stack trace element.
116:            /// @synopsis object getInstance()
117:            /// @return Instance, or undefined if the execution were not
118:            /// in method.
119:            /// @throws AccessDenied If security policy denies access to 
120:            /// path represented by this stack trace element
121:            public Any m_getInstance(Context context) {
122:                context.checkImport(_module.getPathinfo());
123:                if (_instance != null) {
124:                    return _instance;
125:                } else {
126:                    return UNDEFINED;
127:                }
128:            }
129:
130:            /// @method getFunctionName
131:            /// Returns the name of the function containing 
132:            /// the execution point represented by this stack trace element.
133:            /// @synopsis string getFunctionName()
134:            public Any m_getFunctionName() {
135:                return Any.create(_function.getName());
136:            }
137:
138:            /// @method getFunction
139:            /// Returns a handle to function (or method) containing 
140:            /// the execution point represented by this stack trace element.
141:            /// Instance, if any, is inserted to handle as well.
142:            /// @synopsis Function getFunction()
143:            /// @throws AccessDenied If security policy denies access to 
144:            /// path represented by this stack trace element
145:            public Any m_getFunction(Context context) {
146:                context.checkImport(_module.getPathinfo());
147:                if (_function != null) {
148:                    return new AnyFunction(_instance, _function);
149:                } else {
150:                    return UNDEFINED;
151:                }
152:            }
153:
154:            public static final anvil.script.compiler.NativeClass __class__ = new anvil.script.compiler.NativeClass(
155:                    "StackTraceElement",
156:                    AnyStackTraceElement.class,
157:                    //DOC{{
158:                    ""
159:                            + " @class StackTraceElelement\n"
160:                            + " Represents a single stack frame.\n"
161:                            + " @method getPathinfo\n"
162:                            + " Returns the path of the source file containing the execution point \n"
163:                            + " represented by this stack trace element.\n"
164:                            + " @synopsis string getPathinfo()\n"
165:                            + " @method getClassName\n"
166:                            + " Returns the fully qualified name of the class containing \n"
167:                            + " the execution point represented by this stack trace element.\n"
168:                            + " @synopsis string getClassName()\n"
169:                            + " @method getLine\n"
170:                            + " Returns the line number of the source line containing \n"
171:                            + " the execution point represented by this stack trace element.\n"
172:                            + " @synopsis int getLine()\n"
173:                            + " @method getModule\n"
174:                            + " Returns the module instance containing \n"
175:                            + " the execution point represented by this stack trace element.\n"
176:                            + " @synopsis Scope getModule()\n"
177:                            + " @throws AccessDenied If security policy denies access to \n"
178:                            + " path represented by this stack trace element\n"
179:                            + " @method getInstance\n"
180:                            + " Returns the instance of class containing \n"
181:                            + " the execution point represented by this stack trace element.\n"
182:                            + " @synopsis object getInstance()\n"
183:                            + " @return Instance, or undefined if the execution were not\n"
184:                            + " in method.\n"
185:                            + " @throws AccessDenied If security policy denies access to \n"
186:                            + " path represented by this stack trace element\n"
187:                            + " @method getFunctionName\n"
188:                            + " Returns the name of the function containing \n"
189:                            + " the execution point represented by this stack trace element.\n"
190:                            + " @synopsis string getFunctionName()\n"
191:                            + " @method getFunction\n"
192:                            + " Returns a handle to function (or method) containing \n"
193:                            + " the execution point represented by this stack trace element.\n"
194:                            + " Instance, if any, is inserted to handle as well.\n"
195:                            + " @synopsis Function getFunction()\n"
196:                            + " @throws AccessDenied If security policy denies access to \n"
197:                            + " path represented by this stack trace element\n"
198:            //}}DOC
199:            );
200:            static {
201:                RuntimeModule.class.getName();
202:            }
203:
204:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.