Java Doc for IndentationRule.java in  » Code-Analyzer » hammurapi-3.20.0.3 » org » hammurapi » inspectors » 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 » hammurapi 3.20.0.3 » org.hammurapi.inspectors 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hammurapi.InspectorBase
      org.hammurapi.inspectors.IndentationRule

IndentationRule
public class IndentationRule extends InspectorBase implements Parameterizable(Code)

Hammurapi inspector for checking the indentation of the source code.

The parameter standard-indentation-level specifies the default indentation for blocks in curly braces. There must be no difference in the indentation of statements without sorrounding curly braces. Examples (with standard-indentation-level = 2):

 if (current.getType() == JavaTokenTypes.LCURLY) {
 requiredColumn += indentLevel;
 }
 while (parent != null && parent instanceof Class) {
 lassLevel++;
 parent = parent.getParent();
 }
 

If large expressions (e.g. in if-Statements) are longer than a single line it is recommended to use a different indentation. This is useful for distinguishing these expressions from the following Java blocks. In the same way the indentation of long assignment values, parameter, lists, long chains of method calls and throws-statement should be handled. This different indentation is specified by the parameter expression-indentation-level . Examples (with expression-indentation-level = 4):

 if (current.getType() == JavaTokenTypes.LPAREN && parenthesisLevel++ == 0) {
 requiredColumn += exprIndentLevel;
 }
 check((Token) aClass.getAst().getFirstToken(), getClassLevel(aClass),
 (Token) aClass.getAst().getLastToken());
 

author:
   Jochen Skulj
version:
   $Revision: 1.4 $


Field Summary
final public static  StringPARAMETER_EXPR_INDENT
    
final public static  StringPARAMETER_INDENT
    

Constructor Summary
public  IndentationRule()
    

Method Summary
protected  voidcheck(Token firstToken, int classLevel, Token lastToken)
    
protected  intgetClassLevel(LanguageElement anElement)
    
protected  voidinitSourceMarker(LanguageElement anElement)
    
public  booleansetParameter(String aName, Object aValue)
    
public  voidvisit(Class aClass)
    
public  voidvisit(Interface anInterface)
    

Field Detail
PARAMETER_EXPR_INDENT
final public static String PARAMETER_EXPR_INDENT(Code)
parameter name for the expression indentation



PARAMETER_INDENT
final public static String PARAMETER_INDENT(Code)
parameter name for the standard indentation




Constructor Detail
IndentationRule
public IndentationRule()(Code)
constructor




Method Detail
check
protected void check(Token firstToken, int classLevel, Token lastToken)(Code)
checks the indentation of a set of tokens
Parameters:
  firstToken - first token to inspect
Parameters:
  classLevel - number of surrounding classes (if current language element is aninner class or interface
Parameters:
  lastToken - last token to inspect



getClassLevel
protected int getClassLevel(LanguageElement anElement)(Code)
counts the parent classes
Parameters:
  anElement - current class or interface number of parent classes



initSourceMarker
protected void initSourceMarker(LanguageElement anElement)(Code)
initializes the source marker for the current language element
Parameters:
  anElement - current language element



setParameter
public boolean setParameter(String aName, Object aValue) throws ConfigurationException(Code)
sets parameters for the inspector
Parameters:
  aName - parameter name
Parameters:
  aParameter - parameter value



visit
public void visit(Class aClass)(Code)
checks indentation of tokens of a class
Parameters:
  aClass - class to inspect



visit
public void visit(Interface anInterface)(Code)
checks indentation of tokens of an interface
Parameters:
  anInterface - interface to inspect



Fields inherited from org.hammurapi.InspectorBase
protected InspectorContext context(Code)(Java Doc)

Methods inherited from org.hammurapi.InspectorBase
public void addTarget(Object target)(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
protected void disable(String message)(Code)(Java Doc)
public String getConfigInfo()(Code)(Java Doc)
public InspectorContext getContext()(Code)(Java Doc)
public Integer getOrder()(Code)(Java Doc)
public Collection getTargets()(Code)(Java Doc)
public void init() throws HammurapiException(Code)(Java Doc)
public void initDb(SQLProcessor processor, Properties dbProperties) throws SQLException(Code)(Java Doc)
public static boolean isEmpty(Statement statement)(Code)(Java Doc)
public void setContext(InspectorContext context)(Code)(Java Doc)
public void unSetContext()(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.