cz.cuni.versatile.core
Class ConstantVP

java.lang.Object
  extended bycz.cuni.versatile.core.AbstractValueProvider
      extended bycz.cuni.versatile.core.ConstantVP
All Implemented Interfaces:
ValueProvider

public final class ConstantVP
extends AbstractValueProvider

ConstantVP stands for Constant Value Provider. The last-resort value provider, usually attached to the end of a value provider chain to ensure a property value is always defined.

Author:
Jaroslav Gergic

Field Summary
 
Fields inherited from class cz.cuni.versatile.core.AbstractValueProvider
attrName, defaultProvider
 
Constructor Summary
ConstantVP(java.lang.Object value)
           
 
Method Summary
 java.lang.Object getLocalValue()
          Returns the constant value provided during instantiation.
 boolean hasLocalValue()
          Always returns true.
 
Methods inherited from class cz.cuni.versatile.core.AbstractValueProvider
getAttributeName, getDefault, getValue, hasValue, toPreferenceChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantVP

public ConstantVP(java.lang.Object value)
Method Detail

getLocalValue

public java.lang.Object getLocalValue()
Returns the constant value provided during instantiation.

Returns:
the current value of the attribute at the time of invocation
See Also:
ValueProvider.getLocalValue()

hasLocalValue

public boolean hasLocalValue()
Always returns true.

Returns:
true if the value is set for this ValueProvider instance, false otherwise
See Also:
ValueProvider.hasLocalValue()