|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.javatools.db.validators.AbstractValidator
Provides an abstract implementation of the DBOBjectValidator
interface. Implementors can use this class as a starting point
for validation logic as validation of name, schema name (if appropriate) and
duplication of name are provided by this abstract class.
| Constructor Summary | |
protected |
AbstractValidator(DBObjectProvider pro)
|
| Method Summary | |
protected boolean |
canChangeSchema()
By default an object's schema can be changed (only applies to SchemaObjects). |
protected boolean |
canHaveEmptyName()
By default names cannot be empty (or null). |
protected boolean |
canRename()
Default name validation is to allow rename on update. |
protected DBObject |
findExistingObject(DBObject object)
Finds an existing object for the given object. |
protected DBObjectProvider |
getProvider()
|
protected void |
validateName(DBObject obj)
Validates a name to see if it is a legal identifier. |
protected void |
validateNameInUse(DBObject object)
Validates whether the given name is already in use. |
void |
validateObject(DBObject object)
Finds an existing object for the object in question (by ID) and calls updateObject(DBObject original, DBObject updated) with that original object (null if none). |
void |
validateObject(DBObject original,
DBObject updated)
Used for validation of both new and existing objects. |
void |
validateObject(DBObject original,
DBObject updated,
java.lang.String childType)
Default implementation simply throws a MissingValidatorException. |
void |
validateObject(DBObject object,
java.lang.String childType)
Tries to find an existing object for the given object and calls validateObject( DBObject original, DBObject updated, String childType ). |
protected void |
validateSchema(SchemaObject object)
|
static void |
validateUniqueNames(DBObject[] objs)
Validates that the given set of objects does not contain a duplicate name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected AbstractValidator(DBObjectProvider pro)
| Method Detail |
protected void validateName(DBObject obj)
throws InvalidNameException
InvalidNameExceptionprotected boolean canHaveEmptyName()
protected boolean canRename()
protected boolean canChangeSchema()
protected DBObjectProvider getProvider()
public final void validateObject(DBObject object)
throws ValidationException
validateObject in interface DBObjectValidatorobject - the DBObject to validate
ValidationException - if the object is not valid.
public final void validateObject(DBObject object,
java.lang.String childType)
throws ValidationException
validateObject in interface DBObjectValidatorobject - the DBObject to validatechildType - the DBObject type for the children to be validated
ValidationException - if the object is not valid.
protected void validateSchema(SchemaObject object)
throws ValidationException
ValidationException
protected void validateNameInUse(DBObject object)
throws NameInUseException
NameInUseException
public void validateObject(DBObject original,
DBObject updated)
throws ValidationException
validateObject in interface DBObjectValidatorValidationException - if the object is not valid.
public static void validateUniqueNames(DBObject[] objs)
throws ValidationException
objs - set of objects to check for all having unique names
ValidationException - if a name is duplicated
public void validateObject(DBObject original,
DBObject updated,
java.lang.String childType)
throws ValidationException
validateObject in interface DBObjectValidatorchildType - the DBObject type for the children to be validated
ValidationException - if the object is not valid.
protected DBObject findExistingObject(DBObject object)
throws ValidationException
object - the object to look for an existing version of
ValidationException - if the types of the given object and existing
object don't match.
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.