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 protectedDmn()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.StringconvertToString(DmnModelInstance modelInstance)Allows the conversion of aDmnModelInstanceto anString.static DmnModelInstancecreateEmptyModel()Allows creating an new, emptyDmnModelInstance.protected java.lang.StringdoConvertToString(DmnModelInstance modelInstance)protected DmnModelInstancedoCreateEmptyModel()protected DmnModelInstancedoReadModelFromFile(java.io.File file)protected DmnModelInstancedoReadModelFromInputStream(java.io.InputStream is)protected voiddoRegisterTypes(ModelBuilder modelBuilder)protected voiddoValidateModel(DmnModelInstance modelInstance)protected voiddoWriteModelToFile(java.io.File file, DmnModelInstance modelInstance)protected voiddoWriteModelToOutputStream(java.io.OutputStream os, DmnModelInstance modelInstance)ModelgetDmnModel()ModelBuildergetDmnModelBuilder()static DmnModelInstancereadModelFromFile(java.io.File file)Allows reading aDmnModelInstancefrom a File.static DmnModelInstancereadModelFromStream(java.io.InputStream stream)Allows reading aDmnModelInstancefrom anInputStreamvoidsetDmnModel(Model dmnModel)static voidvalidateModel(DmnModelInstance modelInstance)Validate model DOM documentstatic voidwriteModelToFile(java.io.File file, DmnModelInstance modelInstance)Allows writing aDmnModelInstanceto a File.static voidwriteModelToStream(java.io.OutputStream stream, DmnModelInstance modelInstance)Allows writing aDmnModelInstanceto anOutputStream.
-
-
-
Field Detail
-
INSTANCE
public static Dmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static DmnModelInstance readModelFromFile(java.io.File file)
Allows reading aDmnModelInstancefrom a File.- Parameters:
file- theFileto read theDmnModelInstancefrom- Returns:
- the model read
- Throws:
DmnModelException- if the model cannot be read
-
readModelFromStream
public static DmnModelInstance readModelFromStream(java.io.InputStream stream)
Allows reading aDmnModelInstancefrom anInputStream- Parameters:
stream- theInputStreamto read theDmnModelInstancefrom- 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 aDmnModelInstanceto a File. It will be validated before writing.- Parameters:
file- theFileto write theDmnModelInstancetomodelInstance- theDmnModelInstanceto 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 aDmnModelInstanceto anOutputStream. It will be validated before writing.- Parameters:
stream- theOutputStreamto write theDmnModelInstancetomodelInstance- theDmnModelInstanceto 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 aDmnModelInstanceto 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- theDmnModelInstanceto 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
-
-