Source Code Cross Referenced for TargettedMessage.java in  » Web-Framework » RSF » uk » org » ponder » messageutil » 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 » RSF » uk.org.ponder.messageutil 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Nov 23, 2004
003:         */
004:        package uk.org.ponder.messageutil;
005:
006:        import java.io.Serializable;
007:
008:        /**
009:         * Represents a single message, for presentation to the user, targetted at a
010:         * particular field or part of an interface. The message has not yet been 
011:         * resolved onto its localised representation (generally to be performed via
012:         * {@link MessageLocator}, and has an associated severity level. 
013:         * @author Antranig Basman (antranig@caret.cam.ac.uk)
014:         * 
015:         */
016:        public class TargettedMessage implements  Serializable {
017:            public static final String TARGET_NONE = "No specific target";
018:            /**
019:             * A list of possible message codes, in descending order of specificity. This
020:             * is the same semantics as Spring's "MessageSourceResolvable" system.
021:             */
022:            public String[] messagecodes;
023:            public Object[] args = null;
024:            public String targetid = TARGET_NONE;
025:            public Exception exception;
026:
027:            public static final int SEVERITY_INFO = 0;
028:            public static final int SEVERITY_ERROR = 1;
029:            public int severity = SEVERITY_ERROR;
030:
031:            public void updateMessageCode(String messagecode) {
032:                messagecodes = new String[] { messagecode };
033:            }
034:
035:            public void updateTarget(String targetid) {
036:                this .targetid = targetid == null ? TARGET_NONE : targetid;
037:            }
038:
039:            public String acquireMessageCode() {
040:                return messagecodes == null ? null
041:                        : messagecodes[messagecodes.length - 1];
042:            }
043:
044:            public TargettedMessage() {
045:            }
046:
047:            /** Construct a simple targetted message
048:             * @param messagecode The message key for resolving the message text.
049:             * @param targetid The target field or path of the message, if <code>null</code>
050:             * will be substituted with {@link #TARGET_NONE}.
051:             */
052:            public TargettedMessage(String messagecode, String targetid) {
053:                updateMessageCode(messagecode);
054:                this .targetid = targetid == null ? TARGET_NONE : targetid;
055:            }
056:
057:            public TargettedMessage(String messagecode, Object[] args,
058:                    String targetid) {
059:                updateMessageCode(messagecode);
060:                updateTarget(targetid);
061:                this .args = args;
062:            }
063:
064:            public TargettedMessage(String messagecode) {
065:                updateMessageCode(messagecode);
066:            }
067:
068:            public TargettedMessage(String messagecode, Exception exception) {
069:                updateMessageCode(messagecode);
070:                this .exception = exception;
071:            }
072:
073:            public TargettedMessage(String messagecode, Exception exception,
074:                    String targetid) {
075:                updateMessageCode(messagecode);
076:                updateTarget(targetid);
077:                this .exception = exception;
078:            }
079:
080:            public TargettedMessage(String messagecode, Object[] args) {
081:                updateMessageCode(messagecode);
082:                this .args = args;
083:            }
084:
085:            public TargettedMessage(String messagecode, Object[] args,
086:                    int severity) {
087:                updateMessageCode(messagecode);
088:                this .args = args;
089:                this .severity = severity;
090:            }
091:
092:            public TargettedMessage(String[] messagecodes, Object[] args,
093:                    String targetid) {
094:                updateTarget(targetid);
095:                this .messagecodes = messagecodes;
096:                this .args = args;
097:            }
098:
099:            /** The fullest constructor for TargettedMessage.
100:             * @param messagecodes Message codes to be used for resolution, in descending
101:             * order of priority. See {@link MessageLocator}
102:             * @param args Any arguments required for substitution in the resolved message.
103:             * @param targetid The ID or path that the message is to be targetted at.
104:             * @param severity The severity of the message, either {@link #SEVERITY_INFO} or
105:             * {@link #SEVERITY_ERROR}
106:             */
107:            public TargettedMessage(String[] messagecodes, Object[] args,
108:                    String targetid, int severity) {
109:                updateTarget(targetid);
110:                this.messagecodes = messagecodes;
111:                this.args = args;
112:                this.severity = severity;
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.