org.zkoss.bind.impl
Class ValidationContextImpl

java.lang.Object
  extended by org.zkoss.bind.impl.ValidationContextImpl
All Implemented Interfaces:
ValidationContext

public class ValidationContextImpl
extends java.lang.Object
implements ValidationContext

the default implementation of validation context

Since:
6.0.0
Author:
dennis

Constructor Summary
ValidationContextImpl(java.lang.String command, Property property, java.util.Map<java.lang.String,Property[]> properties, BindContext ctx, boolean valid)
           
 
Method Summary
 BindContext getBindContext()
           
 java.lang.String getCommand()
          get the command that trigger the validation
 java.lang.String getMessage(Property property)
           
 java.util.Map<java.lang.String,Property[]> getProperties()
          get collected properties that need to be validated.
 Property[] getProperties(java.lang.String name)
          get collected properties that need to be validated by a property name.
 Property getProperty()
          get the main property that need to be validated.
 boolean isValid()
          is valid
 void setInvalid()
          set invalid
 void setMessage(Property property, java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationContextImpl

public ValidationContextImpl(java.lang.String command,
                             Property property,
                             java.util.Map<java.lang.String,Property[]> properties,
                             BindContext ctx,
                             boolean valid)
Method Detail

getBindContext

public BindContext getBindContext()
Specified by:
getBindContext in interface ValidationContext
Returns:
current bind context

getCommand

public java.lang.String getCommand()
Description copied from interface: ValidationContext
get the command that trigger the validation

Specified by:
getCommand in interface ValidationContext
Returns:
the command, null if a prompt-save-binding

getProperties

public java.util.Map<java.lang.String,Property[]> getProperties()
Description copied from interface: ValidationContext
get collected properties that need to be validated. you usually use this method to get value of other properties to do complex validation or a form validation

Specified by:
getProperties in interface ValidationContext
Returns:
the properties map.

getProperties

public Property[] getProperties(java.lang.String name)
Description copied from interface: ValidationContext
get collected properties that need to be validated by a property name. you usually use this method to get a value of other properties to do complex validation or a form validation

Specified by:
getProperties in interface ValidationContext
Parameters:
name - the property name
Returns:
the properties array

getProperty

public Property getProperty()
Description copied from interface: ValidationContext
get the main property that need to be validated.

Specified by:
getProperty in interface ValidationContext
Returns:
the main property.

isValid

public boolean isValid()
Description copied from interface: ValidationContext
is valid

Specified by:
isValid in interface ValidationContext
Returns:
true of result is valid, Note, default is true if no Validator called ValidationContext.setInvalid()

setInvalid

public void setInvalid()
Description copied from interface: ValidationContext
set invalid

Specified by:
setInvalid in interface ValidationContext

setMessage

public void setMessage(Property property,
                       java.lang.String message)

getMessage

public java.lang.String getMessage(Property property)


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo