net.sf.fikin.pojostate.state
Class DynamicState

java.lang.Object
  extended by net.sf.fikin.pojostate.state.AbstractState
      extended by net.sf.fikin.pojostate.state.DynamicState
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable, java.util.Collection, State, StatePrototype

public class DynamicState
extends AbstractState

Dynamic binding between MethodMeta and POJO

It maintains a permanent reference to the underlying POJO.

It implements does execute the underlying Method each time a call to DynamicState.DynamicProperty.getValue() is issued. This leads to a very dynamic view of the state without need to issue state updates. Due to that update() is dummy.

This type of behaviour is useful when not all Properties will be read always and when underlying POJO changed its state often. created on Mar 1, 2007

Since:
Version:
$Revision: 1.2 $
Author:
fiykov

Nested Class Summary
 class DynamicState.DynamicProperty
          Implements dynamic read-execute value It expect MethodMeta, the actual POJO is accessed from nestling class.
 
Nested classes/interfaces inherited from class net.sf.fikin.pojostate.state.AbstractState
AbstractState.PropertyNameComparator
 
Field Summary
 
Fields inherited from interface net.sf.fikin.pojostate.State
SORT_ASC, SORT_BY_DESC, SORT_BY_NAME, SORT_BY_VALUE, SORT_DESC
 
Constructor Summary
DynamicState()
           
 
Method Summary
 Property newProperty(MethodMeta mm)
          instantiate new DynamicState.DynamicProperty object
 void update()
          State update.
 
Methods inherited from class net.sf.fikin.pojostate.state.AbstractState
add, add, addAll, clear, clone, contains, containsAll, getClassLoader, getFormat, getLocale, getObject, getProperties, getProperty, isEmpty, iterator, remove, removeAll, retainAll, setClassLoader, setFormat, setLocale, setObject, setProperties, size, sort, sortArray, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

DynamicState

public DynamicState()
Method Detail

update

public void update()
State update.

In this case it does nothing as this is largely irrelevant to this type of binding between POJO-State


newProperty

public Property newProperty(MethodMeta mm)
instantiate new DynamicState.DynamicProperty object

Parameters:
mm - attached to that Property


Copyright © 2005 Nikolay Fiykov. All Rights Reserved.