Package org.zkoss.bind.impl
Class ValidationMessagesImpl
- java.lang.Object
-
- org.zkoss.bind.impl.ValidationMessagesImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<java.lang.Object>,java.util.Collection<java.lang.Object>,ValidationMessages
public class ValidationMessagesImpl extends java.lang.Object implements ValidationMessages, java.util.Collection<java.lang.Object>, java.io.Serializable
Collection base implementation ofValidationMessages- Since:
- 6.0.0
- Author:
- dennis
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationMessagesImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Object e)booleanaddAll(java.util.Collection<? extends java.lang.Object> c)voidaddMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)add validation messages to componentvoidaddMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)add validation messages to componentvoidclear()voidclearAllMessages()clear all validation messagevoidclearKeyMessages(java.lang.String key)clear validation message of a special message keyvoidclearKeyMessages(Component comp, java.lang.String key)clear validation message of component and a special message keyvoidclearMessages(Component comp)clear validation message of componentvoidclearMessages(Component comp, java.lang.String attr)clear validation message of componentbooleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)ComponentgetAssociate(java.lang.String key)Returns the first associated component from the given key, if any.Component[]getAssociates(java.lang.String key)Returns all associated components from the given key, if any.java.lang.ObjectgetFieldValue(java.lang.String key)Returns the first field value from the given key, if any.java.lang.ObjectgetFieldValue(Component comp, java.lang.String key)Returns the first field value from the given key and component, if any.java.lang.Object[]getFieldValues(java.lang.String key)Returns all field values from the given key, if any.java.lang.Object[]getFieldValues(Component comp, java.lang.String key)Returns all field values from the given key and component, if any.java.lang.String[]getKeyMessages(java.lang.String key)get validation message of a special keyjava.lang.String[]getKeyMessages(Component comp, java.lang.String key)get validation message of component and a special keyjava.lang.String[]getMessages()get all validation messagesjava.lang.String[]getMessages(Component comp)get validation messages of a componentjava.lang.String[]getMessages(Component comp, java.lang.String attr)get validation messages of a component and special attributebooleanisEmpty()java.util.Iterator<java.lang.Object>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)voidsetMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)set validation messages to component, it will replace previous messagesvoidsetMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)set validation messages to component, it will replace previous messagesintsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
clearMessages
public void clearMessages(Component comp)
Description copied from interface:ValidationMessagesclear validation message of component- Specified by:
clearMessagesin interfaceValidationMessages
-
clearMessages
public void clearMessages(Component comp, java.lang.String attr)
Description copied from interface:ValidationMessagesclear validation message of component- Specified by:
clearMessagesin interfaceValidationMessages
-
clearKeyMessages
public void clearKeyMessages(Component comp, java.lang.String key)
Description copied from interface:ValidationMessagesclear validation message of component and a special message key- Specified by:
clearKeyMessagesin interfaceValidationMessages
-
clearKeyMessages
public void clearKeyMessages(java.lang.String key)
Description copied from interface:ValidationMessagesclear validation message of a special message key- Specified by:
clearKeyMessagesin interfaceValidationMessages
-
clearAllMessages
public void clearAllMessages()
Description copied from interface:ValidationMessagesclear all validation message- Specified by:
clearAllMessagesin interfaceValidationMessages
-
getMessages
public java.lang.String[] getMessages(Component comp, java.lang.String attr)
Description copied from interface:ValidationMessagesget validation messages of a component and special attribute- Specified by:
getMessagesin interfaceValidationMessages- Returns:
- messages. Always not null. Empty if no message in component and attribute
-
getMessages
public java.lang.String[] getMessages(Component comp)
Description copied from interface:ValidationMessagesget validation messages of a component- Specified by:
getMessagesin interfaceValidationMessages- Returns:
- messages. Always not null. Empty if no message of component
-
getMessages
public java.lang.String[] getMessages()
Description copied from interface:ValidationMessagesget all validation messages- Specified by:
getMessagesin interfaceValidationMessages- Returns:
- messages. Always not null. Empty if no messages
-
getKeyMessages
public java.lang.String[] getKeyMessages(Component comp, java.lang.String key)
Description copied from interface:ValidationMessagesget validation message of component and a special key- Specified by:
getKeyMessagesin interfaceValidationMessages- Returns:
- messages. Always not null. Empty if no message of key
-
getKeyMessages
public java.lang.String[] getKeyMessages(java.lang.String key)
Description copied from interface:ValidationMessagesget validation message of a special key- Specified by:
getKeyMessagesin interfaceValidationMessages- Returns:
- messages. Always not null. Empty if no message of key
-
setMessages
public void setMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)
Description copied from interface:ValidationMessagesset validation messages to component, it will replace previous messages- Specified by:
setMessagesin interfaceValidationMessages- Parameters:
comp- the component refers to the messagesattr- the attr refers to the messageskey- the custom key refers to this messages, nullablemessages- the messages
-
setMessages
public void setMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)
Description copied from interface:ValidationMessagesset validation messages to component, it will replace previous messages- Specified by:
setMessagesin interfaceValidationMessages- Parameters:
comp- the component refers to the messagesattr- the attr refers to the messageskey- the custom key refers to this messages, nullablemessages- the messagesvalue- the rejected value
-
addMessages
public void addMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)
Description copied from interface:ValidationMessagesadd validation messages to component- Specified by:
addMessagesin interfaceValidationMessages- Parameters:
comp- the component refers to the messagesattr- the attr refers to the messageskey- the custom key refers to this messages, nullablemessages- the messages
-
addMessages
public void addMessages(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)
Description copied from interface:ValidationMessagesadd validation messages to component- Specified by:
addMessagesin interfaceValidationMessages- Parameters:
comp- the component refers to the messagesattr- the attr refers to the messageskey- the custom key refers to this messages, nullablemessages- the messagesvalue- the rejected value
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String key)
Description copied from interface:ValidationMessagesReturns the first field value from the given key, if any.- Specified by:
getFieldValuein interfaceValidationMessages- Parameters:
key- the custom key refers to this messages, nullable- Returns:
- value. Nullable.
-
getFieldValue
public java.lang.Object getFieldValue(Component comp, java.lang.String key)
Description copied from interface:ValidationMessagesReturns the first field value from the given key and component, if any.- Specified by:
getFieldValuein interfaceValidationMessages- Parameters:
comp- the component refers to the valuekey- the custom key refers to this value, nullable- Returns:
- value. Nullable.
-
getFieldValues
public java.lang.Object[] getFieldValues(java.lang.String key)
Description copied from interface:ValidationMessagesReturns all field values from the given key, if any.- Specified by:
getFieldValuesin interfaceValidationMessages- Parameters:
key- the custom key refers to this messages, nullable- Returns:
- values. Always not null.
-
getFieldValues
public java.lang.Object[] getFieldValues(Component comp, java.lang.String key)
Description copied from interface:ValidationMessagesReturns all field values from the given key and component, if any.- Specified by:
getFieldValuesin interfaceValidationMessages- Parameters:
comp- the component refers to the valuekey- the custom key refers to this value, nullable- Returns:
- values. Always not null.
-
getAssociate
public Component getAssociate(java.lang.String key)
Description copied from interface:ValidationMessagesReturns the first associated component from the given key, if any.- Specified by:
getAssociatein interfaceValidationMessages- Parameters:
key- the custom key refers to this messages, nullable- Returns:
- component. Nullable.
-
getAssociates
public Component[] getAssociates(java.lang.String key)
Description copied from interface:ValidationMessagesReturns all associated components from the given key, if any.- Specified by:
getAssociatesin interfaceValidationMessages- Parameters:
key- the custom key refers to this messages, nullable- Returns:
- components. Always not null.
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<java.lang.Object>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<java.lang.Object>
-
iterator
public java.util.Iterator<java.lang.Object> iterator()
- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Object>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Object>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Object>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Object>
-
add
public boolean add(java.lang.Object e)
- Specified by:
addin interfacejava.util.Collection<java.lang.Object>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<java.lang.Object>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<java.lang.Object>
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Object> c)
- Specified by:
addAllin interfacejava.util.Collection<java.lang.Object>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<java.lang.Object>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<java.lang.Object>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<java.lang.Object>
-
-