FileDocCategorySizeDatePackage
Validatee.javaAPI DocGlassfish v2 API8127Fri May 04 22:34:58 BST 2007com.sun.enterprise.tools.common.validation

Validatee

public interface Validatee
Validatee is an Interface implemented by an Object that needs to be validated.

In order to validate an object, framework expects either of the two things; Object being validated is a Validatee itself(it implements Validatee interface) or a separate Validatee Implementation for this Object is provided.

If a separate Validatee Implementation is provided then an entry needs to be added to an Implementation File. Framework uses information in Implementation File to figure out which Validatee Implementation to use for a given object. Implementation File is a .properties file with name-value pair enteries in it. Entry in an Implementation File is of the form : [fully qualified Object Name]=[Validatee Implementation for this Object] Implementation File to be used is specified through system property impl.file

Validation framework has the Validatee Implementation for Schema2beans objects(BaseBean). You can override any Validatee Implementation that comes with framework, by providing your own.

Validations are performed, recursively on the given Object. Two types of Validations are perfomed, Structural validations and Specified validations. Structural validations are expressed through {@link CardinalConstraint}. CardinalConstraint is an implicit Constraint. Its always applied to each of the element; you dont need to specify it explicitly. Where as , other Constaints need to be explicitly specified for each element you wanted to apply it to. Constraints to be applied are specified through xml. This xml file is called Validation File. Validation file is xml file based on validation.dtd. You can also define, your own custom Constraints and apply them to any elements.

see
Constraint
see
CardinalConstraint
see
ValidationManager
author
Rajeshwar Patil
version
%I%, %G%

Fields Summary
Constructors Summary
Methods Summary
public intgetCardinal()
Gets a Cardinal of this Object Cardinal could be one of the following four : MANDATORY, OPTIONAL(?), MANDATORY ARRAY(+) or OPTIONAL ARRAY(*)

return
a Cardinal of this Object.

public java.lang.ObjectgetElement(java.lang.String elementName, int index)
Returns an element of this Object with the given name and at a given index. This is the case when the given name represents an array element

return
an element of this Object with the given name and index.

public java.lang.ObjectgetElement(java.lang.String elementName)
Returns an element of this Object with the given name.

return
an element of this Object with the given name.

public intgetElementCardinal(java.lang.String elementName)
Gets a Cardinal for the given element of this Object. Cardinal could be one of the following four : MANDATORY, OPTIONAL(?), MANDATORY ARRAY(+) or OPTIONAL ARRAY(*)

return
a Cardinal for the given element of this Object

public java.util.ArrayListgetElementDtdNames()
Returns the list of dtd names, of all the leaf elements of this Object.

return
the list of dtd names, of all the leaf elements of this Object.

public java.util.ArrayListgetElementNames()
Returns the list of names, of all the leaf elements of this Object.

return
the list of names, of all the leaf elements of this Object.

public java.lang.Object[]getElements(java.lang.String elementName)
Returns an array element of this Object with the given name.

return
an array element of this Object with the given name.

public java.lang.StringgetIndexedXPath()
Gets an indexed-xpath of this Object. indexed-xpath uniquely identifies an element in xml in case of + , * Cardinalities.

return
an indexed xpath of this Object

public java.lang.reflect.MethodgetMethod(java.lang.String methodName)
Returns the Method object, for the given method of this Object.

return
the Method object, for the given method of this Object.

public java.lang.StringgetXPath()
Gets xpath of this Object. xpath uniquely identifies an element in xml

return
the xpath of this Object

public java.lang.Objectinvoke(java.lang.reflect.Method method)
Invokes given method on this Object

return
an Object returned by the invoked method.

public booleanisBeanElement(java.lang.String elementName)
Determines whether the given element is a bean or a property(leaf element).

return
true if the given element is a bean.

public booleanisIndexed(java.lang.String elementName)
Tells if the given element is an index property(array).

return
true if the given element is an index property(array)