FileDocCategorySizeDatePackage
BaseValidator.javaAPI DocGlassfish v2 API3341Fri May 04 22:34:10 BST 2007com.sun.enterprise.admin.util

BaseValidator

public class BaseValidator extends Object implements Serializable, com.sun.enterprise.admin.util.Validator
Optional base class for all implementations of IValidator.

Fields Summary
private static final String
kMustBeNonNull
private static final BaseValidator
sInstance
Constructors Summary
Methods Summary
public static com.sun.enterprise.admin.util.ValidatorgetInstance()
A convenience for any client that needs the default object Validator (which never changes). It could be used, for example, to invoke getInstance().validate( object ).

        return( sInstance );
    
public ValidatorResultvalidate(java.lang.Object object)
Validate the object by checking for non-null. It is expected that subclasses will override this behavior but may invoke super.validate() to make this check.

param
object the object to validate (check for non-null)
returns
a ValidatorResult indicating the validity

	
                                                           	                        
         
    
            ValidatorResult	result	= ValidatorResult.kValid;

            if ( object == null )
            {
                result	= new ValidatorResult( false, kMustBeNonNull );
            }

            return( result );