Java Doc for JBlock.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 Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.codemodel.JBlock

JBlock
final public class JBlock implements JGenerable,JStatement(Code)
A block of Java code, which may contain statements and local declarations.

JBlock contains a large number of factory methods that creates new statements/declarations. Those newly created statements/declarations are inserted into the JBlock.pos() "current position" . The position advances one every time you add a new instruction.




Constructor Summary
public  JBlock()
    
public  JBlock(boolean bracesRequired, boolean indentRequired)
    

Method Summary
public  void_break()
    
public  void_break(JLabel label)
    
public  void_continue(JLabel label)
    
public  void_continue()
    
public  JDoLoop_do(JExpression test)
    
public  JForLoop_for()
    
public  JConditional_if(JExpression expr)
    
public  void_return()
    
public  void_return(JExpression exp)
    
public  JSwitch_switch(JExpression test)
    
public  void_throw(JExpression exp)
    
public  JTryBlock_try()
    
public  JWhileLoop_while(JExpression test)
    
public  JBlockadd(JStatement s)
    
public  JBlockassign(JAssignmentTarget lhs, JExpression exp)
     Creates an assignment statement and adds it to this block.
public  JBlockassignPlus(JAssignmentTarget lhs, JExpression exp)
    
public  JBlockblock()
    
public  JVardecl(JType type, String name)
    
public  JVardecl(JType type, String name, JExpression init)
     Adds a local variable declaration to this block
Parameters:
  type - JType of the variable
Parameters:
  name - Name of the variable
Parameters:
  init - Initialization expression for this variable.
public  JVardecl(int mods, JType type, String name, JExpression init)
     Adds a local variable declaration to this block
Parameters:
  mods - Modifiers for the variable
Parameters:
  type - JType of the variable
Parameters:
  name - Name of the variable
Parameters:
  init - Initialization expression for this variable.
public  JStatementdirectStatement(String source)
     Creates a "literal" statement directly.
public  JForEachforEach(JType varType, String name, JExpression collection)
    
public  voidgenerate(JFormatter f)
    
 voidgenerateBody(JFormatter f)
    
public  List<Object>getContents()
     Returns a read-only view of JStatement s and JDeclaration in this block.
public  JInvocationinvoke(JExpression expr, String method)
     Creates an invocation statement and adds it to this block.
public  JInvocationinvoke(JExpression expr, JMethod method)
     Creates an invocation statement and adds it to this block.
public  JInvocationinvoke(String method)
     Creates an invocation statement and adds it to this block.
public  JInvocationinvoke(JMethod method)
     Creates an invocation statement and adds it to this block.
public  JLabellabel(String name)
     Create a label, which can be referenced from continue and break statements.
public  intpos()
     Gets the current position to which new statements will be inserted.
public  intpos(int newPos)
     Sets the current position.
public  voidstate(JFormatter f)
    
public  JInvocationstaticInvoke(JClass type, String method)
     Creates a static invocation statement.


Constructor Detail
JBlock
public JBlock()(Code)



JBlock
public JBlock(boolean bracesRequired, boolean indentRequired)(Code)




Method Detail
_break
public void _break()(Code)
Create a break statement and add it to this block



_break
public void _break(JLabel label)(Code)



_continue
public void _continue(JLabel label)(Code)
Create a continue statement and add it to this block



_continue
public void _continue()(Code)



_do
public JDoLoop _do(JExpression test)(Code)
Create a Do statement and add it to this block Newly generated Do statement



_for
public JForLoop _for()(Code)
Create a For statement and add it to this block Newly generated For statement



_if
public JConditional _if(JExpression expr)(Code)
Create an If statement and add it to this block
Parameters:
  expr - JExpression to be tested to determine branching Newly generated conditional statement



_return
public void _return()(Code)
Create a return statement and add it to this block



_return
public void _return(JExpression exp)(Code)
Create a return statement and add it to this block



_switch
public JSwitch _switch(JExpression test)(Code)
Create a switch/case statement and add it to this block



_throw
public void _throw(JExpression exp)(Code)
Create a throw statement and add it to this block



_try
public JTryBlock _try()(Code)
Create a Try statement and add it to this block Newly generated Try statement



_while
public JWhileLoop _while(JExpression test)(Code)
Create a While statement and add it to this block Newly generated While statement



add
public JBlock add(JStatement s)(Code)
Adds a statement to this block
Parameters:
  s - JStatement to be added This block



assign
public JBlock assign(JAssignmentTarget lhs, JExpression exp)(Code)
Creates an assignment statement and adds it to this block.
Parameters:
  lhs - Assignable variable or field for left hand side of expression
Parameters:
  exp - Right hand side expression



assignPlus
public JBlock assignPlus(JAssignmentTarget lhs, JExpression exp)(Code)



block
public JBlock block()(Code)
Create a sub-block and add it to this block



decl
public JVar decl(JType type, String name)(Code)
Adds a local variable declaration to this block
Parameters:
  type - JType of the variable
Parameters:
  name - Name of the variable Newly generated JVar



decl
public JVar decl(JType type, String name, JExpression init)(Code)
Adds a local variable declaration to this block
Parameters:
  type - JType of the variable
Parameters:
  name - Name of the variable
Parameters:
  init - Initialization expression for this variable. May be null. Newly generated JVar



decl
public JVar decl(int mods, JType type, String name, JExpression init)(Code)
Adds a local variable declaration to this block
Parameters:
  mods - Modifiers for the variable
Parameters:
  type - JType of the variable
Parameters:
  name - Name of the variable
Parameters:
  init - Initialization expression for this variable. May be null. Newly generated JVar



directStatement
public JStatement directStatement(String source)(Code)
Creates a "literal" statement directly.

Specified string is printed as-is. This is useful as a short-cut.

For example, you can invoke this method as: directStatement("a=b+c;").




forEach
public JForEach forEach(JType varType, String name, JExpression collection)(Code)
Creates an enhanced For statement based on j2se 1.5 JLS and add it to this block Newly generated enhanced For statement per j2se 1.5specification



generate
public void generate(JFormatter f)(Code)



generateBody
void generateBody(JFormatter f)(Code)



getContents
public List<Object> getContents()(Code)
Returns a read-only view of JStatement s and JDeclaration in this block.



invoke
public JInvocation invoke(JExpression expr, String method)(Code)
Creates an invocation statement and adds it to this block.
Parameters:
  expr - JExpression evaluating to the class or object upon whichthe named method will be invoked
Parameters:
  method - Name of method to invoke Newly generated JInvocation



invoke
public JInvocation invoke(JExpression expr, JMethod method)(Code)
Creates an invocation statement and adds it to this block.
Parameters:
  expr - JExpression evaluating to the class or object upon whichthe method will be invoked
Parameters:
  method - JMethod to invoke Newly generated JInvocation



invoke
public JInvocation invoke(String method)(Code)
Creates an invocation statement and adds it to this block.
Parameters:
  method - Name of method to invoke Newly generated JInvocation



invoke
public JInvocation invoke(JMethod method)(Code)
Creates an invocation statement and adds it to this block.
Parameters:
  method - JMethod to invoke Newly generated JInvocation



label
public JLabel label(String name)(Code)
Create a label, which can be referenced from continue and break statements.



pos
public int pos()(Code)
Gets the current position to which new statements will be inserted. For example if the value is 0, newly created instructions will be inserted at the very beginning of the block.
See Also:   JBlock.pos(int)



pos
public int pos(int newPos)(Code)
Sets the current position. the old value of the current position.
throws:
  IllegalArgumentException - if the new position value is illegal.
See Also:   JBlock.pos()



state
public void state(JFormatter f)(Code)



staticInvoke
public JInvocation staticInvoke(JClass type, String method)(Code)
Creates a static invocation statement.



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.