Source Code Cross Referenced for XDocletJavaDocComponent.java in  » UML » jrefactory » org » acm » seguin » pretty » 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 » UML » jrefactory » org.acm.seguin.pretty 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Author:  Chris Seguin
003:         *
004:         *  This software has been developed under the copyleft
005:         *  rules of the GNU General Public License.  Please
006:         *  consult the GNU General Public License for more
007:         *  details about use and distribution of this software.
008:         */
009:        package org.acm.seguin.pretty;
010:
011:        import net.sourceforge.jrefactory.parser.Token;
012:
013:        /**
014:         *  Store a portion of a javadoc item
015:         *
016:         *@author     Mike Atkinson
017:         *@created    June 22, 2003
018:         *@since      JRefactory 2.7.02
019:         */
020:        public class XDocletJavaDocComponent extends JavaDocComponent {
021:
022:            /**
023:             *  Create an instance of this java doc object
024:             */
025:            public XDocletJavaDocComponent() {
026:                super ();
027:            }
028:
029:            /**
030:             *  Set the type
031:             *
032:             *@param  newType  the new type
033:             */
034:            public void setType(String newType) {
035:                super .setType(newType);
036:                setLongestLength(8);
037:            }
038:
039:            /**
040:             *  Print this tag
041:             *
042:             *@param  printData  printData
043:             */
044:            public void print(PrintData printData) {
045:                //  We are now printing it
046:                setPrinted(true);
047:
048:                //  Start the line
049:                printData.indent();
050:                if (!printData.isStarsAlignedWithSlash()) {
051:                    printData.space();
052:                }
053:                printData.appendComment("*", PrintData.JAVADOC_COMMENT);
054:
055:                if (printData.isSpaceBeforeAt()) {
056:                    printData.appendComment(" ", PrintData.JAVADOC_COMMENT);
057:                }
058:
059:                //  Print the type
060:                printData.appendComment(getType(), PrintData.JAVADOC_COMMENT);
061:                for (int i = 0; i < printData.getJavadocIndent(); ++i) {
062:                    printData.appendComment(" ", PrintData.JAVADOC_COMMENT);
063:                }
064:
065:                //  Break into lines
066:                StringBuffer sb = new StringBuffer();
067:                boolean startOnNewLine = false;
068:                int state = 0;
069:                XDocletTokenizer tok = new XDocletTokenizer(getDescription());
070:                while (tok.hasNext()) {
071:                    Token next = tok.next();
072:
073:                    if ((next.image == null) || (next.image.length() == 0)) {
074:                        //  Do nothing
075:                    } else if (next.image.equals("=")) {
076:                        //System.out.println("kind="+next.kind+", state="+state+", next.image="+next.image);
077:                        startOnNewLine = true;
078:                        //    System.out.println("  appending \" = \"");
079:                        sb.append(" ");
080:                        sb.append("=");
081:                        sb.append(" ");
082:                        state = 2;
083:                    } else if (next.kind == XDocletTokenizer.SPACE) {
084:                    } else if (next.kind == XDocletTokenizer.NEWLINE) {
085:                        //System.out.println("kind="+next.kind+", state="+state+", next.image="+next.image);
086:                        if (state != 0 && startOnNewLine) {
087:                            //System.out.println("  appending \""+next.image+"\"");
088:                            sb.append(next.image);
089:                            state = 0;
090:                        }
091:                    } else if (next.image.trim().equals("*")) {
092:                        //System.out.println("kind="+next.kind+", state="+state+", next.image="+next.image);
093:                    } else {
094:                        //System.out.println("kind="+next.kind+", state="+state+", next.image="+next.image);
095:                        //System.out.println("  appending \""+next.image+"\"");
096:                        sb.append(next.image);
097:                        state++;
098:                        if (state == 3) {
099:                            //System.out.println("  appending \\n");
100:                            sb.append("\n");
101:                            state = 0;
102:                        }
103:                    }
104:                }
105:
106:                int oldIndent = printData.getJavadocIndent();
107:                if (startOnNewLine) {
108:                    printData.indent();
109:                    if (!printData.isStarsAlignedWithSlash()) {
110:                        printData.space();
111:                    }
112:                    printData.appendComment("*", PrintData.JAVADOC_COMMENT);
113:                    for (int i = 0; i < oldIndent + 6; ++i) {
114:                        printData.space();
115:                    }
116:                }
117:                //System.out.println("printing: \""+sb.toString()+"\"");
118:                setDescription(sb.toString());
119:                printData.setJavadocIndent(oldIndent + 6); // increment indent
120:                leaveDescription(printData);
121:                printData.newline();
122:                printData.setJavadocIndent(oldIndent); // restore old indent
123:
124:                // blank line after Xdoclet comment
125:                printData.indent();
126:                if (!printData.isStarsAlignedWithSlash()) {
127:                    printData.space();
128:                }
129:                printData.appendComment("*", PrintData.JAVADOC_COMMENT);
130:            }
131:
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.