|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.revision.DefaultRevisable
public class DefaultRevisable
a default implementation for a Revisable object, suitable as a base for
specialized subclasses
| Field Summary | |
|---|---|
protected ArrayList<Revision> |
history
|
protected Revision |
last
|
protected ArrayList<RevisionListener> |
listeners
|
protected Status |
status
|
protected ArrayList<RevisionVeto> |
vetos
|
| Constructor Summary | |
|---|---|
DefaultRevisable(Status status)
derives a special IDFactory from the given store |
|
| Method Summary | |
|---|---|
void |
addListener(RevisionListener listener)
|
void |
addRevisionVeto(RevisionVeto veto)
|
protected void |
checkRevision(Revision revision)
if returning without an exception, the revision is effectively accepted and all listeners are informed. |
void |
clearHistory()
|
Revision |
getLastRevision()
provides access to the last revision that was applied to this instance |
RevisionListener[] |
getRevisionListeners()
|
Enumeration<Revision> |
getRevisions(Filter<? super Revision> filter)
optionally allows to access revisions that were performed on this instance |
RevisionVeto[] |
getRevisionVetos()
|
Status |
getStatus()
reflects the current status of this instance |
void |
initHistory(Collection<? extends Revision> list)
initializes the history list accessible through getRevisions(Filter) |
void |
removeListener(RevisionListener listener)
|
boolean |
removeRevisionVeto(RevisionVeto veto)
|
void |
revise(Object source,
Object changes,
Status newStatus,
String comment)
this implementation calls checkRevision(Revision),
adds the revision to the history and then informs
the listeners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Status status
protected Revision last
protected final ArrayList<RevisionVeto> vetos
protected final ArrayList<RevisionListener> listeners
protected final ArrayList<Revision> history
| Constructor Detail |
|---|
public DefaultRevisable(Status status)
| Method Detail |
|---|
public void addListener(RevisionListener listener)
addListener in interface Revisablepublic void removeListener(RevisionListener listener)
removeListener in interface Revisablepublic RevisionListener[] getRevisionListeners()
public Status getStatus()
Revisable
getStatus in interface Revisablepublic void addRevisionVeto(RevisionVeto veto)
public boolean removeRevisionVeto(RevisionVeto veto)
public RevisionVeto[] getRevisionVetos()
protected void checkRevision(Revision revision)
throws IOException,
RevisionException
RevisionVeto
(in addition to other possible necessities).
IOException
RevisionException
public void revise(Object source,
Object changes,
Status newStatus,
String comment)
throws RevisionException,
IOException
checkRevision(Revision),
adds the revision to the history and then informs
the listeners
revise in interface RevisableRevisionException - if this Revisable doesn't accept the given revision
IOException - if the any resources could not be access to perform the revisionpublic void clearHistory()
public Revision getLastRevision()
Revisable
getLastRevision in interface Revisable
public void initHistory(Collection<? extends Revision> list)
throws IllegalArgumentException
getRevisions(Filter)
IllegalArgumentException
public Enumeration<Revision> getRevisions(Filter<? super Revision> filter)
throws UnsupportedOperationException
Revisable
getRevisions in interface RevisableUnsupportedOperationException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||