Package org.apache.openjpa.conf
Class SpecificationPlugin
java.lang.Object
org.apache.openjpa.lib.conf.Value
org.apache.openjpa.lib.conf.ObjectValue
org.apache.openjpa.conf.SpecificationPlugin
- All Implemented Interfaces:
Cloneable
,ValueListener
A plug-in for Specification that enforces certain overwriting rules.
- Author:
- Pinaki Poddar
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Returns the type of the property that this Value represents.void
Set a value from the given object after validating.void
Set a value from the given String after validating.protected void
validateOverwrite
(Specification newSpec) Validates if the given Specification can overwrite the current Specification.void
valueChanged
(Value value) Callback used byValue
objects to notify listener of change.Methods inherited from class org.apache.openjpa.lib.conf.ObjectValue
configure, configure, get, getInternalString, instantiate, instantiate, newInstance, objectChanged, set, setInternalObject, setInternalString
Methods inherited from class org.apache.openjpa.lib.conf.Value
addEquivalentKey, addListener, alias, alias, assertChangeable, clone, equals, getAliases, getDefault, getEquivalentKeys, getInstantiatingGetter, getListeners, getLoadKey, getOriginalValue, getProperty, getPropertyKeys, getScope, getString, hashCode, hide, isAliasListComprehensive, isDynamic, isHidden, isPrivate, makePrivate, matches, removeListener, setAlias, setAlias, setAliases, setAliasListComprehensive, setDefault, setDynamic, setInstantiatingGetter, setLoadKey, setObject, setProperty, setScope, toString, unalias, unalias, valueChanged
-
Field Details
-
_loc
-
-
Constructor Details
-
SpecificationPlugin
-
-
Method Details
-
getValueType
Description copied from class:Value
Returns the type of the property that this Value represents.- Overrides:
getValueType
in classObjectValue
-
setString
Set a value from the given String after validating. -
set
Set a value from the given object after validating.- Overrides:
set
in classObjectValue
- Parameters:
obj
- can be null to set the Specification to null.
-
validateOverwrite
Validates if the given Specification can overwrite the current Specification. If the given Specification is not same as the current one, then it is valid to overwrite. If the given Specification is same as the current Specification then it must have a major version number equal or less than the current one.- Throws:
fatal
- UserException if the given Specification is same as the current Specification but has a higher major version.- See Also:
-
valueChanged
Description copied from interface:ValueListener
Callback used byValue
objects to notify listener of change.- Specified by:
valueChanged
in interfaceValueListener
-