Java Doc for UIComponentBase.java in  » J2EE » myfaces-core-1.2.0 » javax » faces » component » 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 » J2EE » myfaces core 1.2.0 » javax.faces.component 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.faces.component.UIComponent
      javax.faces.component.UIComponentBase

All known Subclasses:   javax.faces.component.UIPanel,  javax.faces.component.UIColumn,  javax.faces.component.UISelectItems,  javax.faces.component.UIParameter,  javax.faces.component.UIForm,  javax.faces.component.UISelectItem,  javax.faces.component.UICommand,  javax.faces.component.UINamingContainer,  javax.faces.component.UIOutput,  javax.faces.component.UIData,  javax.faces.component.UIMessages,  javax.faces.component.UIGraphic,  javax.faces.component.UIViewRoot,  javax.faces.component.UIMessage,
UIComponentBase
abstract public class UIComponentBase extends UIComponent (Code)
Standard implementation of the UIComponent base class; all standard JSF components extend this class.

Disclaimer: The official definition for the behaviour of this class is the JSF 1.1 specification but for legal reasons the specification cannot be replicated here. Any javadoc here therefore describes the current implementation rather than the spec, though this class has been verified as correctly implementing the spec. see Javadoc of JSF Specification for more.
author:
   Manfred Geiler (latest modification by $Author: mbr $)
version:
   $Revision: 519178 $ $Date: 2007-03-17 00:19:41 +0100 (Sa, 17 Mrz 2007) $




Constructor Summary
public  UIComponentBase()
    

Method Summary
protected  voidaddFacesListener(FacesListener listener)
    
public  voidbroadcast(FacesEvent event)
     Invoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type.

This method does not propagate the event up to parent components, ie listeners attached to parent components don't automatically get called.

If any of the listeners throws AbortProcessingException then that exception will prevent any further listener callbacks from occurring, and the exception propagates out of this method without alteration.

ActionEvent events are typically queued by the renderer associated with this component in its decode method; ValueChangeEvent events by the component's validate method.

public  voiddecode(FacesContext context)
     Check the submitted form parameters for data associated with this component.
public  voidencodeBegin(FacesContext context)
    
public  voidencodeChildren(FacesContext context)
    
public  voidencodeEnd(FacesContext context)
    
public  UIComponentfindComponent(String expr)
     Standard method for finding other components by id, inherited by most UIComponent objects.

The lookup is performed in a manner similar to finding a file in a filesystem; there is a "base" at which to start, and the id can be for something in the "local directory", or can include a relative path.

public  Map<String, Object>getAttributes()
     Get a map through which all the UIComponent's properties, value-bindings and non-property attributes can be read and written.

When writing to the returned map:

  • If this component has an explicit property for the specified key then the setter method is called.
public  intgetChildCount()
     Return the number of direct child components this component has.
public  List<UIComponent>getChildren()
     Return a list of the UIComponent objects which are direct children of this component.

The list object returned has some non-standard behaviour:

  • The list is type-checked; only UIComponent objects can be added.
  • If a component is added to the list with an id which is the same as some other component in the list then an exception is thrown.
public  StringgetClientId(FacesContext context)
     Get a string which can be output to the response which uniquely identifies this UIComponent within the current view.

The component should have an id attribute already assigned to it; however if the id property is currently null then a unique id is generated and set for this component.

 TgetExpressionValue(String attribute, T explizitValue, T defaultValueIfExpressionNull)
    
protected  FacesContextgetFacesContext()
    
protected  FacesListener[]getFacesListeners(Class clazz)
    
public  UIComponentgetFacet(String name)
    
public  intgetFacetCount()
    
public  Map<String, UIComponent>getFacets()
    
public  Iterator<UIComponent>getFacetsAndChildren()
    
public  StringgetId()
     Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer component.
public  UIComponentgetParent()
    
protected  RenderergetRenderer(FacesContext context)
    
public  StringgetRendererType()
    
public  booleangetRendersChildren()
     Indicates whether this component or its renderer manages the invocation of the rendering methods of its child components. When this is true:
  • This component's encodeBegin method will only be called after all the child components have been created and added to this component.
  • This component's encodeChildren method will be called after its encodeBegin method.
public  ValueBindinggetValueBinding(String name)
     Get the named value-binding associated with this component.
public  booleaninvokeOnComponent(FacesContext context, String clientId, ContextCallback callback)
     invokeOnComponent must be implemented in UIComponentBase too...
public  booleanisRendered()
    
public  booleanisTransient()
    
public  voidprocessDecodes(FacesContext context)
    
public  voidprocessRestoreState(FacesContext context, Object state)
    
public  ObjectprocessSaveState(FacesContext context)
    
public  voidprocessUpdates(FacesContext context)
     This isn't an input component, so just pass on the processUpdates call to child components and facets that might be input components.
public  voidprocessValidators(FacesContext context)
    
public  voidqueueEvent(FacesEvent event)
    
protected  voidremoveFacesListener(FacesListener listener)
    
public static  ObjectrestoreAttachedState(FacesContext context, Object stateObj)
    
public  voidrestoreState(FacesContext context, Object state)
     Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.
public static  ObjectsaveAttachedState(FacesContext context, Object attachedObject)
     Serializes objects which are "attached" to this component but which are not UIComponent children of it.
public  ObjectsaveState(FacesContext context)
     Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.
public  voidsetId(String id)
     Set an identifier for this component which is unique within the scope of the nearest ancestor NamingContainer component.
public  voidsetParent(UIComponent parent)
    
public  voidsetRendered(boolean rendered)
    
public  voidsetRendererType(String rendererType)
    
public  voidsetTransient(boolean transientFlag)
    
public  voidsetValueBinding(String name, ValueBinding binding)
     Put the provided value-binding into a map of value-bindings associated with this component.


Constructor Detail
UIComponentBase
public UIComponentBase()(Code)




Method Detail
addFacesListener
protected void addFacesListener(FacesListener listener)(Code)



broadcast
public void broadcast(FacesEvent event) throws AbortProcessingException(Code)
Invoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type.

This method does not propagate the event up to parent components, ie listeners attached to parent components don't automatically get called.

If any of the listeners throws AbortProcessingException then that exception will prevent any further listener callbacks from occurring, and the exception propagates out of this method without alteration.

ActionEvent events are typically queued by the renderer associated with this component in its decode method; ValueChangeEvent events by the component's validate method. In either case the event's source property references a component. At some later time the UIViewRoot component iterates over its queued events and invokes the broadcast method on each event's source object.
Parameters:
  event - must not be null.




decode
public void decode(FacesContext context)(Code)
Check the submitted form parameters for data associated with this component. This default implementation delegates to this component's renderer if there is one, and otherwise ignores the call.



encodeBegin
public void encodeBegin(FacesContext context) throws IOException(Code)



encodeChildren
public void encodeChildren(FacesContext context) throws IOException(Code)



encodeEnd
public void encodeEnd(FacesContext context) throws IOException(Code)



findComponent
public UIComponent findComponent(String expr)(Code)
Standard method for finding other components by id, inherited by most UIComponent objects.

The lookup is performed in a manner similar to finding a file in a filesystem; there is a "base" at which to start, and the id can be for something in the "local directory", or can include a relative path. Here, NamingContainer components fill the role of directories, and ":" is the "path separator". Note, however, that although components have a strict parent/child hierarchy, component ids are only prefixed ("namespaced") with the id of their parent when the parent is a NamingContainer.

The base node at which the search starts is determined as follows:

  • When expr starts with ':', the search starts with the root component of the tree that this component is in (ie the ancestor whose parent is null).
  • Otherwise, if this component is a NamingContainer then the search starts with this component.
  • Otherwise, the search starts from the nearest ancestor NamingContainer (or the root component if there is no NamingContainer ancestor).

Parameters:
  expr - is of form "id1:id2:id3". UIComponent or null if no component with the specified id isfound.



getAttributes
public Map<String, Object> getAttributes()(Code)
Get a map through which all the UIComponent's properties, value-bindings and non-property attributes can be read and written.

When writing to the returned map:

  • If this component has an explicit property for the specified key then the setter method is called. An IllegalArgumentException is thrown if the property is read-only. If the property is readable then the old value is returned, otherwise null is returned.
  • Otherwise the key/value pair is stored in a map associated with the component.
Note that value-bindings are not written by put calls to this map. Writing to the attributes map using a key for which a value-binding exists will just store the value in the attributes map rather than evaluating the binding, effectively "hiding" the value-binding from later attributes.get calls. Setter methods on components commonly do not evaluate a binding of the same name; they just store the provided value directly on the component.

When reading from the returned map:

  • If this component has an explicit property for the specified key then the getter method is called. If the property exists, but is read-only (ie only a setter method is defined) then an IllegalArgumentException is thrown.
  • If the attribute map associated with the component has an entry with the specified key, then that is returned.
  • If this component has a value-binding for the specified key, then the value-binding is evaluated to fetch the value.
  • Otherwise, null is returned.
Note that components commonly define getter methods such that they evaluate a value-binding of the same name if there isn't yet a local property.

Assigning values to the map which are not explicit properties on the underlying component can be used to "tunnel" attributes from the JSP tag (or view-specific equivalent) to the associated renderer without modifying the component itself.

Any value-bindings and non-property attributes stored in this map are automatically serialized along with the component when the view is serialized.




getChildCount
public int getChildCount()(Code)
Return the number of direct child components this component has.

Identical to getChildren().size() except that when this component has no children this method will not force an empty list to be created.




getChildren
public List<UIComponent> getChildren()(Code)
Return a list of the UIComponent objects which are direct children of this component.

The list object returned has some non-standard behaviour:

  • The list is type-checked; only UIComponent objects can be added.
  • If a component is added to the list with an id which is the same as some other component in the list then an exception is thrown. However multiple components with a null id may be added.
  • The component's parent property is set to this component. If the component already had a parent, then the component is first removed from its original parent's child list.



getClientId
public String getClientId(FacesContext context)(Code)
Get a string which can be output to the response which uniquely identifies this UIComponent within the current view.

The component should have an id attribute already assigned to it; however if the id property is currently null then a unique id is generated and set for this component. This only happens when components are programmatically created without ids, as components created by a ViewHandler should be assigned ids when they are created.

If this component is a descendant of a NamingContainer then the client id is of form "{namingContainerId}:{componentId}". Note that the naming container's id may itself be of compound form if it has an ancestor naming container. Note also that this only applies to naming containers; other UIComponent types in the component's ancestry do not affect the clientId.

Finally the renderer associated with this component is asked to convert the id into a suitable form. This allows escaping of any characters in the clientId which are significant for the markup language generated by that renderer.




getExpressionValue
T getExpressionValue(String attribute, T explizitValue, T defaultValueIfExpressionNull)(Code)



getFacesContext
protected FacesContext getFacesContext()(Code)



getFacesListeners
protected FacesListener[] getFacesListeners(Class clazz)(Code)



getFacet
public UIComponent getFacet(String name)(Code)



getFacetCount
public int getFacetCount()(Code)

since:
   1.2



getFacets
public Map<String, UIComponent> getFacets()(Code)



getFacetsAndChildren
public Iterator<UIComponent> getFacetsAndChildren()(Code)



getId
public String getId()(Code)
Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer component. The id is not necessarily unique across all components in the current view.



getParent
public UIComponent getParent()(Code)



getRenderer
protected Renderer getRenderer(FacesContext context)(Code)



getRendererType
public String getRendererType()(Code)



getRendersChildren
public boolean getRendersChildren()(Code)
Indicates whether this component or its renderer manages the invocation of the rendering methods of its child components. When this is true:
  • This component's encodeBegin method will only be called after all the child components have been created and added to this component.
  • This component's encodeChildren method will be called after its encodeBegin method. Components for which this method returns false do not get this method invoked at all.
  • No rendering methods will be called automatically on child components; this component is required to invoke the encodeBegin/encodeEnd/etc on them itself.



getValueBinding
public ValueBinding getValueBinding(String name)(Code)
Get the named value-binding associated with this component.

Value-bindings are stored in a map associated with the component, though there is commonly a property (setter/getter methods) of the same name defined on the component itself which evaluates the value-binding when called.




invokeOnComponent
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException(Code)
invokeOnComponent must be implemented in UIComponentBase too...



isRendered
public boolean isRendered()(Code)



isTransient
public boolean isTransient()(Code)



processDecodes
public void processDecodes(FacesContext context)(Code)



processRestoreState
public void processRestoreState(FacesContext context, Object state)(Code)



processSaveState
public Object processSaveState(FacesContext context)(Code)



processUpdates
public void processUpdates(FacesContext context)(Code)
This isn't an input component, so just pass on the processUpdates call to child components and facets that might be input components.

Components that were never rendered can't possibly be receiving update data (no corresponding fields were ever put into the response) so if this component is not rendered then this method does not invoke processUpdates on its children.




processValidators
public void processValidators(FacesContext context)(Code)



queueEvent
public void queueEvent(FacesEvent event)(Code)



removeFacesListener
protected void removeFacesListener(FacesListener listener)(Code)



restoreAttachedState
public static Object restoreAttachedState(FacesContext context, Object stateObj) throws IllegalStateException(Code)



restoreState
public void restoreState(FacesContext context, Object state)(Code)
Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.


Parameters:
  state - is an object previously returned bythe saveState method of this class.




saveAttachedState
public static Object saveAttachedState(FacesContext context, Object attachedObject)(Code)
Serializes objects which are "attached" to this component but which are not UIComponent children of it. Examples are validator and listener objects. To be precise, it returns an object which implements java.io.Serializable, and which when serialized will persist the state of the provided object.

If the attachedObject is a List then every object in the list is saved via a call to this method, and the returned wrapper object contains a List object.

If the object implements StateHolder then the object's saveState is called immediately, and a wrapper is returned which contains both this saved state and the original class name. However in the case where the StateHolder.isTransient method returns true, null is returned instead.

If the object implements java.io.Serializable then the object is simply returned immediately; standard java serialization will later be used to store this object.

In all other cases, a wrapper is returned which simply stores the type of the provided object. When deserialized, a default instance of that type will be recreated.




saveState
public Object saveState(FacesContext context)(Code)
Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.



setId
public void setId(String id)(Code)
Set an identifier for this component which is unique within the scope of the nearest ancestor NamingContainer component. The id is not necessarily unique across all components in the current view.

The id must start with an underscore if it is generated by the JSF framework, and must not start with an underscore if it has been specified by the user (eg in a JSP tag).

The first character of the id must be an underscore or letter. Following characters may be letters, digits, underscores or dashes.

Null is allowed as a parameter, and will reset the id to null.

The clientId of this component is reset by this method; see getClientId for more info.
throws:
  IllegalArgumentException - if the id is not valid.




setParent
public void setParent(UIComponent parent)(Code)



setRendered
public void setRendered(boolean rendered)(Code)



setRendererType
public void setRendererType(String rendererType)(Code)



setTransient
public void setTransient(boolean transientFlag)(Code)



setValueBinding
public void setValueBinding(String name, ValueBinding binding)(Code)
Put the provided value-binding into a map of value-bindings associated with this component.



Fields inherited from javax.faces.component.UIComponent
protected Map<String, ValueExpression> bindings(Code)(Java Doc)

Methods inherited from javax.faces.component.UIComponent
abstract protected void addFacesListener(javax.faces.event.FacesListener listener)(Code)(Java Doc)
abstract public void broadcast(javax.faces.event.FacesEvent event) throws AbortProcessingException(Code)(Java Doc)
abstract public void decode(javax.faces.context.FacesContext context)(Code)(Java Doc)
public void encodeAll(javax.faces.context.FacesContext context) throws java.io.IOException(Code)(Java Doc)
abstract public void encodeBegin(javax.faces.context.FacesContext context) throws java.io.IOException(Code)(Java Doc)
abstract public void encodeChildren(javax.faces.context.FacesContext context) throws java.io.IOException(Code)(Java Doc)
abstract public void encodeEnd(javax.faces.context.FacesContext context) throws java.io.IOException(Code)(Java Doc)
abstract public javax.faces.component.UIComponent findComponent(java.lang.String expr)(Code)(Java Doc)
abstract public java.util.Map<String, Object> getAttributes()(Code)(Java Doc)
abstract public int getChildCount()(Code)(Java Doc)
abstract public java.util.List<UIComponent> getChildren()(Code)(Java Doc)
abstract public java.lang.String getClientId(javax.faces.context.FacesContext context)(Code)(Java Doc)
public String getContainerClientId(FacesContext ctx)(Code)(Java Doc)
abstract protected javax.faces.context.FacesContext getFacesContext()(Code)(Java Doc)
abstract protected javax.faces.event.FacesListener[] getFacesListeners(java.lang.Class clazz)(Code)(Java Doc)
abstract public javax.faces.component.UIComponent getFacet(java.lang.String name)(Code)(Java Doc)
public int getFacetCount()(Code)(Java Doc)
abstract public java.util.Map<String, UIComponent> getFacets()(Code)(Java Doc)
abstract public java.util.Iterator<UIComponent> getFacetsAndChildren()(Code)(Java Doc)
abstract public java.lang.String getFamily()(Code)(Java Doc)
abstract public java.lang.String getId()(Code)(Java Doc)
abstract public javax.faces.component.UIComponent getParent()(Code)(Java Doc)
abstract protected javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)(Code)(Java Doc)
abstract public java.lang.String getRendererType()(Code)(Java Doc)
abstract public boolean getRendersChildren()(Code)(Java Doc)
abstract public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)(Code)(Java Doc)
public ValueExpression getValueExpression(String name)(Code)(Java Doc)
public boolean invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback) throws javax.faces.FacesException(Code)(Java Doc)
abstract public boolean isRendered()(Code)(Java Doc)
abstract public void processDecodes(javax.faces.context.FacesContext context)(Code)(Java Doc)
abstract public void processRestoreState(javax.faces.context.FacesContext context, java.lang.Object state)(Code)(Java Doc)
abstract public java.lang.Object processSaveState(javax.faces.context.FacesContext context)(Code)(Java Doc)
abstract public void processUpdates(javax.faces.context.FacesContext context)(Code)(Java Doc)
abstract public void processValidators(javax.faces.context.FacesContext context)(Code)(Java Doc)
abstract public void queueEvent(javax.faces.event.FacesEvent event)(Code)(Java Doc)
abstract protected void removeFacesListener(javax.faces.event.FacesListener listener)(Code)(Java Doc)
abstract public void setId(java.lang.String id)(Code)(Java Doc)
abstract public void setParent(javax.faces.component.UIComponent parent)(Code)(Java Doc)
abstract public void setRendered(boolean rendered)(Code)(Java Doc)
abstract public void setRendererType(java.lang.String rendererType)(Code)(Java Doc)
abstract public void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)(Code)(Java Doc)
public void setValueExpression(String name, ValueExpression expression)(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.