Source Code Cross Referenced for Field.java in  » Code-Analyzer » beautyJ » de » gulden » util » javasource » 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 » Code Analyzer » beautyJ » de.gulden.util.javasource 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Project: BeautyJ - Customizable Java Source Code Transformer
003:         * Class:   de.gulden.util.javasource.Field
004:         * Version: 1.1
005:         *
006:         * Date:    2004-09-29
007:         *
008:         * Note:    Contains auto-generated Javadoc comments created by BeautyJ.
009:         *  
010:         * This is licensed under the GNU General Public License (GPL)
011:         * and comes with NO WARRANTY. See file license.txt for details.
012:         *
013:         * Author:  Jens Gulden
014:         * Email:   beautyj@jensgulden.de
015:         */
016:
017:        package de.gulden.util.javasource;
018:
019:        import de.gulden.util.javasource.jjt.Node;
020:        import de.gulden.util.javasource.jjt.*;
021:        import de.gulden.util.xml.XMLToolbox;
022:        import javax.xml.parsers.*;
023:        import org.w3c.dom.*;
024:        import java.io.*;
025:        import java.util.*;
026:
027:        /**
028:         * Represents a field definition.
029:         *  
030:         * @author  Jens Gulden
031:         * @version  1.0
032:         */
033:        public class Field extends Member implements  Typed {
034:
035:            // ------------------------------------------------------------------------
036:            // --- field                                                            ---
037:            // ------------------------------------------------------------------------
038:
039:            /**
040:             * The type.
041:             */
042:            protected Type type;
043:
044:            // ------------------------------------------------------------------------
045:            // --- constructor                                                      ---
046:            // ------------------------------------------------------------------------
047:
048:            /**
049:             * Creates a new instance of Field.
050:             */
051:            public Field(Class c) {
052:                super (c);
053:            }
054:
055:            // ------------------------------------------------------------------------
056:            // --- methods                                                          ---
057:            // ------------------------------------------------------------------------
058:
059:            /**
060:             * Returns the type.
061:             */
062:            public Type getType() {
063:                return type;
064:            }
065:
066:            /**
067:             * Sets the type.
068:             */
069:            public void setType(Type t) {
070:                type = t;
071:            }
072:
073:            /**
074:             * Output this object as XML.
075:             *  
076:             * @return  The XML tag.
077:             * @see  #initFromXML
078:             */
079:            public Element buildXML(Document d) {
080:                Element e = super .buildXML(d);
081:                e.insertBefore(type.buildXML(d), e.getFirstChild());
082:                if (getCode() != null) {
083:                    Element ee = d.createElement("initializer");
084:                    ee.appendChild(getCode().buildXML(d));
085:                    e.appendChild(ee);
086:                }
087:                return e;
088:            }
089:
090:            /**
091:             * Initialize this object from XML.
092:             *  
093:             * @param element The XML tag.
094:             * @throws IOException if an i/o error occurs
095:             */
096:            public void initFromXML(Element element) throws IOException {
097:                // to be extended (not overwritten) by subclasses
098:                super .initFromXML(element);
099:
100:                // type
101:                Element ty = XMLToolbox.getChildRequired(element, "type");
102:                type = new Type(this );
103:                type.initFromXML(ty);
104:
105:                // field initializer
106:                Element in = XMLToolbox.getChild(element, "initializer");
107:                if (in != null) {
108:                    code = new Code();
109:                    code.initFromXML(XMLToolbox.getChildRequired(in, "code"));
110:                } else {
111:                    code = null;
112:                }
113:            }
114:
115:            /**
116:             * Initialize this object from parsed Java code.
117:             * Special way of invoking.
118:             *  
119:             * @param rootnode The corresponding node in the abstract syntax tree (AST).
120:             */
121:            void initFromAST(Node rootnode, Node varnode) {
122:                super .initFromAST(rootnode);
123:                String className = getDeclaringClass().getName();
124:                name = className + "." + varnode.getName();
125:
126:                type = new Type(this );
127:                type.initFromAST(rootnode, varnode); // special way of invoking (using rootnode, varnode)
128:
129:                Node codenode = varnode.getChild(JJT_CODE);
130:                if (codenode != null) // field has initializer
131:                {
132:                    code = new Code();
133:                    code.initFromAST(varnode); // special way of invoking
134:                } else {
135:                    code = null;
136:                }
137:            }
138:
139:        } // end Field
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.