| Constructor and Description |
|---|
AbstractPersister(List<State<T>> states,
String stateFieldName,
State<T> start,
Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Field |
findIdField(Class<?> clazz) |
protected Field |
findStateField(String stateFieldName,
Class<?> clazz) |
protected Class<T> |
getClazz() |
State<T> |
getCurrent(T stateful)
Return the current State
|
protected Object |
getId(T obj) |
protected Field |
getIdField() |
protected State<T> |
getStart() |
protected String |
getState(T obj) |
protected Field |
getStateField() |
protected abstract Class<?> |
getStateFieldType() |
protected HashMap<String,State<T>> |
getStates() |
protected void |
setClazz(Class<T> clazz) |
abstract void |
setCurrent(T stateful,
State<T> current,
State<T> next)
Set the current State.
|
protected void |
setIdField(Field idField) |
protected void |
setStart(State<T> start) |
protected void |
setState(T obj,
String state) |
protected void |
setStateField(Field stateField) |
protected void |
setStates(HashMap<String,State<T>> states) |
protected void |
throwStaleState(State<T> current,
State<T> next) |
protected abstract boolean |
validStateField(Field stateField) |
public State<T> getCurrent(T stateful)
getCurrent in interface Persister<T>public abstract void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException
setCurrent in interface Persister<T>stateful - current - next - StaleStateExceptionprotected abstract boolean validStateField(Field stateField)
protected abstract Class<?> getStateFieldType()
protected Field getIdField()
protected void setIdField(Field idField)
protected Field getStateField()
protected void setStateField(Field stateField)
protected Object getId(T obj) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
protected String getState(T obj) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
protected void setState(T obj, String state) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
protected void throwStaleState(State<T> current, State<T> next) throws StaleStateException
StaleStateExceptionCopyright © 2014. All rights reserved.