Java Doc for BeansUnit.java in  » IDE-Netbeans » visualweb.api.designer » org » netbeans » modules » visualweb » insync » beans » 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 » IDE Netbeans » visualweb.api.designer » org.netbeans.modules.visualweb.insync.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.visualweb.insync.beans.BeansUnit

All known Subclasses:   org.netbeans.modules.visualweb.insync.faces.FacesUnit,
BeansUnit
public class BeansUnit implements Unit(Code)
An abstract compilation Unit that represents a single outer (or 'this' or 'root') JavaBean class under construction. Within this Unit will be instance Beans, as well as event handling methods.
author:
   cquinn


Field Summary
protected  BeanStructureScannerbeanStructureScanner
    
final protected  List<Bean>beans
    
protected  List<Bean>beansToAdd
    
protected  List<Bean>beansToRemove
    
protected  ClassLoaderclassLoader
    
protected  ParserAnnotationerror
    
protected  JavaClassjavaClass
    
protected  JavaUnitjunit
    
protected  Modelmodel
    
final protected  MapnameCounters
    
protected  StringpackageName
    
protected  booleansyncedSinceConstructed
    

Constructor Summary
public  BeansUnit(JavaUnit junit, ClassLoader cl, String packageName, Model model)
    

Method Summary
final public  BeanaddBean(BeanInfo beanInfo, Bean parent, String name, String facet, Position pos)
     Create and add a new bean to an existing parent.
final public  voidaddBindingBean(String name)
     Create binding bean in java source.
public  voidaddXRefAccessor(String bname, String type)
     Ensures that a cross-reference accessor to a sibling bean is in place.
protected  voidbind()
    
protected  BeanbindBean(String name, List<String> typeNames)
    
protected  voidbindBeanParents()
    
protected  voidbindBeans()
     Scan all the fields of the host class and attempt to bind each to a new bean, updating our beans list as we go.
protected  voidbindEventSets(List<Statement> stmts)
    
protected  voidbindProperties(List<Statement> stmts)
    
public  booleancanCreateBean(BeanInfo bi, Bean parent)
    
public  voiddestroy()
    
public  voiddumpTo(PrintWriter w)
    
public  EventMethodensureEventMethod(MethodDescriptor md, String name, String defaultBody, String[] parameterNames, String[] requiredImports)
     Add as needed an event method with a given name and event type, and return type.
public  voidensureImportForType(String type)
     Use the junit method to enure that we have an import for this type so that the identifier can use its short form.
protected  BeanfirstBeanOfType(Bean bean, Class type)
    
protected  BeanfirstBeanOfType(Bean[] beans, Class type)
    
public  ClassgetBaseBeanClass()
    
public  StringgetBaseBeanClassName()
    
public  BeangetBean(String name)
    
public  ClassgetBeanClass(String type)
     Get the actual class of a bean or supporting object, given its type.
public static  BeanInfogetBeanInfo(Class cls, ClassLoader classLoader)
     Get the BeanInfo given a class for a bean.
Parameters:
  cls - The Class of the bean.
public  BeanInfogetBeanInfo(String type)
     Get the BeanInfo for a bean by type using this unit's class loader.
public  StringgetBeanName()
    
public  BeanStructureScannergetBeanStructureScanner()
     Return my currently active scanner, if a sync has been performed or is not in progress then the result will be null.
public  Bean[]getBeans()
    
public  ClassLoadergetClassLoader()
    
public  MethodgetCleanupMethod()
    
public  ParserAnnotation[]getErrors()
    
public  MethodgetEventMethod(String name, MethodDescriptor md)
    
public  MethodgetInitializerMethod()
    
public  JavaUnitgetJavaUnit()
    
public  ModelgetModel()
    
protected  BeanStructureScannergetNewBeanStructureScanner()
    
public  MethodgetPropertiesInitMethod()
    
public  List<Statement>getPropertiesInitStatements()
    
public  org.w3c.dom.ElementgetRootElement()
    
public  ObjectgetRootInstance()
    
public  StategetState()
    
public  JavaClassgetThisClass()
    
public  StringgetThisClassName()
    
public  StringgetThisPackageName()
    
public  booleanhasEventMethod(MethodDescriptor md, String name)
    
public  ObjectinstantiateBean(Class cls)
     Instantiate a bean (or any object really) given its Class.
protected  booleanisBeanNameAvailable(String name, Bean bean)
    
public  booleanisPageBean()
    
public  booleanisWriteLocked()
    
public  voidmoveBean(Bean bean, Bean newparent, Position pos)
    
protected  BeannewBoundBean(BeanInfo beanInfo, String name, List<String> typeNames)
    
protected  EventSetnewBoundEventSet(Statement stmt)
     Overridable hook to allow subclasses an opportunity to create different kinds of bound event sets.
protected  PropertynewBoundProperty(Statement stmt)
    
protected  BeannewCreatedBean(BeanInfo beanInfo, Bean parent, String name, String facet, Position pos)
    
protected  StringnextAvailableName(String base, Bean bean, boolean alwaysNumber)
    
protected  StringnextNameForType(String type)
     Retrieve the next generated name for a type.
public  voidreadLock()
    
public  voidreadUnlock()
    
final public  voidremoveBean(Bean bean)
    
final public  voidremoveBindingBean(String name)
     Remove binding bean in java source.
protected  voidscan()
    
protected  voidscanName(String type, String name)
     Examine a given type and name to adjust the max ordinal used.
public  voidsetClassLoader(ClassLoader cl)
    
public  booleansync()
     Read the underlying java model and rebuild ourselves if it had changed or we are new.
protected  booleansyncSubUnits()
     Since a unit can be composed of other units, this is where a subclass should add code to sync there sub units.
public  StringtoString()
    
protected  voidupdateName(String type, int index)
    
public  voidwriteLock(UndoEvent event)
    
public  booleanwriteUnlock(UndoEvent event)
    

Field Detail
beanStructureScanner
protected BeanStructureScanner beanStructureScanner(Code)



beans
final protected List<Bean> beans(Code)



beansToAdd
protected List<Bean> beansToAdd(Code)



beansToRemove
protected List<Bean> beansToRemove(Code)



classLoader
protected ClassLoader classLoader(Code)



error
protected ParserAnnotation error(Code)



javaClass
protected JavaClass javaClass(Code)



junit
protected JavaUnit junit(Code)



model
protected Model model(Code)



nameCounters
final protected Map nameCounters(Code)



packageName
protected String packageName(Code)



syncedSinceConstructed
protected boolean syncedSinceConstructed(Code)




Constructor Detail
BeansUnit
public BeansUnit(JavaUnit junit, ClassLoader cl, String packageName, Model model)(Code)
Construct an BeansUnit from an existing source file
Parameters:
  junit - Underlying Java Unit
Parameters:
  cl - Project-wide classloader
Parameters:
  packageName - Package name for this class




Method Detail
addBean
final public Bean addBean(BeanInfo beanInfo, Bean parent, String name, String facet, Position pos)(Code)
Create and add a new bean to an existing parent.
Parameters:
  beanInfo - The definition of the bean to create
Parameters:
  parent - The parent for the new bean
Parameters:
  name - The instance name for the new bean
Parameters:
  facet - The (optional) facet to tag this child within the parent The newly created bean



addBindingBean
final public void addBindingBean(String name)(Code)
Create binding bean in java source. This should be called only to add the binding for a component.
Parameters:
  name - The instance name for the new bean The newly created bean



addXRefAccessor
public void addXRefAccessor(String bname, String type)(Code)
Ensures that a cross-reference accessor to a sibling bean is in place. Accessor method is of the form: public get() { return () getBean(""); }
Parameters:
  bname -
Parameters:
  type -



bind
protected void bind()(Code)
Bind beans & their properties, events and parents



bindBean
protected Bean bindBean(String name, List<String> typeNames)(Code)



bindBeanParents
protected void bindBeanParents()(Code)
Run a pass over the beans to see if they need to do parent-child wiring



bindBeans
protected void bindBeans()(Code)
Scan all the fields of the host class and attempt to bind each to a new bean, updating our beans list as we go. Run a second parent-child wiring pass



bindEventSets
protected void bindEventSets(List<Statement> stmts)(Code)
Scan the init block statements and create matching EventSets and register with their beans



bindProperties
protected void bindProperties(List<Statement> stmts)(Code)



canCreateBean
public boolean canCreateBean(BeanInfo bi, Bean parent)(Code)



destroy
public void destroy()(Code)



dumpTo
public void dumpTo(PrintWriter w)(Code)



ensureEventMethod
public EventMethod ensureEventMethod(MethodDescriptor md, String name, String defaultBody, String[] parameterNames, String[] requiredImports)(Code)
Add as needed an event method with a given name and event type, and return type. Do nothing if the method is already present.
Parameters:
  md - The MethodDescriptor that identifies the method signature+return.
Parameters:
  name - The name of the metod to find or create. The existing or newly created method.



ensureImportForType
public void ensureImportForType(String type)(Code)
Use the junit method to enure that we have an import for this type so that the identifier can use its short form. By default explicit imports are ensured
Parameters:
  type - fully-qualified type name



firstBeanOfType
protected Bean firstBeanOfType(Bean bean, Class type)(Code)

Parameters:
  bean -
Parameters:
  type -



firstBeanOfType
protected Bean firstBeanOfType(Bean[] beans, Class type)(Code)

Parameters:
  beans -
Parameters:
  type -



getBaseBeanClass
public Class getBaseBeanClass()(Code)
the base bean class if the bean is a known managed bean



getBaseBeanClassName
public String getBaseBeanClassName()(Code)
the base bean class name



getBean
public Bean getBean(String name)(Code)

Parameters:
  name -



getBeanClass
public Class getBeanClass(String type) throws ClassNotFoundException(Code)
Get the actual class of a bean or supporting object, given its type. The type may be a primitive and/or it may be an array.
Parameters:
  type - The type retrieve the Class for. The Class that represents the given type.
throws:
  ClassNotFoundException -



getBeanInfo
public static BeanInfo getBeanInfo(Class cls, ClassLoader classLoader)(Code)
Get the BeanInfo given a class for a bean.
Parameters:
  cls - The Class of the bean. The BeanInfo.



getBeanInfo
public BeanInfo getBeanInfo(String type)(Code)
Get the BeanInfo for a bean by type using this unit's class loader.
Parameters:
  type - The fully-qualified bean type name The BeanInfo, or null if not found.



getBeanName
public String getBeanName()(Code)



getBeanStructureScanner
public BeanStructureScanner getBeanStructureScanner()(Code)
Return my currently active scanner, if a sync has been performed or is not in progress then the result will be null.



getBeans
public Bean[] getBeans()(Code)



getClassLoader
public ClassLoader getClassLoader()(Code)



getCleanupMethod
public Method getCleanupMethod()(Code)



getErrors
public ParserAnnotation[] getErrors()(Code)



getEventMethod
public Method getEventMethod(String name, MethodDescriptor md)(Code)
Find an (event) method with a given name
Parameters:
  name -



getInitializerMethod
public Method getInitializerMethod()(Code)
Find the initializer method for the page
Parameters:
  name -



getJavaUnit
public JavaUnit getJavaUnit()(Code)



getModel
public Model getModel()(Code)



getNewBeanStructureScanner
protected BeanStructureScanner getNewBeanStructureScanner()(Code)
Must guarantee to never return null;



getPropertiesInitMethod
public Method getPropertiesInitMethod()(Code)



getPropertiesInitStatements
public List<Statement> getPropertiesInitStatements()(Code)



getRootElement
public org.w3c.dom.Element getRootElement()(Code)



getRootInstance
public Object getRootInstance()(Code)
Get the live instance (if any) for the root live container the live root instance



getState
public State getState()(Code)



getThisClass
public JavaClass getThisClass()(Code)



getThisClassName
public String getThisClassName()(Code)



getThisPackageName
public String getThisPackageName()(Code)



hasEventMethod
public boolean hasEventMethod(MethodDescriptor md, String name)(Code)
Add an event method with a given name and event type, and return type
Parameters:
  md -
Parameters:
  name -



instantiateBean
public Object instantiateBean(Class cls)(Code)
Instantiate a bean (or any object really) given its Class. Handles primitives and arrays by creating default values for them.
Parameters:
  cls - Class to instantiate. The new instance of the given Class.



isBeanNameAvailable
protected boolean isBeanNameAvailable(String name, Bean bean)(Code)

Parameters:
  name - whether or not a given name is available for use as a bean name



isPageBean
public boolean isPageBean()(Code)



isWriteLocked
public boolean isWriteLocked()(Code)



moveBean
public void moveBean(Bean bean, Bean newparent, Position pos)(Code)

Parameters:
  bean -
Parameters:
  newparent -
Parameters:
  pos -



newBoundBean
protected Bean newBoundBean(BeanInfo beanInfo, String name, List<String> typeNames)(Code)
Return a new Bean instance bound to an existing field, getter & setter



newBoundEventSet
protected EventSet newBoundEventSet(Statement stmt)(Code)
Overridable hook to allow subclasses an opportunity to create different kinds of bound event sets.
Parameters:
  s -



newBoundProperty
protected Property newBoundProperty(Statement stmt)(Code)

Parameters:
  s -



newCreatedBean
protected Bean newCreatedBean(BeanInfo beanInfo, Bean parent, String name, String facet, Position pos)(Code)
Return a brand new created Bean instance
Parameters:
  pos - TODO



nextAvailableName
protected String nextAvailableName(String base, Bean bean, boolean alwaysNumber)(Code)
Retrieve the next available name given a base
Parameters:
  base - The base name to use.
Parameters:
  bean - The bean that wants the name--used to ignore for autonumbering
Parameters:
  alwaysNumber - true to always include a number suffix, false to first attempt to use base The next available name from base, returns base itself if no collisions



nextNameForType
protected String nextNameForType(String type)(Code)
Retrieve the next generated name for a type.
Parameters:
  type - The type name of type to gen name for The next generated name for the type.



readLock
public void readLock()(Code)



readUnlock
public void readUnlock()(Code)



removeBean
final public void removeBean(Bean bean)(Code)

Parameters:
  bean -



removeBindingBean
final public void removeBindingBean(String name)(Code)
Remove binding bean in java source. This should be called only to remove the binding for a component.
Parameters:
  name - The instance name for the new bean



scan
protected void scan()(Code)
Scan our underlying document to find or create our tracked items



scanName
protected void scanName(String type, String name)(Code)
Examine a given type and name to adjust the max ordinal used.



setClassLoader
public void setClassLoader(ClassLoader cl)(Code)

Parameters:
  cl -



sync
public boolean sync()(Code)
Read the underlying java model and rebuild ourselves if it had changed or we are new.
See Also:   org.netbeans.modules.visualweb.insync.Unit.sync



syncSubUnits
protected boolean syncSubUnits()(Code)
Since a unit can be composed of other units, this is where a subclass should add code to sync there sub units. In order for my sync to proceed, I must ensure that my sub units are synced successfully. Once they are sync'ed, I can go ahead and sync myself. This method provides the capability of a subclass to add on additional sub-units and have them synced when I am asked to sync. NOTE: Make sure that if ANY of the child units did a sync, this method must return true as I must assume something has changed in that case and continue the sync process.



toString
public String toString()(Code)



updateName
protected void updateName(String type, int index)(Code)
Update the names counter for a given type to be at least as large as a specific ordinal value



writeLock
public void writeLock(UndoEvent event)(Code)



writeUnlock
public boolean writeUnlock(UndoEvent event)(Code)



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.