Source Code Cross Referenced for UserColumn.java in  » Report » datavision-1.1.0 » jimm » datavision » 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 » Report » datavision 1.1.0 » jimm.datavision 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package jimm.datavision;
002:
003:        import jimm.datavision.source.DataSource;
004:        import jimm.datavision.source.Table;
005:        import jimm.datavision.source.sql.SQLQuery;
006:        import jimm.util.XMLWriter;
007:
008:        /**
009:         * A user column is an arbitrary expression inserted into the SQL query
010:         * and retrieved as a column value. It may contain database
011:         * column values, parameters, special values, strings, or
012:         * numbers. It can't contain formulas because their values may be
013:         * undefined when the query is run.
014:         * <p>
015:         * When used by a query, the following substitutions are made withing
016:         * the <var>userString</var> of a user column:
017:         * <ul>
018:         * <li>{<i>table_name.column_name</i>} is replaced by the column name
019:         * <i>table_name.column_name</i>.</li>
020:         * <li> {%<i>special_value_name</i>} is replaced by a special value
021:         * (report title, report run date, page number, or record number).</li>
022:         * <li> {?<i>id_number</i>} is replaced by a parameter value (string,
023:         * number, or date).</li>
024:         * <ul>
025:         *
026:         * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
027:         */
028:        public class UserColumn extends Expression implements  Selectable {
029:
030:            public static final int MAX_DISPLAY_NAME_LENGTH = 16;
031:
032:            /**
033:             * Constructor.
034:             *
035:             * @param id the unique identifier for the new user column; if
036:             * <code>null</code>, generate a new id
037:             * @param report the report containing this user column
038:             * @param name the user column name
039:             */
040:            public UserColumn(Long id, Report report, String name) {
041:                this (id, report, name, null);
042:            }
043:
044:            /**
045:             * Constructor. If <i>id</i> is <code>null</code>, generates a new id number.
046:             * This number is one higher than any previously-seen id number. This does
047:             * <em>not</em> guarantee that no later user column will be created manually
048:             * with the same id number.
049:             *
050:             * @param id the unique identifier for the new user column; if
051:             * <code>null</code>, generate a new id
052:             * @param report the report containing this user column
053:             * @param name the user column name
054:             * @param evalString the string to evaulate at runtime.
055:             */
056:            public UserColumn(Long id, Report report, String name,
057:                    String evalString) {
058:                super (id == null ? report.generateNewUserColumnId() : id,
059:                        report, name, evalString, null);
060:            }
061:
062:            public Object getValue(Report report) {
063:                return report.columnValue(this );
064:            }
065:
066:            public String fieldTypeString() {
067:                return "usercol";
068:            }
069:
070:            public String getSelectString(SQLQuery query) {
071:                String str = getExpression();
072:                if (str == null)
073:                    return null;
074:                return query.prepare(str);
075:            }
076:
077:            public String getSortString(SQLQuery query) {
078:                return getSelectString(query);
079:            }
080:
081:            public Table getTable() {
082:                return null;
083:            }
084:
085:            public String getDisplayName() {
086:                return getName();
087:            }
088:
089:            public String dragString() {
090:                return "usercol:" + getId();
091:            }
092:
093:            public String designLabel() {
094:                return "{!" + getName() + "}";
095:            }
096:
097:            public String formulaString() {
098:                return "{!" + getId() + "}";
099:            }
100:
101:            public Selectable reloadInstance(DataSource dataSource) {
102:                return this ;
103:            }
104:
105:            /**
106:             * Returns this user column's SQL text as entered by the user.
107:             */
108:            public String toString() {
109:                return getExpression();
110:            }
111:
112:            public void writeXML(XMLWriter out) {
113:                writeXML(out, "usercol");
114:            }
115:
116:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.