Source Code Cross Referenced for JFieldRef.java in  » 6.0-JDK-Modules » jaxb-xjc » com » sun » codemodel » 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 » 6.0 JDK Modules » jaxb xjc » com.sun.codemodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms
003:         * of the Common Development and Distribution License
004:         * (the "License").  You may not use this file except
005:         * in compliance with the License.
006:         * 
007:         * You can obtain a copy of the license at
008:         * https://jwsdp.dev.java.net/CDDLv1.0.html
009:         * See the License for the specific language governing
010:         * permissions and limitations under the License.
011:         * 
012:         * When distributing Covered Code, include this CDDL
013:         * HEADER in each file and include the License file at
014:         * https://jwsdp.dev.java.net/CDDLv1.0.html  If applicable,
015:         * add the following below this CDDL HEADER, with the
016:         * fields enclosed by brackets "[]" replaced with your
017:         * own identifying information: Portions Copyright [yyyy]
018:         * [name of copyright owner]
019:         */
020:
021:        package com.sun.codemodel;
022:
023:        /**
024:         * Field Reference
025:         */
026:
027:        public class JFieldRef extends JExpressionImpl implements 
028:                JAssignmentTarget {
029:            /**
030:             * Object expression upon which this field will be accessed, or
031:             * null for the implicit 'this'.
032:             */
033:            private JGenerable object;
034:
035:            /**
036:             * Name of the field to be accessed. Either this or {@link #var} is set.
037:             */
038:            private String name;
039:
040:            /**
041:             * Variable to be accessed.
042:             */
043:            private JVar var;
044:
045:            /**
046:             * Indicates if an explicit this should be generated
047:             */
048:            private boolean explicitThis;
049:
050:            /**
051:             * Field reference constructor given an object expression and field name
052:             *
053:             * @param object
054:             *        JExpression for the object upon which
055:             *        the named field will be accessed,
056:             *
057:             * @param name
058:             *        Name of field to access
059:             */
060:            JFieldRef(JExpression object, String name) {
061:                this (object, name, false);
062:            }
063:
064:            JFieldRef(JExpression object, JVar v) {
065:                this (object, v, false);
066:            }
067:
068:            /**
069:             * Static field reference.
070:             */
071:            JFieldRef(JType type, String name) {
072:                this (type, name, false);
073:            }
074:
075:            JFieldRef(JType type, JVar v) {
076:                this (type, v, false);
077:            }
078:
079:            JFieldRef(JGenerable object, String name, boolean explicitThis) {
080:                this .explicitThis = explicitThis;
081:                this .object = object;
082:                if (name.indexOf('.') >= 0)
083:                    throw new IllegalArgumentException(
084:                            "Field name contains '.': " + name);
085:                this .name = name;
086:            }
087:
088:            JFieldRef(JGenerable object, JVar var, boolean explicitThis) {
089:                this .explicitThis = explicitThis;
090:                this .object = object;
091:                this .var = var;
092:            }
093:
094:            public void generate(JFormatter f) {
095:                String name = this .name;
096:                if (name == null)
097:                    name = var.name();
098:
099:                if (object != null) {
100:                    f.g(object).p('.').p(name);
101:                } else {
102:                    if (explicitThis) {
103:                        f.p("this.").p(name);
104:                    } else {
105:                        f.id(name);
106:                    }
107:                }
108:            }
109:
110:            public JExpression assign(JExpression rhs) {
111:                return JExpr.assign(this , rhs);
112:            }
113:
114:            public JExpression assignPlus(JExpression rhs) {
115:                return JExpr.assignPlus(this, rhs);
116:            }
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.