Interface ValidatableContainer
-
- All Known Implementing Classes:
AbstractInlineEditorValidatableContainer,AbstractValidatableContainer,ConfigurableFlowValidatable,DefaultEditorAreaValidateable,InlineEditorValidatableContainer,RowInlineEditorValidatableContainer
public interface ValidatableContainerContainer with fields that may be validated
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddValidationObserver(ValueObserver observer)Registers a new observer for validation results of containervoidaddValidationObserver(java.lang.String key, ValueObserver observer)Registers a new observer for validation results of container for specified path and all its childrenorg.zkoss.zk.ui.ComponentgetContainer()Container componentjava.lang.ObjectgetCurrentObject(java.lang.String path)Gets a full object that was validated for specified violation pathjava.lang.StringgetCurrentObjectPath(java.lang.String path)Alters provided path (that comes from violation) so that is relative to current objectdefault ValidationResultgetCurrentValidationResult()Gets current validation results of container (relative to container).ValidationResultgetCurrentValidationResult(java.lang.String path)Gets validation results of container related to provided path (relative to container).ValidationFocusTransferHandlergetFocusTransfer()Gets an object that is able to transfer focus between fields on basis of their paths.booleanisRootPath(java.lang.String path)Checks whether provided path should be treated as root path.default booleanreactOnValidationChange()Checks whether this validatable container is able to process validation result change for root path.booleanreactOnValidationChange(java.lang.String path)Checks whether this validatable container is able to process validation result change for given path.voidremoveValidationObserver(ValueObserver observer)Unregisters a new observer for validation results of containervoidsetPreventBroadcastValidationChange(boolean preventBroadcastValidationChange)Prevents validation container to not delegate validation change further.
-
-
-
Method Detail
-
getContainer
org.zkoss.zk.ui.Component getContainer()
Container component- Returns:
- component containing fields
-
getCurrentObject
java.lang.Object getCurrentObject(java.lang.String path)
Gets a full object that was validated for specified violation path- Parameters:
path- path of violation- Returns:
- object that was validated or
nullif no object matches provided path
-
getCurrentObjectPath
java.lang.String getCurrentObjectPath(java.lang.String path)
Alters provided path (that comes from violation) so that is relative to current object- Parameters:
path- violation path- Returns:
- path relative to validated object, empty string if path points directly to validated object or
nullif path does not match any validated objects
-
isRootPath
boolean isRootPath(java.lang.String path)
Checks whether provided path should be treated as root path.Any validation path that matches containers restrictions, yet does not specify any particular attribute/qualifier (i.e. points exactly to one of validated objects) should be considered as root path. In general, if a path is validated by container or is a parent of validated path, but does not point any particular attribute, then it is a root path. Empty string should always be considered as root path, cause they are always a kind of parent of validated path.
- Returns:
trueif path is validated by container (or is a parent path of such) and does not point any attribute
-
getFocusTransfer
ValidationFocusTransferHandler getFocusTransfer()
Gets an object that is able to transfer focus between fields on basis of their paths.- Returns:
- focus transfer
-
addValidationObserver
void addValidationObserver(ValueObserver observer)
Registers a new observer for validation results of container- Parameters:
observer- observer to be notified
-
addValidationObserver
void addValidationObserver(java.lang.String key, ValueObserver observer)Registers a new observer for validation results of container for specified path and all its children- Parameters:
key- validation path to be observedobserver- observer to be notified
-
removeValidationObserver
void removeValidationObserver(ValueObserver observer)
Unregisters a new observer for validation results of container- Parameters:
observer- observer not to be notified
-
getCurrentValidationResult
ValidationResult getCurrentValidationResult(java.lang.String path)
Gets validation results of container related to provided path (relative to container).Returned container may be editable and notify listeners about changes. If a returned container is a wrapper of other container, then any changes made to the wrapper should be propagated to wrapped one and all listeners should be notified. It is not sure that changes made to wrapped one will be propagated to the wrapper. Also notifications of wrapped container may not be transferred to listeners of a wrapper.
- Returns:
- validation results found or
ValidationResult.EMPTYif no violations found for specified path
-
getCurrentValidationResult
default ValidationResult getCurrentValidationResult()
Gets current validation results of container (relative to container).Returned container may be editable and notify listeners about changes. If a returned container is a wrapper of other container, then any changes made to the wrapper should be propagated to wrapped one and all listeners should be notified. It is not sure that changes made to wrapped one will be propagated to the wrapper. Also notifications of wrapped container may not be transferred to listeners of a wrapper.
- Returns:
- validation results found or
ValidationResult.EMPTYif no violations found for specified path
-
reactOnValidationChange
boolean reactOnValidationChange(java.lang.String path)
Checks whether this validatable container is able to process validation result change for given path.- Returns:
- true if this validatable container can process validation result change
-
reactOnValidationChange
default boolean reactOnValidationChange()
Checks whether this validatable container is able to process validation result change for root path.- Returns:
- true if this validatable container can process validation result change
-
setPreventBroadcastValidationChange
void setPreventBroadcastValidationChange(boolean preventBroadcastValidationChange)
Prevents validation container to not delegate validation change further.- Parameters:
preventBroadcastValidationChange-
-
-