Package org.zkoss.clientbind
Class ValidationMessagesMonitor
- java.lang.Object
-
- org.zkoss.clientbind.ValidationMessagesMonitor
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<java.lang.String>
,java.util.Collection<java.lang.String>
,ValidationMessages
public class ValidationMessagesMonitor extends java.lang.Object implements ValidationMessages, java.util.Collection<java.lang.String>, java.io.Serializable
A monitor forValidationMessages
to send a notification to client.- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationMessagesMonitor(ClientBindComposer owner, ValidationMessages messages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.String e)
boolean
addAll(java.util.Collection<? extends java.lang.String> c)
void
addMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings)
add validation messages to componentvoid
addMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings, java.lang.Object o)
add validation messages to componentvoid
clear()
void
clearAllMessages()
clear all validation messagevoid
clearKeyMessages(java.lang.String s)
clear validation message of a special message keyvoid
clearKeyMessages(Component component, java.lang.String s)
clear validation message of component and a special message keyvoid
clearMessages(Component component)
clear validation message of componentvoid
clearMessages(Component component, java.lang.String s)
clear validation message of componentboolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
Component
getAssociate(java.lang.String s)
Returns the first associated component from the given key, if any.Component[]
getAssociates(java.lang.String s)
Returns all associated components from the given key, if any.java.lang.Object
getFieldValue(java.lang.String s)
Returns the first field value from the given key, if any.java.lang.Object
getFieldValue(Component component, java.lang.String s)
Returns the first field value from the given key and component, if any.java.lang.Object[]
getFieldValues(java.lang.String s)
Returns all field values from the given key, if any.java.lang.Object[]
getFieldValues(Component component, java.lang.String s)
Returns all field values from the given key and component, if any.java.lang.String[]
getKeyMessages(java.lang.String s)
get validation message of a special keyjava.lang.String[]
getKeyMessages(Component component, java.lang.String s)
get validation message of component and a special keyjava.lang.String[]
getMessages()
get all validation messagesjava.lang.String[]
getMessages(Component component)
get validation messages of a componentjava.lang.String[]
getMessages(Component component, java.lang.String s)
get validation messages of a component and special attributeboolean
isEmpty()
java.util.Iterator<java.lang.String>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
void
setMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings)
set validation messages to component, it will replace previous messagesvoid
setMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings, java.lang.Object o)
set validation messages to component, it will replace previous messagesint
size()
java.lang.String[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
ValidationMessagesMonitor
public ValidationMessagesMonitor(ClientBindComposer owner, ValidationMessages messages)
-
-
Method Detail
-
clearMessages
public void clearMessages(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
clear validation message of component- Specified by:
clearMessages
in interfaceValidationMessages
-
clearMessages
public void clearMessages(Component component)
Description copied from interface:ValidationMessages
clear validation message of component- Specified by:
clearMessages
in interfaceValidationMessages
-
clearKeyMessages
public void clearKeyMessages(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
clear validation message of component and a special message key- Specified by:
clearKeyMessages
in interfaceValidationMessages
-
clearKeyMessages
public void clearKeyMessages(java.lang.String s)
Description copied from interface:ValidationMessages
clear validation message of a special message key- Specified by:
clearKeyMessages
in interfaceValidationMessages
-
clearAllMessages
public void clearAllMessages()
Description copied from interface:ValidationMessages
clear all validation message- Specified by:
clearAllMessages
in interfaceValidationMessages
-
getMessages
public java.lang.String[] getMessages(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
get validation messages of a component and special attribute- Specified by:
getMessages
in interfaceValidationMessages
- Returns:
- messages. Always not null. Empty if no message in component and attribute
-
getMessages
public java.lang.String[] getMessages(Component component)
Description copied from interface:ValidationMessages
get validation messages of a component- Specified by:
getMessages
in interfaceValidationMessages
- Returns:
- messages. Always not null. Empty if no message of component
-
getMessages
public java.lang.String[] getMessages()
Description copied from interface:ValidationMessages
get all validation messages- Specified by:
getMessages
in interfaceValidationMessages
- Returns:
- messages. Always not null. Empty if no messages
-
getKeyMessages
public java.lang.String[] getKeyMessages(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
get validation message of component and a special key- Specified by:
getKeyMessages
in interfaceValidationMessages
- Returns:
- messages. Always not null. Empty if no message of key
-
getKeyMessages
public java.lang.String[] getKeyMessages(java.lang.String s)
Description copied from interface:ValidationMessages
get validation message of a special key- Specified by:
getKeyMessages
in interfaceValidationMessages
- Returns:
- messages. Always not null. Empty if no message of key
-
setMessages
public void setMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings)
Description copied from interface:ValidationMessages
set validation messages to component, it will replace previous messages- Specified by:
setMessages
in interfaceValidationMessages
- Parameters:
component
- the component refers to the messagess
- the attr refers to the messagess1
- the custom key refers to this messages, nullablestrings
- the messages
-
setMessages
public void setMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings, java.lang.Object o)
Description copied from interface:ValidationMessages
set validation messages to component, it will replace previous messages- Specified by:
setMessages
in interfaceValidationMessages
- Parameters:
component
- the component refers to the messagess
- the attr refers to the messagess1
- the custom key refers to this messages, nullablestrings
- the messageso
- the rejected value
-
addMessages
public void addMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings)
Description copied from interface:ValidationMessages
add validation messages to component- Specified by:
addMessages
in interfaceValidationMessages
- Parameters:
component
- the component refers to the messagess
- the attr refers to the messagess1
- the custom key refers to this messages, nullablestrings
- the messages
-
addMessages
public void addMessages(Component component, java.lang.String s, java.lang.String s1, java.lang.String[] strings, java.lang.Object o)
Description copied from interface:ValidationMessages
add validation messages to component- Specified by:
addMessages
in interfaceValidationMessages
- Parameters:
component
- the component refers to the messagess
- the attr refers to the messagess1
- the custom key refers to this messages, nullablestrings
- the messageso
- the rejected value
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String s)
Description copied from interface:ValidationMessages
Returns the first field value from the given key, if any.- Specified by:
getFieldValue
in interfaceValidationMessages
- Parameters:
s
- the custom key refers to this messages, nullable- Returns:
- value. Nullable.
-
getFieldValue
public java.lang.Object getFieldValue(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
Returns the first field value from the given key and component, if any.- Specified by:
getFieldValue
in interfaceValidationMessages
- Parameters:
component
- the component refers to the values
- the custom key refers to this value, nullable- Returns:
- value. Nullable.
-
getFieldValues
public java.lang.Object[] getFieldValues(java.lang.String s)
Description copied from interface:ValidationMessages
Returns all field values from the given key, if any.- Specified by:
getFieldValues
in interfaceValidationMessages
- Parameters:
s
- the custom key refers to this messages, nullable- Returns:
- values. Always not null.
-
getFieldValues
public java.lang.Object[] getFieldValues(Component component, java.lang.String s)
Description copied from interface:ValidationMessages
Returns all field values from the given key and component, if any.- Specified by:
getFieldValues
in interfaceValidationMessages
- Parameters:
component
- the component refers to the values
- the custom key refers to this value, nullable- Returns:
- values. Always not null.
-
getAssociate
public Component getAssociate(java.lang.String s)
Description copied from interface:ValidationMessages
Returns the first associated component from the given key, if any.- Specified by:
getAssociate
in interfaceValidationMessages
- Parameters:
s
- the custom key refers to this messages, nullable- Returns:
- component. Nullable.
-
getAssociates
public Component[] getAssociates(java.lang.String s)
Description copied from interface:ValidationMessages
Returns all associated components from the given key, if any.- Specified by:
getAssociates
in interfaceValidationMessages
- Parameters:
s
- the custom key refers to this messages, nullable- Returns:
- components. Always not null.
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.String>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<java.lang.String>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.lang.String>
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.lang.String>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.String>
-
toArray
public java.lang.String[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<java.lang.String>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<java.lang.String>
-
add
public boolean add(java.lang.String e)
- Specified by:
add
in interfacejava.util.Collection<java.lang.String>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<java.lang.String>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<java.lang.String>
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.String> c)
- Specified by:
addAll
in interfacejava.util.Collection<java.lang.String>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<java.lang.String>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<java.lang.String>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<java.lang.String>
-
-