Class AbstractArtifactRepresentation
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.representation.AbstractArtifactRepresentation
-
- All Implemented Interfaces:
IArtifactRepresentation,IVilType
public abstract class AbstractArtifactRepresentation extends java.lang.Object implements IArtifactRepresentation
An abstract implementation of artifact representations which cares for modifiability and for listeners.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ArtifactChangedListenerQueuelistenersprivate booleanmodifiableprivate booleantriggerEnabled
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractArtifactRepresentation(boolean modifiable)Creates a artifact representation and sets the modifiability flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IArtifactChangedListenerQueuegetListeners()Returns the change listeners.protected booleanisModifiable()Returns whether the representation is modifiable.voidsetTriggerEnabled(boolean triggerEnabled)May be used to avoid superfluous listener triggers.voidtriggerArtifactChanged()Triggers all registerered listeners ingetListeners().-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.instantiation.core.model.artifactModel.representation.IArtifactRepresentation
isEmpty, updateContents
-
-
-
-
Field Detail
-
triggerEnabled
private boolean triggerEnabled
-
modifiable
private boolean modifiable
-
listeners
private ArtifactChangedListenerQueue listeners
-
-
Method Detail
-
isModifiable
protected boolean isModifiable()
Returns whether the representation is modifiable.- Returns:
trueif it is modifiable,falseelse
-
getListeners
public IArtifactChangedListenerQueue getListeners()
Description copied from interface:IArtifactRepresentationReturns the change listeners.- Specified by:
getListenersin interfaceIArtifactRepresentation- Returns:
- the change listeners
-
triggerArtifactChanged
public void triggerArtifactChanged() throws VilExceptionTriggers all registerered listeners ingetListeners().- Throws:
VilException- in case that some listeners fail
-
setTriggerEnabled
public void setTriggerEnabled(boolean triggerEnabled)
May be used to avoid superfluous listener triggers.- Parameters:
triggerEnabled- enabled iftrue, disabled iffalse
-
-