org.sovt.impl
Class GroupInspector

java.lang.Object
  extended byorg.sovt.impl.GroupInspector
All Implemented Interfaces:
java.lang.Cloneable, Inspector

public final class GroupInspector
extends java.lang.Object
implements Inspector, java.lang.Cloneable

This Inspector is used to collect other validators, transformers or inspectors into a group.

Author:
Vilmantas Baranauskas (vilmantas_baranauskas@yahoo.com)

Constructor Summary
GroupInspector()
          Creates instance of GroupValidator.
 
Method Summary
 void addInspector(Inspector inspector)
          Adds inspector to the group.
 void addTransformer(Transformer transformer)
          Adds transformer to the group.
 void addValidator(Validator validator)
          Adds validator to the group.
 java.lang.Object clone()
          Performs a partly deep-cloning.
 java.lang.Object inspect(java.lang.Object object, ValidationResult result)
          Performs transformation and validation of given object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupInspector

public GroupInspector()
Creates instance of GroupValidator.

Method Detail

addInspector

public void addInspector(Inspector inspector)
Adds inspector to the group.

Parameters:
inspector - Inspector to add.

addTransformer

public void addTransformer(Transformer transformer)
Adds transformer to the group.

Parameters:
transformer - Transformer to add.

addValidator

public void addValidator(Validator validator)
Adds validator to the group.

Parameters:
validator - Validator to add.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Performs a partly deep-cloning. New list of contained elements is created but elements themselfs are not cloned.

Specified by:
clone in interface Inspector
Returns:
clone of itself.
Throws:
java.lang.CloneNotSupportedException - never.

inspect

public java.lang.Object inspect(java.lang.Object object,
                                ValidationResult result)
Performs transformation and validation of given object. Transformers, validators and inspectors are invoked in the order they are registered.

Specified by:
inspect in interface Inspector
Parameters:
object - Object to inspect.
result - Container for validation results.
Returns:
Transformed or completely new object which is also validated.


Copyright © 2003-2005 . All Rights Reserved.