Method from javax.faces.component.UIComponentBase$AttributesMap Detail: |
public void clear() {
component.getStateHelper().remove(PropertyKeys.attributes);
component.getStateHelper().remove(PropertyKeysPrivate.attributesThatAreSet);
}
|
public boolean containsKey(Object keyObj) {
if (ATTRIBUTES_THAT_ARE_SET_KEY.equals(keyObj)) {
return true;
}
String key = (String) keyObj;
PropertyDescriptor pd =
getPropertyDescriptor(key);
if (pd == null) {
Map< String,Object > attributes = (Map< String,Object >)
component.getStateHelper().get(PropertyKeys.attributes);
if (attributes != null) {
return attributes.containsKey(key);
} else {
return (false);
}
} else {
return (false);
}
}
|
public boolean containsValue(Object value) {
Map attributes= getAttributes();
return (attributes != null && attributes.containsValue(value));
}
|
public Set<String, Object> entrySet() {
Map< String,Object > attributes = getAttributes();
if (attributes != null)
return Collections.unmodifiableSet(attributes.entrySet());
return Collections.emptySet();
}
|
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Map)) {
return false;
}
Map t = (Map) o;
if (t.size() != size()) {
return false;
}
try {
for (Object e : entrySet()) {
Entry entry = (Entry) e;
Object key = entry.getKey();
Object value = entry.getValue();
if (value == null) {
if (!(t.get(key) == null && t.containsKey(key))) {
return false;
}
} else {
if (!value.equals(t.get(key))) {
return false;
}
}
}
} catch (ClassCastException unused) {
return false;
} catch (NullPointerException unused) {
return false;
}
return true;
}
|
public Object get(Object keyObj) {
String key = (String) keyObj;
Object result = null;
if (key == null) {
throw new NullPointerException();
}
if (ATTRIBUTES_THAT_ARE_SET_KEY.equals(key)) {
result = component.getStateHelper().get(UIComponent.PropertyKeysPrivate.attributesThatAreSet);
}
Map< String,Object > attributes = (Map< String,Object >)
component.getStateHelper().get(PropertyKeys.attributes);
if (null == result) {
PropertyDescriptor pd =
getPropertyDescriptor(key);
if (pd != null) {
try {
Method readMethod = pd.getReadMethod();
if (readMethod != null) {
result = (readMethod.invoke(component,
EMPTY_OBJECT_ARRAY));
} else {
throw new IllegalArgumentException(key);
}
} catch (IllegalAccessException e) {
throw new FacesException(e);
} catch (InvocationTargetException e) {
throw new FacesException(e.getTargetException());
}
} else if (attributes != null) {
if (attributes.containsKey(key)) {
result = attributes.get(key);
}
}
}
if (null == result) {
ValueExpression ve = component.getValueExpression(key);
if (ve != null) {
try {
result = ve.getValue(component.getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
}
}
return result;
}
|
PropertyDescriptor getPropertyDescriptor(String name) {
if (pdMap != null) {
return (pdMap.get(name));
}
return (null);
}
Return the PropertyDescriptor for the specified
property name for this UIComponent 's implementation class,
if any; otherwise, return null .
|
public int hashCode() {
int h = 0;
for (Object o : entrySet()) {
h += o.hashCode();
}
return h;
}
|
public boolean isEmpty() {
Map attributes = getAttributes();
return (attributes == null || attributes.isEmpty());
}
|
public Set<String> keySet() {
Map< String,Object > attributes = getAttributes();
if (attributes != null)
return Collections.unmodifiableSet(attributes.keySet());
return Collections.emptySet();
}
|
public Object put(String keyValue,
Object value) {
if (keyValue == null) {
throw new NullPointerException();
}
if (ATTRIBUTES_THAT_ARE_SET_KEY.equals(keyValue)) {
if (component.attributesThatAreSet == null) {
if (value instanceof List) {
component.getStateHelper().put(UIComponent.PropertyKeysPrivate.attributesThatAreSet,
value);
}
}
return null;
}
PropertyDescriptor pd =
getPropertyDescriptor(keyValue);
if (pd != null) {
try {
Object result = null;
Method readMethod = pd.getReadMethod();
if (readMethod != null) {
result = readMethod.invoke
(component, EMPTY_OBJECT_ARRAY);
}
Method writeMethod = pd.getWriteMethod();
if (writeMethod != null) {
writeMethod.invoke
(component, value);
} else {
// TODO: i18n
throw new IllegalArgumentException("Setter not found for property " + keyValue);
}
return (result);
} catch (IllegalAccessException e) {
throw new FacesException(e);
} catch (InvocationTargetException e) {
throw new FacesException
(e.getTargetException());
}
} else {
if (value == null) {
throw new NullPointerException();
}
List< String > sProperties =
(List< String >) component.getStateHelper().get(PropertyKeysPrivate.attributesThatAreSet);
if (sProperties == null) {
component.getStateHelper().add(PropertyKeysPrivate.attributesThatAreSet, keyValue);
} else if (!sProperties.contains(keyValue)) {
component.getStateHelper().add(PropertyKeysPrivate.attributesThatAreSet, keyValue);
}
return putAttribute(keyValue, value);
}
}
|
public void putAll(Map<String, ?> map) {
if (map == null) {
throw new NullPointerException();
}
for (Map.Entry< ? extends String, ? > entry : map.entrySet()) {
this.put(entry.getKey(), entry.getValue());
}
}
|
public Object remove(Object keyObj) {
String key = (String) keyObj;
if (key == null) {
throw new NullPointerException();
}
if (ATTRIBUTES_THAT_ARE_SET_KEY.equals(key)) {
return null;
}
PropertyDescriptor pd =
getPropertyDescriptor(key);
if (pd != null) {
throw new IllegalArgumentException(key);
} else {
Map< String,Object > attributes = getAttributes();
if (attributes != null) {
component.getStateHelper().remove(UIComponent.PropertyKeysPrivate.attributesThatAreSet,
key);
return (component.getStateHelper().remove(PropertyKeys.attributes,
key));
} else {
return null;
}
}
}
|
public int size() {
Map attributes = getAttributes();
return (attributes != null ? attributes.size() : 0);
}
|
public Collection<Object> values() {
Map< String,Object > attributes = getAttributes();
if (attributes != null)
return Collections.unmodifiableCollection(attributes.values());
return Collections.emptyList();
}
|