org.camunda.bpm.model.dmn
Class Dmn

java.lang.Object
  extended by org.camunda.bpm.model.dmn.Dmn

public class Dmn
extends Object


Field Summary
static Dmn INSTANCE
          the singleton instance of Dmn.
 
Constructor Summary
protected Dmn()
          Register known types of the Dmn model
 
Method Summary
static String convertToString(DmnModelInstance modelInstance)
          Allows the conversion of a DmnModelInstance to an String.
static DmnModelInstance createEmptyModel()
          Allows creating an new, empty DmnModelInstance.
protected  String doConvertToString(DmnModelInstance modelInstance)
           
protected  DmnModelInstance doCreateEmptyModel()
           
protected  DmnModelInstance doReadModelFromFile(File file)
           
protected  DmnModelInstance doReadModelFromInputStream(InputStream is)
           
protected  void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder modelBuilder)
           
protected  void doValidateModel(DmnModelInstance modelInstance)
           
protected  void doWriteModelToFile(File file, DmnModelInstance modelInstance)
           
protected  void doWriteModelToOutputStream(OutputStream os, DmnModelInstance modelInstance)
           
 org.camunda.bpm.model.xml.Model getDmnModel()
           
 org.camunda.bpm.model.xml.ModelBuilder getDmnModelBuilder()
           
static DmnModelInstance readModelFromFile(File file)
          Allows reading a DmnModelInstance from a File.
static DmnModelInstance readModelFromStream(InputStream stream)
          Allows reading a DmnModelInstance from an InputStream
 void setDmnModel(org.camunda.bpm.model.xml.Model dmnModel)
           
static void validateModel(DmnModelInstance modelInstance)
          Validate model DOM document
static void writeModelToFile(File file, DmnModelInstance modelInstance)
          Allows writing a DmnModelInstance to a File.
static void writeModelToStream(OutputStream stream, DmnModelInstance modelInstance)
          Allows writing a DmnModelInstance to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static Dmn INSTANCE
the singleton instance of Dmn. If you want to customize the behavior of Dmn, replace this instance with an instance of a custom subclass of Dmn.

Constructor Detail

Dmn

protected Dmn()
Register known types of the Dmn model

Method Detail

readModelFromFile

public static DmnModelInstance readModelFromFile(File file)
Allows reading a DmnModelInstance from a File.

Parameters:
file - the File to read the DmnModelInstance from
Returns:
the model read
Throws:
DmnModelException - if the model cannot be read

readModelFromStream

public static DmnModelInstance readModelFromStream(InputStream stream)
Allows reading a DmnModelInstance from an InputStream

Parameters:
stream - the InputStream to read the DmnModelInstance from
Returns:
the model read
Throws:
org.camunda.bpm.model.xml.ModelParseException - if the model cannot be read

writeModelToFile

public static void writeModelToFile(File file,
                                    DmnModelInstance modelInstance)
Allows writing a DmnModelInstance to a File. It will be validated before writing.

Parameters:
file - the File to write the DmnModelInstance to
modelInstance - the DmnModelInstance to write
Throws:
DmnModelException - if the model cannot be written
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

writeModelToStream

public static void writeModelToStream(OutputStream stream,
                                      DmnModelInstance modelInstance)
Allows writing a DmnModelInstance to an OutputStream. It will be validated before writing.

Parameters:
stream - the OutputStream to write the DmnModelInstance to
modelInstance - the DmnModelInstance to write
Throws:
org.camunda.bpm.model.xml.ModelException - if the model cannot be written
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

convertToString

public static String convertToString(DmnModelInstance modelInstance)
Allows the conversion of a DmnModelInstance to an String. 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 - the DmnModelInstance to validate
Throws:
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

createEmptyModel

public static DmnModelInstance createEmptyModel()
Allows creating an new, empty DmnModelInstance.

Returns:
the empty model.

doReadModelFromFile

protected DmnModelInstance doReadModelFromFile(File file)

doReadModelFromInputStream

protected DmnModelInstance doReadModelFromInputStream(InputStream is)

doWriteModelToFile

protected void doWriteModelToFile(File file,
                                  DmnModelInstance modelInstance)

doWriteModelToOutputStream

protected void doWriteModelToOutputStream(OutputStream os,
                                          DmnModelInstance modelInstance)

doConvertToString

protected String doConvertToString(DmnModelInstance modelInstance)

doValidateModel

protected void doValidateModel(DmnModelInstance modelInstance)

doCreateEmptyModel

protected DmnModelInstance doCreateEmptyModel()

doRegisterTypes

protected void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder modelBuilder)

getDmnModel

public org.camunda.bpm.model.xml.Model getDmnModel()
Returns:
the Model instance to use

getDmnModelBuilder

public org.camunda.bpm.model.xml.ModelBuilder getDmnModelBuilder()

setDmnModel

public void setDmnModel(org.camunda.bpm.model.xml.Model dmnModel)
Parameters:
dmnModel - the cmmnModel to set


Copyright © 2016 camunda services GmbH. All rights reserved.