Java Doc for JDefinedClass.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.JType
      com.sun.codemodel.JClass
         com.sun.codemodel.JDefinedClass

All known Subclasses:   com.sun.codemodel.JAnonymousClass,
JDefinedClass
public class JDefinedClass extends JClass implements JDeclaration,JClassContainer,JGenerifiable,JAnnotatable(Code)
A generated Java class/interface/enum/....

This class models a declaration, and since a declaration can be always used as a reference, it inherits JClass .

Where to go from here?

You'd want to generate fields and methods on a class. See JDefinedClass.method(int,JType,String) and JDefinedClass.field(int,JType,String) .



Field Summary
final  Map<String, JFieldVar>fields
     Fields keyed by their names.
public  Objectmetadata
     Client-app spcific metadata associated with this user-created class.

Constructor Summary
 JDefinedClass(JClassContainer parent, int mods, String name, ClassType classTypeval)
    
 JDefinedClass(JCodeModel owner, int mods, String name)
     Constructor for creating anonymous inner class.

Method Summary
public  JDefinedClass_annotationTypeDeclaration(String name)
    
public  JDefinedClass_class(int mods, String name)
     Add a new nested class to this class.
public  JDefinedClass_class(int mods, String name, boolean isInterface)
    
public  JDefinedClass_class(int mods, String name, ClassType classTypeVal)
    
public  JDefinedClass_class(String name)
     Add a new public nested class to this class.
public  JDefinedClass_enum(String name)
    
public  JDefinedClass_enum(int mods, String name)
    
public  JDefinedClass_extends(JClass superClass)
     This class extends the specifed class.
public  JDefinedClass_extends(Class superClass)
    
public  JClass_extends()
     Returns the class extended by this class.
public  JDefinedClass_implements(JClass iface)
     This class implements the specifed interface.
public  JDefinedClass_implements(Class iface)
    
public  Iterator<JClass>_implements()
     Returns an iterator that walks the nested classes defined in this class.
public  JDefinedClass_interface(int mods, String name)
     Add an interface to this package.
public  JDefinedClass_interface(String name)
     Adds a public interface to this package.
final public  JPackage_package()
    
public  JAnnotationUseannotate(Class<? extends Annotation> clazz)
    
public  JAnnotationUseannotate(JClass clazz)
    
public  Wannotate2(Class<W> clazz)
    
public  StringbinaryName()
    
final public  Iterator<JDefinedClass>classes()
     Returns an iterator that walks the nested classes defined in this class.
public  JMethodconstructor(int mods)
     Adds a constructor to this class.
public  Iteratorconstructors()
     Returns an iterator that walks the constructors defined in this class.
public  voiddeclare(JFormatter f)
    
protected  voiddeclareBody(JFormatter f)
     prints the body of a class.
public  voiddirect(String string)
     Places the given string directly inside the generated class.
public  JEnumConstantenumConstant(String name)
     If the named enum already exists, the reference to it is returned.
public  JFieldVarfield(int mods, JType type, String name)
     Adds a field to the list of field members of this JDefinedClass.
public  JFieldVarfield(int mods, Class type, String name)
    
public  JFieldVarfield(int mods, JType type, String name, JExpression init)
     Adds a field to the list of field members of this JDefinedClass.
Parameters:
  mods - Modifiers for this field.
Parameters:
  type - JType of this field.
Parameters:
  name - Name of this field.
Parameters:
  init - Initial value of this field.
public  JFieldVarfield(int mods, Class type, String name, JExpression init)
    
public  Map<String, JFieldVar>fields()
     Returns all the fields declred in this class.
public  StringfullName()
     Gets the fully qualified name of this class.
public  JTypeVargenerify(String name)
    
public  JTypeVargenerify(String name, Class bound)
    
public  JTypeVargenerify(String name, JClass bound)
    
public  ClassTypegetClassType()
    
public  JMethodgetConstructor(JType[] argTypes)
     Looks for a method that has the specified method signature and return it.
public  JMethodgetMethod(String name, JType[] argTypes)
     Looks for a method that has the specified method signature and return it.
public  JPackagegetPackage()
    
public  voidhide()
     Mark this file as hidden, so that this file won't be generated.
public  JBlockinit()
     Creates, if necessary, and returns the static initializer for this class.
public  booleanisAbstract()
    
public  booleanisAnnotationTypeDeclaration()
    
final public  booleanisAnonymous()
     Returns true if this is an anonymous class.
public  booleanisClass()
    
public  booleanisHidden()
    
public  booleanisInterface()
    
public  booleanisPackage()
    
public  JDocCommentjavadoc()
    
final public  JClass[]listClasses()
     Returns all the nested classes defined in this class.
public  JMethodmethod(int mods, JType type, String name)
     Add a method to the list of method members of this JDefinedClass instance.
public  JMethodmethod(int mods, Class type, String name)
    
public  Collection<JMethod>methods()
     Returns the set of methods defined in this class.
public  Stringname()
     JClass name accessor.
public  JClassouter()
    
final public  JClassContainerparentContainer()
    
public  voidremoveField(JFieldVar field)
     Removes a JFieldVar from this class.
throws:
  IllegalArgumentException - if the given field is not a field on this class.
protected  JClasssubstituteParams(JTypeVar[] variables, List<JClass> bindings)
    
public  JTypeVar[]typeParams()
    

Field Detail
fields
final Map<String, JFieldVar> fields(Code)
Fields keyed by their names.



metadata
public Object metadata(Code)
Client-app spcific metadata associated with this user-created class.




Constructor Detail
JDefinedClass
JDefinedClass(JClassContainer parent, int mods, String name, ClassType classTypeval)(Code)



JDefinedClass
JDefinedClass(JCodeModel owner, int mods, String name)(Code)
Constructor for creating anonymous inner class.




Method Detail
_annotationTypeDeclaration
public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException(Code)
Add an annotationType Declaration to this package
Parameters:
  name - Name of the annotation Type declaration to be added to this packagenewly created Annotation Type Declaration
exception:
  JClassAlreadyExistsException - When the specified class/interface was already created.



_class
public JDefinedClass _class(int mods, String name) throws JClassAlreadyExistsException(Code)
Add a new nested class to this class.
Parameters:
  mods - Modifiers for this class declaration
Parameters:
  name - Name of class to be added to this package Newly generated class



_class
public JDefinedClass _class(int mods, String name, boolean isInterface) throws JClassAlreadyExistsException(Code)



_class
public JDefinedClass _class(int mods, String name, ClassType classTypeVal) throws JClassAlreadyExistsException(Code)



_class
public JDefinedClass _class(String name) throws JClassAlreadyExistsException(Code)
Add a new public nested class to this class.



_enum
public JDefinedClass _enum(String name) throws JClassAlreadyExistsException(Code)
Add a public enum to this package
Parameters:
  name - Name of the enum to be added to this packagenewly created Enum
exception:
  JClassAlreadyExistsException - When the specified class/interface was already created.



_enum
public JDefinedClass _enum(int mods, String name) throws JClassAlreadyExistsException(Code)
Add a public enum to this package
Parameters:
  name - Name of the enum to be added to this package
Parameters:
  mods - Modifiers for this enum declarationnewly created Enum
exception:
  JClassAlreadyExistsException - When the specified class/interface was already created.



_extends
public JDefinedClass _extends(JClass superClass)(Code)
This class extends the specifed class.
Parameters:
  superClass - Superclass for this class This class



_extends
public JDefinedClass _extends(Class superClass)(Code)



_extends
public JClass _extends()(Code)
Returns the class extended by this class.



_implements
public JDefinedClass _implements(JClass iface)(Code)
This class implements the specifed interface.
Parameters:
  iface - Interface that this class implements This class



_implements
public JDefinedClass _implements(Class iface)(Code)



_implements
public Iterator<JClass> _implements()(Code)
Returns an iterator that walks the nested classes defined in this class.



_interface
public JDefinedClass _interface(int mods, String name) throws JClassAlreadyExistsException(Code)
Add an interface to this package.
Parameters:
  mods - Modifiers for this interface declaration
Parameters:
  name - Name of interface to be added to this package Newly generated interface



_interface
public JDefinedClass _interface(String name) throws JClassAlreadyExistsException(Code)
Adds a public interface to this package.



_package
final public JPackage _package()(Code)



annotate
public JAnnotationUse annotate(Class<? extends Annotation> clazz)(Code)
Adding ability to annotate a class
Parameters:
  clazz - The annotation class to annotate the class with



annotate
public JAnnotationUse annotate(JClass clazz)(Code)
Adding ability to annotate a class
Parameters:
  clazz - The annotation class to annotate the class with



annotate2
public W annotate2(Class<W> clazz)(Code)



binaryName
public String binaryName()(Code)



classes
final public Iterator<JDefinedClass> classes()(Code)
Returns an iterator that walks the nested classes defined in this class.



constructor
public JMethod constructor(int mods)(Code)
Adds a constructor to this class.
Parameters:
  mods - Modifiers for this constructor



constructors
public Iterator constructors()(Code)
Returns an iterator that walks the constructors defined in this class.



declare
public void declare(JFormatter f)(Code)



declareBody
protected void declareBody(JFormatter f)(Code)
prints the body of a class.



direct
public void direct(String string)(Code)
Places the given string directly inside the generated class. This method can be used to add methods/fields that are not generated by CodeModel. This method should be used only as the last resort.



enumConstant
public JEnumConstant enumConstant(String name)(Code)
If the named enum already exists, the reference to it is returned. Otherwise this method generates a new enum reference with the given name and returns it.
Parameters:
  name - The name of the constant.The generated type-safe enum constant.



field
public JFieldVar field(int mods, JType type, String name)(Code)
Adds a field to the list of field members of this JDefinedClass.
Parameters:
  mods - Modifiers for this field
Parameters:
  type - JType of this field
Parameters:
  name - Name of this field Newly generated field



field
public JFieldVar field(int mods, Class type, String name)(Code)



field
public JFieldVar field(int mods, JType type, String name, JExpression init)(Code)
Adds a field to the list of field members of this JDefinedClass.
Parameters:
  mods - Modifiers for this field.
Parameters:
  type - JType of this field.
Parameters:
  name - Name of this field.
Parameters:
  init - Initial value of this field. Newly generated field



field
public JFieldVar field(int mods, Class type, String name, JExpression init)(Code)



fields
public Map<String, JFieldVar> fields()(Code)
Returns all the fields declred in this class. The returned Map is a read-only live view. always non-null.



fullName
public String fullName()(Code)
Gets the fully qualified name of this class.



generify
public JTypeVar generify(String name)(Code)



generify
public JTypeVar generify(String name, Class bound)(Code)



generify
public JTypeVar generify(String name, JClass bound)(Code)



getClassType
public ClassType getClassType()(Code)



getConstructor
public JMethod getConstructor(JType[] argTypes)(Code)
Looks for a method that has the specified method signature and return it. null if not found.



getMethod
public JMethod getMethod(String name, JType[] argTypes)(Code)
Looks for a method that has the specified method signature and return it. null if not found.



getPackage
public JPackage getPackage()(Code)



hide
public void hide()(Code)
Mark this file as hidden, so that this file won't be generated.

This feature could be used to generate code that refers to class X, without actually generating X.java.




init
public JBlock init()(Code)
Creates, if necessary, and returns the static initializer for this class. JBlock containing initialization statements for this class



isAbstract
public boolean isAbstract()(Code)



isAnnotationTypeDeclaration
public boolean isAnnotationTypeDeclaration()(Code)
This method indicates if the interface is an annotationTypeDeclaration



isAnonymous
final public boolean isAnonymous()(Code)
Returns true if this is an anonymous class.



isClass
public boolean isClass()(Code)



isHidden
public boolean isHidden()(Code)



isInterface
public boolean isInterface()(Code)



isPackage
public boolean isPackage()(Code)



javadoc
public JDocComment javadoc()(Code)
Creates, if necessary, and returns the class javadoc for this JDefinedClass JDocComment containing javadocs for this class



listClasses
final public JClass[] listClasses()(Code)
Returns all the nested classes defined in this class.



method
public JMethod method(int mods, JType type, String name)(Code)
Add a method to the list of method members of this JDefinedClass instance.
Parameters:
  mods - Modifiers for this method
Parameters:
  type - Return type for this method
Parameters:
  name - Name of the method Newly generated JMethod



method
public JMethod method(int mods, Class type, String name)(Code)



methods
public Collection<JMethod> methods()(Code)
Returns the set of methods defined in this class.



name
public String name()(Code)
JClass name accessor.

For example, for java.util.List, this method returns "List"" Name of this class




outer
public JClass outer()(Code)



parentContainer
final public JClassContainer parentContainer()(Code)



removeField
public void removeField(JFieldVar field)(Code)
Removes a JFieldVar from this class.
throws:
  IllegalArgumentException - if the given field is not a field on this class.



substituteParams
protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings)(Code)



typeParams
public JTypeVar[] typeParams()(Code)



Fields inherited from com.sun.codemodel.JClass
final protected static JTypeVar[] EMPTY_ARRAY(Code)(Java Doc)

Methods inherited from com.sun.codemodel.JClass
abstract public JClass _extends()(Code)(Java Doc)
abstract public Iterator<JClass> _implements()(Code)(Java Doc)
abstract public JPackage _package()(Code)(Java Doc)
public JClass array()(Code)(Java Doc)
public JClass boxify()(Code)(Java Doc)
final public JExpression dotclass()(Code)(Java Doc)
public JClass erasure()(Code)(Java Doc)
public void generate(JFormatter f)(Code)(Java Doc)
final public JClass getBaseClass(JClass baseType)(Code)(Java Doc)
final public JClass getBaseClass(Class baseType)(Code)(Java Doc)
public JPrimitiveType getPrimitiveType()(Code)(Java Doc)
public List<JClass> getTypeParameters()(Code)(Java Doc)
abstract public boolean isAbstract()(Code)(Java Doc)
final public boolean isAssignableFrom(JClass derived)(Code)(Java Doc)
abstract public boolean isInterface()(Code)(Java Doc)
final public boolean isParameterized()(Code)(Java Doc)
abstract public String name()(Code)(Java Doc)
public JClass narrow(Class clazz)(Code)(Java Doc)
public JClass narrow(Class... clazz)(Code)(Java Doc)
public JClass narrow(JClass clazz)(Code)(Java Doc)
public JClass narrow(JClass... clazz)(Code)(Java Doc)
public JClass narrow(List<? extends JClass> clazz)(Code)(Java Doc)
public JClass outer()(Code)(Java Doc)
final public JCodeModel owner()(Code)(Java Doc)
void printLink(JFormatter f)(Code)(Java Doc)
final public JInvocation staticInvoke(JMethod method)(Code)(Java Doc)
final public JInvocation staticInvoke(String method)(Code)(Java Doc)
final public JFieldRef staticRef(String field)(Code)(Java Doc)
final public JFieldRef staticRef(JVar field)(Code)(Java Doc)
abstract protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public JTypeVar[] typeParams()(Code)(Java Doc)
public JType unboxify()(Code)(Java Doc)
final public JClass wildcard()(Code)(Java Doc)

Methods inherited from com.sun.codemodel.JType
abstract public JClass array()(Code)(Java Doc)
public String binaryName()(Code)(Java Doc)
abstract public JClass boxify()(Code)(Java Doc)
public int compareTo(Object o)(Code)(Java Doc)
public JType elementType()(Code)(Java Doc)
public JType erasure()(Code)(Java Doc)
abstract public String fullName()(Code)(Java Doc)
public boolean isArray()(Code)(Java Doc)
public boolean isPrimitive()(Code)(Java Doc)
final public boolean isReference()(Code)(Java Doc)
abstract public String name()(Code)(Java Doc)
abstract public JCodeModel owner()(Code)(Java Doc)
public static JPrimitiveType parse(JCodeModel codeModel, String typeName)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
abstract public JType unboxify()(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.