ThinkUI SQL Client 1.1.3 API

thinkui.db.attribute
Interface AttributeConstraints

All Superinterfaces:
java.io.Serializable

public interface AttributeConstraints
extends java.io.Serializable

Represents constraints for an attribute. The concept of AttributeConstraints provides a dynamic way to validate an attribute value. It is used to complement the static and low-level validation that is done by the AttributeType.


Field Summary
static java.lang.String[] CAPTIONS
           
static java.lang.String[] NAMES
           
 
Method Summary
 AttributeConstraints copy()
           
 java.lang.String format(Attribute attr)
          Format the constraint based on the given attribute.
 java.lang.String getName()
           
 void init(Attribute attr, java.lang.String expr)
          Initialize the constraint based on the given attribute and expression.
 void validate(Attribute attr, java.lang.Object value)
          Perform validation of the given attribute value against the attribute constraints.
 

Field Detail

CAPTIONS

public static final java.lang.String[] CAPTIONS

NAMES

public static final java.lang.String[] NAMES
Method Detail

copy

public AttributeConstraints copy()
Returns:
a copy of the attribute constraints.

format

public java.lang.String format(Attribute attr)
Format the constraint based on the given attribute. The format will be, where expr is suitable for call to init() method: <class name>(<expr>)


getName

public java.lang.String getName()
Returns:
the name of the attribute constraints.

init

public void init(Attribute attr,
                 java.lang.String expr)
          throws java.lang.Exception
Initialize the constraint based on the given attribute and expression.

Throws:
java.lang.Exception

validate

public void validate(Attribute attr,
                     java.lang.Object value)
              throws java.lang.Exception
Perform validation of the given attribute value against the attribute constraints.

Throws:
java.lang.Exception

ThinkUI SQL Client 1.1.3 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.