Class MatArtifact
- java.lang.Object
-
- org.proforma.variability.transfer.MatArtifact
-
public class MatArtifact extends Object
A MatArtifact is part of a ProFormA-Task which is subject to materialization.
The artifact references parts like a file, a weight, or the whole task. A single MatArtifact instance may reference many similar parts at once, e. g. all files of a task. The materialization of an artifact is performed by a
MatMethod
. For this, the MatMethod relies on the artifact to supply data as a template and to consume data as the materialization result (the instance).Examples:
- Given a MatArtifact of type
MatArtifactType.ATTACHED_TXT_FILE_CONTENTS
that supplies and consumes the content of an attached file. The supplied content contains placeholders for various variation points. The MatMethod might be a search and replace routine provided byMatMethodMustache
that scans the whole string supplied by the artifact, replaces all placeholder occurrences by actual variation point resolution values, and sends the result to the artifact's consumption method. - A MatArtifact of type
MatArtifactType.GRADING_HINTS_WEIGHTS
supplies and consumes weights of several TestRef references from the grading-hints. We apply a MatMethod to the artifact that should multiply all these weights by a factor during materialization, where the factor is resolved from a specific variation point. The multiplying MatMethod receives the weight value from the artifact's supplier. The MatMethod resolves the variation point and multiplies the resolved value to the weight. Usually there would be a single variation point multiplied to the weight, but there could be a set of variation points, that will get resolved one by one and multiplied to the weight. The resulting product is passed to the artifacts consumption method, which will overwrite the original weight value by the new one.
In summary, an artifact defines a data supplier and a data consumer. These two components are used by a MatMethod to perform materialization.
There are some artifacts defined as standard artifacts. A grader may define further artifacts by using the type
MatArtifactType.OTHER
and by implementing aMatArtifactProvider
subclass that implements the grader-specific supplying and consuming methods. A grader-specific artifact must include adataType
value and aoperatesOnTaskXml
value and it may store additional data in theany
field. - Given a MatArtifact of type
-
-
Constructor Summary
Constructors Constructor Description MatArtifact()
MatArtifact(String id, MatArtifactType artifactType)
MatArtifact(String id, MatArtifactType artifactType, VpT dataType, Boolean operatesOnTaskXml)
MatArtifact(MatArtifact other)
-
Method Summary
-
-
-
Constructor Detail
-
MatArtifact
public MatArtifact()
-
MatArtifact
public MatArtifact(String id, MatArtifactType artifactType)
-
MatArtifact
public MatArtifact(String id, MatArtifactType artifactType, VpT dataType, Boolean operatesOnTaskXml)
-
MatArtifact
public MatArtifact(MatArtifact other)
-
-
Method Detail
-
other
public static MatArtifact other(String id, VpT dataType, boolean operatesOnTaskXml)
-
taskXml
public static MatArtifact taskXml(String id)
-
fileNames
public static MatArtifact fileNames(String id)
-
attachedTxtFileContents
public static MatArtifact attachedTxtFileContents(String id)
-
fileExistences
public static MatArtifact fileExistences(String id)
-
gradingNodeExistences
public static MatArtifact gradingNodeExistences(String id)
-
gradingHintsWeights
public static MatArtifact gradingHintsWeights(String id)
-
clone
public MatArtifact clone()
-
afterUnmarshal
public void afterUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
-
getId
public String getId()
-
setId
public void setId(String id)
-
getArtifactType
public MatArtifactType getArtifactType()
-
getDataType
public VpT getDataType()
-
getValueType
public Class<?> getValueType()
-
operatesOnTaskXml
public boolean operatesOnTaskXml()
-
getRef
public List<ChildRefRef> getRef()
-
includeFileIds
public MatArtifact includeFileIds(String... fileIds)
-
includePaths
public MatArtifact includePaths(String... paths)
-
includeChildRefs
public MatArtifact includeChildRefs(ChildRefRef... childRefs)
-
includeAny
public MatArtifact includeAny(Object... anys)
-
findAnyByInstanceOfClass
public <T> T findAnyByInstanceOfClass(Class<T> clazz)
-
getProvider
public MatArtifactProvider<?> getProvider()
-
setProvider
public void setProvider(MatArtifactProvider<?> provider)
-
init
public void init(Ribbon<TaskUnzipped> rtu)
-
-