Package org.camunda.bpm.model.dmn
Class Dmn
- java.lang.Object
-
- org.camunda.bpm.model.dmn.Dmn
-
public class Dmn extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Dmn()
Register known types of the Dmn model
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
convertToString(DmnModelInstance modelInstance)
Allows the conversion of aDmnModelInstance
to anString
.static DmnModelInstance
createEmptyModel()
Allows creating an new, emptyDmnModelInstance
.protected java.lang.String
doConvertToString(DmnModelInstance modelInstance)
protected DmnModelInstance
doCreateEmptyModel()
protected DmnModelInstance
doReadModelFromFile(java.io.File file)
protected DmnModelInstance
doReadModelFromInputStream(java.io.InputStream is)
protected void
doRegisterTypes(ModelBuilder modelBuilder)
protected void
doValidateModel(DmnModelInstance modelInstance)
protected void
doWriteModelToFile(java.io.File file, DmnModelInstance modelInstance)
protected void
doWriteModelToOutputStream(java.io.OutputStream os, DmnModelInstance modelInstance)
Model
getDmnModel()
ModelBuilder
getDmnModelBuilder()
static DmnModelInstance
readModelFromFile(java.io.File file)
Allows reading aDmnModelInstance
from a File.static DmnModelInstance
readModelFromStream(java.io.InputStream stream)
Allows reading aDmnModelInstance
from anInputStream
void
setDmnModel(Model dmnModel)
static void
validateModel(DmnModelInstance modelInstance)
Validate model DOM documentstatic void
writeModelToFile(java.io.File file, DmnModelInstance modelInstance)
Allows writing aDmnModelInstance
to a File.static void
writeModelToStream(java.io.OutputStream stream, DmnModelInstance modelInstance)
Allows writing aDmnModelInstance
to anOutputStream
.
-
-
-
Field Detail
-
INSTANCE
public static Dmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static DmnModelInstance readModelFromFile(java.io.File file)
Allows reading aDmnModelInstance
from a File.- Parameters:
file
- theFile
to read theDmnModelInstance
from- Returns:
- the model read
- Throws:
DmnModelException
- if the model cannot be read
-
readModelFromStream
public static DmnModelInstance readModelFromStream(java.io.InputStream stream)
Allows reading aDmnModelInstance
from anInputStream
- Parameters:
stream
- theInputStream
to read theDmnModelInstance
from- Returns:
- the model read
- Throws:
ModelParseException
- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(java.io.File file, DmnModelInstance modelInstance)
Allows writing aDmnModelInstance
to a File. It will be validated before writing.- Parameters:
file
- theFile
to write theDmnModelInstance
tomodelInstance
- theDmnModelInstance
to write- Throws:
DmnModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(java.io.OutputStream stream, DmnModelInstance modelInstance)
Allows writing aDmnModelInstance
to anOutputStream
. It will be validated before writing.- Parameters:
stream
- theOutputStream
to write theDmnModelInstance
tomodelInstance
- theDmnModelInstance
to write- Throws:
ModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
convertToString
public static java.lang.String convertToString(DmnModelInstance modelInstance)
Allows the conversion of aDmnModelInstance
to anString
. It will be validated before conversion.- Parameters:
modelInstance
- the model instance to convert- Returns:
- the XML string representation of the model instance
-
validateModel
public static void validateModel(DmnModelInstance modelInstance)
Validate model DOM document- Parameters:
modelInstance
- theDmnModelInstance
to validate- Throws:
ModelValidationException
- if the model is not valid
-
createEmptyModel
public static DmnModelInstance createEmptyModel()
Allows creating an new, emptyDmnModelInstance
.- Returns:
- the empty model.
-
doReadModelFromFile
protected DmnModelInstance doReadModelFromFile(java.io.File file)
-
doReadModelFromInputStream
protected DmnModelInstance doReadModelFromInputStream(java.io.InputStream is)
-
doWriteModelToFile
protected void doWriteModelToFile(java.io.File file, DmnModelInstance modelInstance)
-
doWriteModelToOutputStream
protected void doWriteModelToOutputStream(java.io.OutputStream os, DmnModelInstance modelInstance)
-
doConvertToString
protected java.lang.String doConvertToString(DmnModelInstance modelInstance)
-
doValidateModel
protected void doValidateModel(DmnModelInstance modelInstance)
-
doCreateEmptyModel
protected DmnModelInstance doCreateEmptyModel()
-
doRegisterTypes
protected void doRegisterTypes(ModelBuilder modelBuilder)
-
getDmnModelBuilder
public ModelBuilder getDmnModelBuilder()
-
setDmnModel
public void setDmnModel(Model dmnModel)
- Parameters:
dmnModel
- the cmmnModel to set
-
-