Class GraphicInputFactory<T extends GraphicInput,D extends EntityData>
java.lang.Object
edu.ie3.datamodel.io.factory.Factory<T,D,T>
edu.ie3.datamodel.io.factory.EntityFactory<T,D>
edu.ie3.datamodel.io.factory.input.graphics.GraphicInputFactory<T,D>
- Direct Known Subclasses:
LineGraphicInputFactory
,NodeGraphicInputFactory
public abstract class GraphicInputFactory<T extends GraphicInput,D extends EntityData>
extends EntityFactory<T,D>
Abstract factory implementation for all
GraphicInput
elements- Since:
- 08.04.20
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
GraphicInputFactory
(Class<? extends T>... allowedClasses) -
Method Summary
Modifier and TypeMethodDescriptionprotected T
buildModel
(D data) Builds model with data from givenFactoryData
object.protected abstract T
buildModel
(D data, UUID uuid, String graphicLayer, org.locationtech.jts.geom.LineString path) Creates a graphic input entity with given parametersprotected abstract String[]
Returns fields other than the required fields ofGraphicInput
that have to be present.Returns list of sets of attribute names that the entity requires to be built.Methods inherited from class edu.ie3.datamodel.io.factory.Factory
expandSet, get, getFieldsString, getSupportedClasses, newSet, validateParameters
-
Constructor Details
-
GraphicInputFactory
-
-
Method Details
-
getFields
Returns list of sets of attribute names that the entity requires to be built.The mandatory attributes required to create an
GraphicInput
are enhanced with custom attribute names that each subclass factory determines ingetAdditionalFields()
.- Specified by:
getFields
in classFactory<T extends GraphicInput,
D extends EntityData, T extends GraphicInput> - Parameters:
data
- EntityData (or subclass) containing the data- Returns:
- list of possible attribute sets
-
getAdditionalFields
Returns fields other than the required fields ofGraphicInput
that have to be present.- Returns:
- Array of field names, can be empty but not null
-
buildModel
Description copied from class:Factory
Builds model with data from givenFactoryData
object. ThrowsFactoryException
if something goes wrong.- Specified by:
buildModel
in classFactory<T extends GraphicInput,
D extends EntityData, T extends GraphicInput> - Parameters:
data
-FactoryData
(or subclass) containing the data- Returns:
- model created from data
-
buildModel
protected abstract T buildModel(D data, UUID uuid, String graphicLayer, org.locationtech.jts.geom.LineString path) Creates a graphic input entity with given parameters- Parameters:
data
- entity datauuid
- UUID of the input entitygraphicLayer
- Identifier of the graphic layer to place the object onpath
- Line string of the drawing- Returns:
- newly created asset object
-