org.jtheque.core.managers.state
Class AbstractState

java.lang.Object
  extended by org.jtheque.core.managers.state.AbstractState
All Implemented Interfaces:
IState
Direct Known Subclasses:
CoreConfiguration, LanguageState, ModuleConfiguration, SchemaConfiguration, UpdatableState, WindowsConfiguration

public abstract class AbstractState
extends java.lang.Object
implements IState

An abstract state.

Author:
Baptiste Wicht

Constructor Summary
AbstractState()
           
 
Method Summary
 void delegateLoad(java.util.List<NodeState> nodes)
          Delegate the load.
 java.util.List<NodeState> delegateSave()
          Delegate the save.
 java.util.List<java.lang.String> getProperties()
          Return all the properties of the state.
 java.lang.String getProperty(java.lang.String key)
          Return the property referenced by a certain key.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaults)
          Return the property referenced by a certain key or a default value if the property doesn't exist.
 boolean isDelegated()
          Indicate if the write and read operations are delegated to the state or are standard managed by the statemanager.
 void setProperty(java.lang.String key, java.lang.String value)
          Set the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractState

public AbstractState()
Method Detail

getProperty

public final java.lang.String getProperty(java.lang.String key)
Description copied from interface: IState
Return the property referenced by a certain key.

Specified by:
getProperty in interface IState
Parameters:
key - The property key.
Returns:
The property.

getProperty

public final java.lang.String getProperty(java.lang.String key,
                                          java.lang.String defaults)
Description copied from interface: IState
Return the property referenced by a certain key or a default value if the property doesn't exist.

Specified by:
getProperty in interface IState
Parameters:
key - The property key.
defaults - The default value if we don't find the property.
Returns:
The property or the default value if the property doesn't exist.

setProperty

public final void setProperty(java.lang.String key,
                              java.lang.String value)
Description copied from interface: IState
Set the property.

Specified by:
setProperty in interface IState
Parameters:
key - The property key.
value - The property value.

getProperties

public final java.util.List<java.lang.String> getProperties()
Description copied from interface: IState
Return all the properties of the state.

Specified by:
getProperties in interface IState
Returns:
A List containing all the properties of the state.

isDelegated

public boolean isDelegated()
Description copied from interface: IState
Indicate if the write and read operations are delegated to the state or are standard managed by the statemanager.

Specified by:
isDelegated in interface IState
Returns:
true if the operations are delegated else false.

delegateSave

public java.util.List<NodeState> delegateSave()
Description copied from interface: IState
Delegate the save.

Specified by:
delegateSave in interface IState
Returns:
A List of NodeState to write.

delegateLoad

public void delegateLoad(java.util.List<NodeState> nodes)
Description copied from interface: IState
Delegate the load.

Specified by:
delegateLoad in interface IState
Parameters:
nodes - The noads of the state.


Copyright © 2009 JTheque. All Rights Reserved.