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:
- java.lang.Cloneable,- ValueListener
 
 public class SpecificationPlugin extends ObjectValue implements ValueListener A plug-in for Specification that enforces certain overwriting rules.- Author:
- Pinaki Poddar
 
- 
- 
Constructor SummaryConstructors Constructor Description SpecificationPlugin(Configuration conf, java.lang.String prop)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>getValueType()Returns the type of the property that this Value represents.voidset(java.lang.Object obj)Set a value from the given object after validating.voidsetString(java.lang.String str)Set a value from the given String after validating.protected voidvalidateOverwrite(Specification newSpec)Validates if the given Specification can overwrite the current Specification.voidvalueChanged(Value value)Callback used byValueobjects to notify listener of change.- 
Methods inherited from class org.apache.openjpa.lib.conf.ObjectValueconfigure, configure, get, getInternalString, instantiate, instantiate, newInstance, objectChanged, set, setInternalObject, setInternalString
 - 
Methods inherited from class org.apache.openjpa.lib.conf.ValueaddEquivalentKey, 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 Detail- 
_locprotected static final Localizer _loc 
 
- 
 - 
Constructor Detail- 
SpecificationPluginpublic SpecificationPlugin(Configuration conf, java.lang.String prop) 
 
- 
 - 
Method Detail- 
getValueTypepublic java.lang.Class<?> getValueType() Description copied from class:ValueReturns the type of the property that this Value represents.- Overrides:
- getValueTypein class- ObjectValue
 
 - 
setStringpublic void setString(java.lang.String str) Set a value from the given String after validating.
 - 
setpublic void set(java.lang.Object obj) Set a value from the given object after validating.- Overrides:
- setin class- ObjectValue
- Parameters:
- obj- can be null to set the Specification to null.
 
 - 
validateOverwriteprotected void validateOverwrite(Specification newSpec) 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:
- Specification.equals(Object)
 
 - 
valueChangedpublic void valueChanged(Value value) Description copied from interface:ValueListenerCallback used byValueobjects to notify listener of change.- Specified by:
- valueChangedin interface- ValueListener
 
 
- 
 
-