public abstract class AbstractPropertyManager extends java.lang.Object implements PropertyManager
Modifier | Constructor and Description |
---|---|
protected |
AbstractPropertyManager(DBObjectProvider pro) |
Modifier and Type | Method and Description |
---|---|
boolean |
canAlterProperty(SystemObject original,
SystemObject update,
java.lang.String prop)
Convenience method to call
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String) and check the return
value is a PropertyAction with a type of ALTER. |
PropertyAction |
canChangeProperty(SystemObject original,
SystemObject update,
java.lang.String prop)
Queries the support for setting or changing the given property for a create
or update.
|
protected boolean |
canChangeWithAlter(SystemObject orig,
SystemObject update,
java.lang.String prop)
Returns true if the given property can be changed using an alter on the
given original and updated objects.
|
protected boolean |
canChangeWithReplace(SystemObject orig,
SystemObject update,
java.lang.String prop)
Returns true if the given property can be changed using a drop/recreate on
the given original and updated objects.
|
protected boolean |
canCreate(java.lang.Class<? extends SystemObject> objClz,
java.lang.String prop)
Tests whether the given property is supported for create on the given
object type.
|
protected boolean |
canCreate(java.lang.String type,
java.lang.String prop)
Deprecated.
replaced by
canCreate(Class,String) . |
protected boolean |
canCreate(SystemObject newObj,
java.lang.String prop)
Return true if the given property can be set on the given new object.
|
boolean |
canCreateProperty(SystemObject obj,
java.lang.String prop)
Queries the support for setting or changing the given property for a create
or update.
|
PropertyAction |
canUpdateObject(Difference rs)
Convenience method that uses
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String) on all the
differences in the given Difference to tell whether the update on the given
objects can be done using a CREATE, ALTER or REPLACE as appropriate. |
PropertyAction |
canUpdateObject(SystemObject orig,
SystemObject update)
Convenience method that uses
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String) on all the
differences in the given object to tell whether the update on the given
objects can be done using a CREATE, ALTER or REPLACE as appropriate. |
PropertyInfo |
findPropertyInfo(java.lang.Class<? extends DBObject> objClz,
java.lang.String prop)
Finds a PropertyInfo for the given property on the given object class.
|
java.util.Collection |
getAllowedPropertyValues(DBObject originalObject,
DBObject updatedObject,
java.lang.String property)
Gets the allowed property values for the given object and property
in the described database.
|
java.util.Collection<java.lang.String> |
getAllowedReferenceParentTypes(DBObject obj,
java.lang.String property)
Gets the allowed object types of the parent object for a given
reference property.
|
java.util.Collection<java.lang.String> |
getAllowedReferenceTypes(DBObject object,
java.lang.String property)
Gets the list of object types that can be referenced from the given
property.
|
java.util.Collection<java.lang.String> |
getAllowedReferenceTypes(PropertyInfo propInfo)
Gets the list of object types that can be referenced from the given
property.
|
java.util.Collection<java.lang.String> |
getAllowedReferenceTypes(java.lang.String objectType,
java.lang.String property)
Gets the list of object types that can be referenced from the given
property.
|
protected AbstractPropertyManager |
getDelegate()
Delegate mechanism for subclasses to implement if they wrap another
PropertyManager implementation.
|
java.lang.Object |
getImplicitDefaultValue(DBObject obj,
java.lang.String property)
Gets the implicit default value for the given object property, if one
exists.
|
protected java.util.logging.Logger |
getLogger()
Returns a
DBLog initialised Logger class for logging messages. |
Nullable.NullBehaviour |
getNullBehaviour(DBObject originalObject,
DBObject updatedObject,
java.lang.String property)
Gets the null behaviour of the given object property.
|
protected Nullable.NullBehaviour |
getNullBehaviour(PropertyInfo info,
boolean edit)
Used by
getNullBehaviour(oracle.javatools.db.DBObject, oracle.javatools.db.DBObject, java.lang.String) to get the null behaviour for the
given property. |
protected PropertyHelper |
getPropertyHelper()
Gets a PropertyHelper that is cached for this PropertyManager
implementation.
|
protected DBObjectProvider |
getProvider() |
protected java.lang.Class<? extends DBObjectProvider> |
getProviderClass()
Gets the provider class for the property support to test properties
against.
|
java.util.Collection<java.lang.String> |
getRestrictingProperties(java.lang.Class<? extends SystemObject> objClz,
java.lang.String property)
Gets a list of other property paths which restrict the canCreate/Replace/Alter
support of the given system object property path.
|
protected boolean |
isProcessorProperty(java.lang.Class<? extends SystemObject> clz,
java.lang.String prop)
Tests whether the given property is from an UpdateProcessor registered with the underlying
provider's DatabaseDescriptor, rather than being a properly registered property with the
Metadata.
|
boolean |
supportsProperty(java.lang.Class<? extends DBObject> objClz,
java.lang.String prop)
Tests whether the given property is supported for the given object type.
|
boolean |
supportsProperty(java.lang.String type,
java.lang.String prop)
Tests whether the given property is supported for the given object type.
|
PropertyAction |
supportsPropertyChange(java.lang.Class<? extends SystemObject> objClz,
java.lang.String prop)
Tests whether the given property can be changed on the given system
object type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportsAction
protected AbstractPropertyManager(DBObjectProvider pro)
protected final PropertyHelper getPropertyHelper()
protected AbstractPropertyManager getDelegate()
protected java.util.logging.Logger getLogger()
DBLog
initialised Logger class for logging messages.protected DBObjectProvider getProvider()
protected java.lang.Class<? extends DBObjectProvider> getProviderClass()
public final boolean supportsProperty(java.lang.String type, java.lang.String prop)
PropertyManager
supportsProperty
in interface PropertyManager
type
- the object type (e.g.
Table.TYPE
).prop
- the property name / path.public boolean supportsProperty(java.lang.Class<? extends DBObject> objClz, java.lang.String prop)
PropertyManager
supportsProperty
in interface PropertyManager
objClz
- the object class (e.g. Table.class or Column.class ).prop
- the property name / path.public PropertyAction supportsPropertyChange(java.lang.Class<? extends SystemObject> objClz, java.lang.String prop)
PropertyManager
If the property is a child property, and ALTER is supported then the
action may contain child information (e.g. whether children can be
added/removed/modified) via the supportsChildAction
method.
supportsPropertyChange
in interface PropertyManager
objClz
- the type of system object to testprop
- the property (can be a path) that we want to changePropertyAction.supportsChildAction(oracle.javatools.db.property.PropertyAction.ChildAction)
public PropertyInfo findPropertyInfo(java.lang.Class<? extends DBObject> objClz, java.lang.String prop)
PropertyManager
findPropertyInfo
in interface PropertyManager
objClz
- the object class (e.g. Column.class ).prop
- the property name / path.public boolean canCreateProperty(SystemObject obj, java.lang.String prop)
PropertyManager
canCreateProperty
in interface PropertyManager
prop
- the property name / path to querypublic final boolean canAlterProperty(SystemObject original, SystemObject update, java.lang.String prop)
PropertyManager
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String)
and check the return
value is a PropertyAction with a type of ALTER.canAlterProperty
in interface PropertyManager
original
- the original object (null for a create query)update
- the updated (or new) objectprop
- the property name / path to querypublic final PropertyAction canChangeProperty(SystemObject original, SystemObject update, java.lang.String prop)
PropertyManager
canChangeProperty
in interface PropertyManager
original
- the original object (null for a create query)update
- the updated (or new) objectprop
- the property name / path to queryprotected boolean canCreate(SystemObject newObj, java.lang.String prop)
canCreate(Class,String)
with the object type.protected boolean canCreate(java.lang.Class<? extends SystemObject> objClz, java.lang.String prop)
objClz
- the SystemObject subclass the property is defined
against.prop
- the property (or property path) to test@Deprecated protected boolean canCreate(java.lang.String type, java.lang.String prop)
canCreate(Class,String)
.protected boolean canChangeWithAlter(SystemObject orig, SystemObject update, java.lang.String prop)
protected boolean canChangeWithReplace(SystemObject orig, SystemObject update, java.lang.String prop)
public final PropertyAction canUpdateObject(SystemObject orig, SystemObject update)
PropertyManager
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String)
on all the
differences in the given object to tell whether the update on the given
objects can be done using a CREATE, ALTER or REPLACE as appropriate.canUpdateObject
in interface PropertyManager
orig
- the original object (null for a create query)update
- the updated (or new) objectpublic final PropertyAction canUpdateObject(Difference rs)
PropertyManager
PropertyManager.canChangeProperty(oracle.javatools.db.SystemObject, oracle.javatools.db.SystemObject, java.lang.String)
on all the
differences in the given Difference to tell whether the update on the given
objects can be done using a CREATE, ALTER or REPLACE as appropriate.
The Difference must be a diff of two SystemObjects.canUpdateObject
in interface PropertyManager
rs
- the changes to testpublic java.util.Collection getAllowedPropertyValues(DBObject originalObject, DBObject updatedObject, java.lang.String property)
PropertyManager
getAllowedPropertyValues
in interface PropertyManager
updatedObject
- the object the property is onproperty
- the property to checkpublic java.util.Collection<java.lang.String> getRestrictingProperties(java.lang.Class<? extends SystemObject> objClz, java.lang.String property)
PropertyManager
getRestrictingProperties
in interface PropertyManager
property
- the full path of the propertypublic Nullable.NullBehaviour getNullBehaviour(DBObject originalObject, DBObject updatedObject, java.lang.String property)
PropertyManager
getNullBehaviour
in interface PropertyManager
originalObject
- the original object, or null if this isn't an
edit.updatedObject
- the updated object (must not be null).property
- the property to test.protected Nullable.NullBehaviour getNullBehaviour(PropertyInfo info, boolean edit)
getNullBehaviour(oracle.javatools.db.DBObject, oracle.javatools.db.DBObject, java.lang.String)
to get the null behaviour for the
given property.info
- the property.edit
- whether we're editing or not.public java.util.Collection<java.lang.String> getAllowedReferenceTypes(DBObject object, java.lang.String property)
PropertyManager
getAllowedReferenceTypes
in interface PropertyManager
object
- the object the reference is fromproperty
- the reference property namepublic final java.util.Collection<java.lang.String> getAllowedReferenceTypes(java.lang.String objectType, java.lang.String property)
PropertyManager
getAllowedReferenceTypes
in interface PropertyManager
objectType
- the type of object the reference is fromproperty
- the reference property namepublic java.util.Collection<java.lang.String> getAllowedReferenceTypes(PropertyInfo propInfo)
PropertyManager
getAllowedReferenceTypes
in interface PropertyManager
propInfo
- the PropertyInfo for the property to testpublic java.util.Collection<java.lang.String> getAllowedReferenceParentTypes(DBObject obj, java.lang.String property)
PropertyManager
For example for an FKConstraint referenceID property this will return Table.TYPE.
getAllowedReferenceParentTypes
in interface PropertyManager
obj
- the object the property is set onproperty
- the name of the property to lookuppublic java.lang.Object getImplicitDefaultValue(DBObject obj, java.lang.String property)
PropertyManager
nullable
, if null means "Not
Specified" then the default is not of interest.getImplicitDefaultValue
in interface PropertyManager
obj
- the object the property is onproperty
- the property nameprotected final boolean isProcessorProperty(java.lang.Class<? extends SystemObject> clz, java.lang.String prop)
clz
- the object class the property is onprop
- the property to test