Class DummyBindingStrategy

  • All Implemented Interfaces:
    BindingStrategy

    public final class DummyBindingStrategy
    extends Object
    implements BindingStrategy

    A dummy implementation of the BindingStrategy interface.

    This strategy can be used when no specific (functional) BindingStrategy implementation is available or is needed (for instance as an application of the null object pattern). All methods are implemented as dummies that do not provide any specific functionality - refer to the documentation of the single methods for more details.

    It is not possible to create instances of this class. Instead the static INSTANCE field can be used. This instance can be shared between multiple threads.

    Version:
    $Id: DummyBindingStrategy.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Field Detail

      • INSTANCE

        public static final DummyBindingStrategy INSTANCE
        Constant for the shared instance of this class that can be used.
    • Method Detail

      • readProperty

        public Object readProperty​(Object model,
                                   String propertyName)
        Reads a property from the given model object. This is just a dummy implementation that returns always null.
        Specified by:
        readProperty in interface BindingStrategy
        Parameters:
        model - the model object
        propertyName - the name of the property
        Returns:
        the value of this property
      • writeProperty

        public void writeProperty​(Object model,
                                  String propertyName,
                                  Object value)
        Writes a property of the given model object. This is just a dummy implementation. No property is actually written.
        Specified by:
        writeProperty in interface BindingStrategy
        Parameters:
        model - the model object
        propertyName - the name of the property
        value - the value of the property