Java Doc for _ComponentAttributesMap.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._ComponentAttributesMap

_ComponentAttributesMap
class _ComponentAttributesMap implements Map,Serializable(Code)
A custom implementation of the Map interface, where get and put calls try to access getter/setter methods of an associated UIComponent before falling back to accessing a real Map object.

Some of the behaviours of this class don't really comply with the definitions of the Map class; for example the key parameter to all methods is required to be of type String only, and after clear(), calls to get can return non-null values. However the JSF spec requires that this class behave in the way implemented below. See UIComponent.getAttributes for more details.

The term "property" is used here to refer to real javabean properties on the underlying UIComponent, while "attribute" refers to an entry in the associated Map.
author:
   Manfred Geiler (latest modification by $Author: mbr $)
version:
   $Revision: 518783 $ $Date: 2007-03-15 23:23:53 +0100 (Do, 15 Mrz 2007) $




Constructor Summary
 _ComponentAttributesMap(UIComponent component)
     Create a map backed by the specified component.
 _ComponentAttributesMap(UIComponent component, Map<Object, Object> attributes)
     Create a map backed by the specified component.

Method Summary
public  voidclear()
     Clear all the attributes in this map.
public  booleancontainsKey(Object key)
     Return true if there is an attribute with the specified name, but false if there is a javabean property of that name on the associated UIComponent.

Note that it should be impossible for the attributes map to contain an entry with the same name as a javabean property on the associated UIComponent.
Parameters:
  key - must be a String.

public  booleancontainsValue(Object value)
     Returns true if there is an attribute with the specified value.
public  SetentrySet()
     Return a set of all attributes.
public  booleanequals(Object obj)
     TODO: Document why this method is necessary, and why it doesn't try to compare the _component field.
public  Objectget(Object key)
     In order: get the value of a property of the underlying UIComponent, read an attribute from this map, or evaluate the component's value-binding of the specified name.
Parameters:
  key - must be a String.
 Map<Object, Object>getUnderlyingMap()
     Return the map containing the attributes.
public  inthashCode()
    
public  booleanisEmpty()
     Return true if there are no attributes in this map.
public  Set<Object>keySet()
     Return a set of the keys for all attributes.
public  Objectput(Object key, Object value)
     Store the provided value as a property on the underlying UIComponent, or as an attribute in a Map if no such property exists.
public  voidputAll(Map t)
     Call put(key, value) for each entry in the provided map.
public  Objectremove(Object key)
     Remove the attribute with the specified name.
public  intsize()
     Return the number of attributes in this map.
public  Collection<Object>values()
     Return a collection of the values of all attributes.


Constructor Detail
_ComponentAttributesMap
_ComponentAttributesMap(UIComponent component)(Code)
Create a map backed by the specified component.

This method is expected to be called when a component is first created.




_ComponentAttributesMap
_ComponentAttributesMap(UIComponent component, Map<Object, Object> attributes)(Code)
Create a map backed by the specified component. Attributes already associated with the component are provided in the specified Map class. A reference to the provided map is kept; this object's contents are updated during put calls on this instance.

This method is expected to be called during the "restore view" phase.





Method Detail
clear
public void clear()(Code)
Clear all the attributes in this map. Properties of the underlying UIComponent are not modified.

Note that because the get method can read properties of the UIComponent and evaluate value-bindings, it is possible to have calls to the get method return non-null values immediately after a call to clear.




containsKey
public boolean containsKey(Object key)(Code)
Return true if there is an attribute with the specified name, but false if there is a javabean property of that name on the associated UIComponent.

Note that it should be impossible for the attributes map to contain an entry with the same name as a javabean property on the associated UIComponent.
Parameters:
  key - must be a String. Anything else will cause aClassCastException to be thrown.




containsValue
public boolean containsValue(Object value)(Code)
Returns true if there is an attribute with the specified value. Properties of the underlying UIComponent aren't examined, nor value-bindings.
Parameters:
  value - null is allowed



entrySet
public Set entrySet()(Code)
Return a set of all attributes. Properties of the underlying UIComponent are not included, nor value-bindings.



equals
public boolean equals(Object obj)(Code)
TODO: Document why this method is necessary, and why it doesn't try to compare the _component field.



get
public Object get(Object key)(Code)
In order: get the value of a property of the underlying UIComponent, read an attribute from this map, or evaluate the component's value-binding of the specified name.
Parameters:
  key - must be a String. Any other type will cause ClassCastException.



getUnderlyingMap
Map<Object, Object> getUnderlyingMap()(Code)
Return the map containing the attributes.

This method is package-scope so that the UIComponentBase class can access it directly when serializing the component.




hashCode
public int hashCode()(Code)



isEmpty
public boolean isEmpty()(Code)
Return true if there are no attributes in this map. Properties of the underlying UIComponent are not counted.

Note that because the get method can read properties of the UIComponent and evaluate value-bindings, it is possible to have isEmpty return true, while calls to the get method return non-null values.




keySet
public Set<Object> keySet()(Code)
Return a set of the keys for all attributes. Properties of the underlying UIComponent are not included, nor value-bindings.



put
public Object put(Object key, Object value)(Code)
Store the provided value as a property on the underlying UIComponent, or as an attribute in a Map if no such property exists. Value-bindings associated with the component are ignored; to write to a value-binding, the value-binding must be explicitly retrieved from the component and evaluated.

Note that this method is different from the get method, which does read from a value-binding if one exists. When a value-binding exists for a non-property, putting a value here essentially "masks" the value-binding until that attribute is removed.

The put method is expected to return the previous value of the property/attribute (if any). Because UIComponent property getter methods typically try to evaluate any value-binding expression of the same name this can cause an EL expression to be evaluated, thus invoking a getter method on the user's model. This is fine when the returned value will be used; Unfortunately this is quite pointless when initialising a freshly created component with whatever attributes were specified in the view definition (eg JSP tag attributes). Because the UIComponent.getAttributes method only returns a Map class and this class must be package-private, there is no way of exposing a "putNoReturn" type method.
Parameters:
  key - String, null is not allowed
Parameters:
  value - null is allowed




putAll
public void putAll(Map t)(Code)
Call put(key, value) for each entry in the provided map.



remove
public Object remove(Object key)(Code)
Remove the attribute with the specified name. An attempt to remove an entry whose name is that of a property on the underlying UIComponent will cause an IllegalArgumentException. Value-bindings for the underlying component are ignored.
Parameters:
  key - must be a String. Any other type will cause ClassCastException.



size
public int size()(Code)
Return the number of attributes in this map. Properties of the underlying UIComponent are not counted.

Note that because the get method can read properties of the UIComponent and evaluate value-bindings, it is possible to have size return zero while calls to the get method return non-null values.




values
public Collection<Object> values()(Code)
Return a collection of the values of all attributes. Property values are not included, nor value-bindings.



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.