Source Code Cross Referenced for MethodInvocationException.java in  » Template-Engine » Velocity » org » apache » velocity » exception » 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 » Template Engine » Velocity » org.apache.velocity.exception 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.velocity.exception;
002:
003:        import org.apache.commons.lang.StringUtils;
004:
005:        /*
006:         * Licensed to the Apache Software Foundation (ASF) under one
007:         * or more contributor license agreements.  See the NOTICE file
008:         * distributed with this work for additional information
009:         * regarding copyright ownership.  The ASF licenses this file
010:         * to you under the Apache License, Version 2.0 (the
011:         * "License"); you may not use this file except in compliance
012:         * with the License.  You may obtain a copy of the License at
013:         *
014:         *   http://www.apache.org/licenses/LICENSE-2.0
015:         *
016:         * Unless required by applicable law or agreed to in writing,
017:         * software distributed under the License is distributed on an
018:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
019:         * KIND, either express or implied.  See the License for the
020:         * specific language governing permissions and limitations
021:         * under the License.
022:         */
023:
024:        /**
025:         *  Application-level exception thrown when a reference method is
026:         *  invoked and an exception is thrown.
027:         *  <br>
028:         *  When this exception is thrown, a best effort will be made to have
029:         *  useful information in the exception's message.  For complete
030:         *  information, consult the runtime log.
031:         *
032:         * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
033:         * @version $Id: MethodInvocationException.java 471254 2006-11-04 20:11:29Z henning $
034:         */
035:        public class MethodInvocationException extends VelocityException
036:                implements  ExtendedParseException {
037:            /**
038:             * Version Id for serializable
039:             */
040:            private static final long serialVersionUID = 7305685093478106342L;
041:
042:            private String referenceName = "";
043:
044:            private final String methodName;
045:
046:            private final int lineNumber;
047:            private final int columnNumber;
048:            private final String templateName;
049:
050:            /**
051:             *  CTOR - wraps the passed in exception for
052:             *  examination later
053:             *
054:             *  @param message
055:             *  @param e Throwable that we are wrapping
056:             *  @param methodName name of method that threw the exception
057:             *  @param templateName The name of the template where the exception occured.
058:             */
059:            public MethodInvocationException(final String message,
060:                    final Throwable e, final String methodName,
061:                    final String templateName, final int lineNumber,
062:                    final int columnNumber) {
063:                super (message, e);
064:
065:                this .methodName = methodName;
066:                this .templateName = templateName;
067:                this .lineNumber = lineNumber;
068:                this .columnNumber = columnNumber;
069:            }
070:
071:            /**
072:             *  Returns the name of the method that threw the
073:             *  exception.
074:             *
075:             *  @return String name of method
076:             */
077:            public String getMethodName() {
078:                return methodName;
079:            }
080:
081:            /**
082:             *  Sets the reference name that threw this exception.
083:             *
084:             *  @param ref name of reference
085:             */
086:            public void setReferenceName(String ref) {
087:                referenceName = ref;
088:            }
089:
090:            /**
091:             *  Retrieves the name of the reference that caused the
092:             *  exception.
093:             *
094:             *  @return name of reference.
095:             */
096:            public String getReferenceName() {
097:                return referenceName;
098:            }
099:
100:            /**
101:             * @see ExtendedParseException#getColumnNumber()
102:             */
103:            public int getColumnNumber() {
104:                return columnNumber;
105:            }
106:
107:            /**
108:             * @see ExtendedParseException#getLineNumber()
109:             */
110:            public int getLineNumber() {
111:                return lineNumber;
112:            }
113:
114:            /**
115:             * @see ExtendedParseException#getTemplateName()
116:             */
117:            public String getTemplateName() {
118:                return templateName;
119:            }
120:
121:            /**
122:             * @see Exception#getMessage()
123:             */
124:            public String getMessage() {
125:                StringBuffer message = new StringBuffer();
126:                message.append(super .getMessage());
127:                message.append(" @ ");
128:                message
129:                        .append(StringUtils.isNotEmpty(templateName) ? templateName
130:                                : "<unknown template>");
131:                message.append("[").append(lineNumber).append(",").append(
132:                        columnNumber).append("]");
133:                return message.toString();
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.