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


java.lang.Object
   de.gulden.util.javasource.sourclet.AbstractSourclet
      de.gulden.util.javasource.sourclet.standard.StandardSourclet

StandardSourclet
public class StandardSourclet extends AbstractSourclet (Code)
The StandardSourclet used by BeautyJ. See documentation of Beauty and the Java Sourclet API.
author:
   Jens Gulden
version:
   1.1


Field Summary
protected static  StringdefaultExceptionTexts
     These defaults are also named for option doc.exception.texts in the configuration XML File.
protected  PropertiesexceptionTexts
     The exception texts.
protected  StringheaderfileText
     The headerfile text.
protected static  String[]specialPrefixes
    

Constructor Summary
public  StandardSourclet()
     Creates a new instance of StandardSourclet.

Method Summary
protected  StringapplyCodeFormatting(String code)
     Apply code transformations according to options set by the user.
public  voidbuildBodySource(OutputStream out, SourceObjectDeclared o)
     Outputs the body content of the source object.
protected static  voidbuildDocumentationTagged(OutputStream out, DocumentationTagged tag, String spaces)
     Builds the documentation tagged.
public  voidbuildEndSource(OutputStream out, SourceObjectDeclared o)
     Outputs everything that occurs after the SourceObject.
public  voidbuildHeadSource(OutputStream out, SourceObjectDeclared o)
     Outputs the head part of a source object.
protected  voidbuildHeader(OutputStream out, char mark, String header)
     Outputs a seperating header, if the corresponding option is set.
protected  voidbuildHeader(OutputStream out, char mark, String header, String headerPlural, int num)
     Outputs a seperating header, if the corresponding option is set.
protected  voidbuildHeader(OutputStream out, char mark, String header, int num)
     Outputs a seperating header, if the corresponding option is set.
protected  voidbuildSourceAll(OutputStream out, Vector v, String header)
     Builds all source objects in Vector v, sorted by
  • public
  • protected
  • package-private
  • private
modifiers.
In front of the generated code, a header is attached which names the type of the source objects, distinguishing between singular (if v.size()==1) and plural (f v.size()>1) form.
Here, the plural form is derived from simply adding an 's', which works for most english words.
protected  voidbuildSourceAll(OutputStream out, Vector v, String header, String headerPlural)
     Builds all source objects in Vector v, sorted by
  • public
  • protected
  • package-private
  • private
modifiers.
In front of the generated code, a header is attached which names the type of the source objects, distinguishing between singular (if v.size()==1) and plural (f v.size()>1) form.
public  voidbuildStartSource(OutputStream out, SourceObjectDeclared o)
     Outputs the start part of a source object. This is the part which comes before the 'normal' head (e.g.
protected  voidbuildTagDocumentation(OutputStream out, SourceObjectDeclared o, DocumentationDeclared doc, DocumentationDeclared supDoc)
     Builds the tag documentation.
protected  voidbuildTagDocumentationSynthesize(OutputStream out, String typeName, String tagName, String tagItem, String defaultValue, DocumentationDeclared doc, DocumentationDeclared supDoc, String spaces, boolean synthesize)
     Builds the tag documentation synthesize.
public static  Stringchars(char mark, int count)
     Returns a string repeating the character mark for count times.
public static  StringcleanCode(String c)
     Removes out-commented dead lines of from a block of Java code.
protected  Stringformat(String code)
     Format a code block according to standard auto-indentation rules.
protected  StringgetExceptionText(String exc)
     Returns the associated description for the exception class name specified by exc.
protected  StringgetHeaderfile()
     If a headerfile is specified, get the content as string.
protected static  StringgetParentQualifier(String name)
     Returns the parent part of a fully qualified identifier name.
public static  StringgetSpecialPrefix(String id)
     Returns the special prefix of the identifer, if there is any.
public static  StringgetTypeCode(SourceObject o)
     Returns the canonical string representation of a SourceObject's type.
public static  booleanhasSpecialPrefix(String id)
     Tests whether the identifier has a special prefix.
protected  Stringindent(String text, int steps)
     Indents a given block of text by the given number of steps.
protected  Stringindent(int steps)
     Returns a string with spaces.
public static  booleanisDeadCodeLine(String l)
     Tests whether a line of Java code is an out-commented dead line of code.
public static  booleanisDummy(String text)
    
public static  Stringisodate()
     Returns the current date in ISO date format yyyy-MM-dd.
protected  StringmakeSureIsQualifyable(Class inClass, String unqualified, String qualified)
     Tests if an unqulified class name can be fully qualified inside a class declaration.
public static  Stringreplace(String s, String find, String repl)
     Replaces all occurrences of string find in s by repl.
public static  Stringspaces(int count)
     Returns a string repeating the space character for count times.
public static  StringstartWithStars(String s, String spaces)
     Appends a vertical line of star characters in front of s.
public static  StringtoWords(String s)
     Convert a string of format "xxxYyyyZzzz" to "xxx yyyy zzzz". This is a simple mechanism to retrieve english language for auto-generating Javadoc comments from semantically rich identifier names.
Parameters:
  s - The identifier name.
protected static  DocumentationDeclaredtryGetDocumentationFromSuperclass(SourceObjectDeclared o)
    
public static  Stringunqualify(String n)
     Return the name part of an identifier behind the last '.' occurrence.
Parameters:
  n - The qualified (or already unqualified) identifier name.
protected  StringunqualifyClassname(Class inClass, String name)
    

Field Detail
defaultExceptionTexts
protected static String defaultExceptionTexts(Code)
These defaults are also named for option doc.exception.texts in the configuration XML File. But if they are overwritten by the user, they still get used, so keep here as constant and always add to user's texts.



exceptionTexts
protected Properties exceptionTexts(Code)
The exception texts.



headerfileText
protected String headerfileText(Code)
The headerfile text.



specialPrefixes
protected static String[] specialPrefixes(Code)

See Also:   StandardSourclet.getSpecialPrefix
See Also:   StandardSourclet.hasSpecialPrefix




Constructor Detail
StandardSourclet
public StandardSourclet()(Code)
Creates a new instance of StandardSourclet.




Method Detail
applyCodeFormatting
protected String applyCodeFormatting(String code)(Code)
Apply code transformations according to options set by the user.



buildBodySource
public void buildBodySource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)
Outputs the body content of the source object. For example, in case of methods this is Java code, in case of classes this recursively contains other SourceObjects' code.
throws:
  IOException - if an i/o error occurs



buildDocumentationTagged
protected static void buildDocumentationTagged(OutputStream out, DocumentationTagged tag, String spaces) throws IOException(Code)
Builds the documentation tagged.
throws:
  IOException - if an i/o error occurs



buildEndSource
public void buildEndSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)
Outputs everything that occurs after the SourceObject.
throws:
  IOException - if an i/o error occurs



buildHeadSource
public void buildHeadSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)
Outputs the head part of a source object. This is the actual Java code that declares the source object, for example a method's signature.
throws:
  IOException - if an i/o error occurs



buildHeader
protected void buildHeader(OutputStream out, char mark, String header) throws IOException(Code)
Outputs a seperating header, if the corresponding option is set.
throws:
  IOException - if an i/o error occurs



buildHeader
protected void buildHeader(OutputStream out, char mark, String header, String headerPlural, int num) throws IOException(Code)
Outputs a seperating header, if the corresponding option is set. Depending on num, the plural or singular form is used (or nothing, if num==0).
throws:
  IOException - if an i/o error occurs



buildHeader
protected void buildHeader(OutputStream out, char mark, String header, int num) throws IOException(Code)
Outputs a seperating header, if the corresponding option is set. Depending on num, a plural or singular form is used (or nothing, if num==0). The plural is auto-generated by adding an 's'.
throws:
  IOException - if an i/o error occurs



buildSourceAll
protected void buildSourceAll(OutputStream out, Vector v, String header) throws IOException(Code)
Builds all source objects in Vector v, sorted by
  • public
  • protected
  • package-private
  • private
modifiers.
In front of the generated code, a header is attached which names the type of the source objects, distinguishing between singular (if v.size()==1) and plural (f v.size()>1) form.
Here, the plural form is derived from simply adding an 's', which works for most english words.
throws:
  IOException - if an i/o error occurs



buildSourceAll
protected void buildSourceAll(OutputStream out, Vector v, String header, String headerPlural) throws IOException(Code)
Builds all source objects in Vector v, sorted by
  • public
  • protected
  • package-private
  • private
modifiers.
In front of the generated code, a header is attached which names the type of the source objects, distinguishing between singular (if v.size()==1) and plural (f v.size()>1) form.
throws:
  IOException - if an i/o error occurs



buildStartSource
public void buildStartSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)
Outputs the start part of a source object. This is the part which comes before the 'normal' head (e.g. before a method's signature), so usually this is the place where to output Javadoc comments.
throws:
  IOException - if an i/o error occurs



buildTagDocumentation
protected void buildTagDocumentation(OutputStream out, SourceObjectDeclared o, DocumentationDeclared doc, DocumentationDeclared supDoc) throws IOException(Code)
Builds the tag documentation.
throws:
  IOException - if an i/o error occurs



buildTagDocumentationSynthesize
protected void buildTagDocumentationSynthesize(OutputStream out, String typeName, String tagName, String tagItem, String defaultValue, DocumentationDeclared doc, DocumentationDeclared supDoc, String spaces, boolean synthesize) throws IOException(Code)
Builds the tag documentation synthesize.
throws:
  IOException - if an i/o error occurs



chars
public static String chars(char mark, int count)(Code)
Returns a string repeating the character mark for count times.



cleanCode
public static String cleanCode(String c)(Code)
Removes out-commented dead lines of from a block of Java code.
See Also:   StandardSourclet.isDeadCodeLine



format
protected String format(String code)(Code)
Format a code block according to standard auto-indentation rules. This is a quick solution and could be done much more sophisticated. (The current version of the StandardSourclet puts focus in the overall organization of .java files, not primarily on the code blocks.) Maybe later versions should incorporate mature code from other OpenSource beautifier projects here - volunteers welcome!



getExceptionText
protected String getExceptionText(String exc)(Code)
Returns the associated description for the exception class name specified by exc.



getHeaderfile
protected String getHeaderfile()(Code)
If a headerfile is specified, get the content as string.



getParentQualifier
protected static String getParentQualifier(String name)(Code)
Returns the parent part of a fully qualified identifier name.



getSpecialPrefix
public static String getSpecialPrefix(String id)(Code)
Returns the special prefix of the identifer, if there is any. Otherwise null is returned.
See Also:   StandardSourclet.specialPrefixes



getTypeCode
public static String getTypeCode(SourceObject o)(Code)
Returns the canonical string representation of a SourceObject's type.



hasSpecialPrefix
public static boolean hasSpecialPrefix(String id)(Code)
Tests whether the identifier has a special prefix.
See Also:   StandardSourclet.specialPrefixes



indent
protected String indent(String text, int steps)(Code)
Indents a given block of text by the given number of steps. The size of each step in 'number of spaces' is set by option code.indent.spaces. Indented text.



indent
protected String indent(int steps)(Code)
Returns a string with spaces. The number is determined by steps*option('code.indent.spaces').



isDeadCodeLine
public static boolean isDeadCodeLine(String l)(Code)
Tests whether a line of Java code is an out-commented dead line of code. This is the case when it starts with "//" and end with either ';', '{' or '}'.



isDummy
public static boolean isDummy(String text)(Code)



isodate
public static String isodate()(Code)
Returns the current date in ISO date format yyyy-MM-dd.



makeSureIsQualifyable
protected String makeSureIsQualifyable(Class inClass, String unqualified, String qualified)(Code)
Tests if an unqulified class name can be fully qualified inside a class declaration. If this is not the case, depending on the user-option '-code.auto.import' an import statement is generated, or just a warning message is output.



replace
public static String replace(String s, String find, String repl)(Code)
Replaces all occurrences of string find in s by repl.



spaces
public static String spaces(int count)(Code)
Returns a string repeating the space character for count times.



startWithStars
public static String startWithStars(String s, String spaces)(Code)
Appends a vertical line of star characters in front of s. s may contain multiple lines, seperated by either \n or \r, in that case a multi-line result is returned.



toWords
public static String toWords(String s)(Code)
Convert a string of format "xxxYyyyZzzz" to "xxx yyyy zzzz". This is a simple mechanism to retrieve english language for auto-generating Javadoc comments from semantically rich identifier names.
Parameters:
  s - The identifier name. English language fragment retrieved from identifier name.



tryGetDocumentationFromSuperclass
protected static DocumentationDeclared tryGetDocumentationFromSuperclass(SourceObjectDeclared o)(Code)



unqualify
public static String unqualify(String n)(Code)
Return the name part of an identifier behind the last '.' occurrence.
Parameters:
  n - The qualified (or already unqualified) identifier name. The unqualified identifier name.



unqualifyClassname
protected String unqualifyClassname(Class inClass, String name)(Code)



Fields inherited from de.gulden.util.javasource.sourclet.AbstractSourclet
public static String nl(Code)(Java Doc)
protected SourcletOptions options(Code)(Java Doc)

Methods inherited from de.gulden.util.javasource.sourclet.AbstractSourclet
abstract public void buildBodySource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)(Java Doc)
abstract public void buildEndSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)(Java Doc)
abstract public void buildHeadSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)(Java Doc)
public void buildSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)(Java Doc)
abstract public void buildStartSource(OutputStream out, SourceObjectDeclared o) throws IOException(Code)(Java Doc)
public int getIntOption(String name)(Code)(Java Doc)
public String getOption(String name)(Code)(Java Doc)
public SourcletOptions getOptions()(Code)(Java Doc)
public boolean hasOption(String name, String value)(Code)(Java Doc)
public void init(SourcletOptions options)(Code)(Java Doc)
public boolean isOption(String name)(Code)(Java Doc)
public boolean isOption(String name, String value)(Code)(Java Doc)
public void setOptions(SourcletOptions options)(Code)(Java Doc)
public static void write(OutputStream out, String s) throws IOException(Code)(Java Doc)
public static void writeln(OutputStream out, String s) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.