Class CompositeArtifact
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.CompositeArtifact
-
- All Implemented Interfaces:
IArtifact,IArtifactChangedListener,IVilType
- Direct Known Subclasses:
FileArtifact
public abstract class CompositeArtifact extends java.lang.Object implements IArtifact, IArtifactChangedListener
The (abstract) top-level decomposable artifact of this package.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private BinarybinaryRepresentationprivate IArtifactChangedListenerQueuelistenersprivate booleanrepresentationChangedprivate TexttextRepresentation
-
Constructor Summary
Constructors Constructor Description CompositeArtifact()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidartifactChanged(java.lang.Object cause)Is called when the artifact was changed, e.g., to trigger a reanalysis of substructures.protected abstract BinarycreateBinary()Actually creates the binary representation.protected abstract TextcreateText()Actually creates the text representation.BinarygetBinary()Returns the binary representation of the contents of this artifact for manipulation.protected BinarygetBinaryInstance()Returns the plain binary representation instance.protected booleangetRepresentationChanged(boolean reset)Returns whether the representation changed.TextgetText()Returns the textual representation of the contents of this artifact for manipulation.protected TextgetTextInstance()Returns the plain text representation instance.abstract Set<? extends FragmentArtifact>selectAll()Returns all artifacts this composite artifact is composed of.voidupdate()Called if the underlying real artifact may have been updated, e.g., by overriding it by another file.
-
-
-
Field Detail
-
textRepresentation
private Text textRepresentation
-
binaryRepresentation
private Binary binaryRepresentation
-
listeners
private IArtifactChangedListenerQueue listeners
-
representationChanged
private boolean representationChanged
-
-
Method Detail
-
selectAll
public abstract Set<? extends FragmentArtifact> selectAll()
Returns all artifacts this composite artifact is composed of.- Returns:
- all fragments
-
getText
public final Text getText() throws VilException
Description copied from interface:IArtifactReturns the textual representation of the contents of this artifact for manipulation. In case of binary artifacts, the returned object may be empty.- Specified by:
getTextin interfaceIArtifact- Returns:
- the textual representation of the contents
- Throws:
VilException- in case of obtaining the representation causes serious problems
-
getBinary
public final Binary getBinary() throws VilException
Description copied from interface:IArtifactReturns the binary representation of the contents of this artifact for manipulation.- Specified by:
getBinaryin interfaceIArtifact- Returns:
- the binary representation of the contents
- Throws:
VilException- in case of obtaining the representation causes serious problems
-
artifactChanged
public void artifactChanged(java.lang.Object cause) throws VilExceptionDescription copied from interface:IArtifactChangedListenerIs called when the artifact was changed, e.g., to trigger a reanalysis of substructures.- Specified by:
artifactChangedin interfaceIArtifactChangedListener- Parameters:
cause- the cause for the change, e.g., an artifact representation- Throws:
VilException- in case that the required operations fail for some reason
-
getRepresentationChanged
protected boolean getRepresentationChanged(boolean reset)
Returns whether the representation changed.- Parameters:
reset- reset the current status of the flag to not changed- Returns:
trueif the representation (either binary or text) changed or not
-
getTextInstance
protected Text getTextInstance()
Returns the plain text representation instance.- Returns:
- the plain instance (may be null)
-
getBinaryInstance
protected Binary getBinaryInstance()
Returns the plain binary representation instance.- Returns:
- the plain instance (may be null)
-
createText
protected abstract Text createText() throws VilException
Actually creates the text representation. Please note thatgetText()calls this method and registers the listeners appropriately.- Returns:
- the created text representation
- Throws:
VilException- in case of serious problems creating the representation
-
createBinary
protected abstract Binary createBinary() throws VilException
Actually creates the binary representation. Please note thatgetBinary()calls this method and registers the listeners appropriately.- Returns:
- the created binary representation
- Throws:
VilException- in case of serious problems creating the representation
-
update
public void update() throws VilExceptionDescription copied from interface:IArtifactCalled if the underlying real artifact may have been updated, e.g., by overriding it by another file.- Specified by:
updatein interfaceIArtifact- Throws:
VilException- in case that updating fails
-
-