Class DexpiXmlWriter
java.lang.Object
neqsim.process.processmodel.DexpiXmlWriter
Utility for exporting
ProcessSystems created from DEXPI data back into a lightweight
DEXPI XML representation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<DecimalFormat> private static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendGenericAttribute(Document document, Element parent, String name, String value) private static voidprivate static voidappendIEC81346Attributes(Document document, Element parent, ProcessEquipmentInterface unit) Appends IEC 81346 reference designation attributes to a GenericAttributes element for a process unit.private static voidappendNumericAttribute(Document document, Element parent, String name, double value, String unit) private static voidappendPipingNetworkSegment(Document document, Element parent, DexpiStream stream, Set<String> usedIds) private static voidappendPipingNetworkSystem(Document document, Element parent, String key, List<DexpiStream> streams, Set<String> usedIds) private static voidappendProcessUnit(Document document, Element parent, DexpiProcessUnit processUnit, Set<String> usedIds) private static Documentprivate static ElementcreatePlantInformation(Document document) private static StringdefaultComponentClass(EquipmentEnum mapped, String elementName) private static StringfirstNonBlank(String... values) private static booleanprivate static StringsanitizeIdentifier(String name) private static StringstripHyphens(String value) private static StringuniqueIdentifier(String prefix, String name, Set<String> usedIds) static voidwrite(ProcessSystem processSystem, File file) Writes the providedProcessSystemto a DEXPI XML file.static voidwrite(ProcessSystem processSystem, OutputStream outputStream) Writes the providedProcessSystemto a DEXPI XML stream.private static voidwriteDocument(Document document, OutputStream outputStream)
-
Field Details
-
NON_IDENTIFIER
-
DECIMAL_FORMAT
-
-
Constructor Details
-
DexpiXmlWriter
private DexpiXmlWriter()
-
-
Method Details
-
write
Writes the providedProcessSystemto a DEXPI XML file.- Parameters:
processSystem- process model to exportfile- output file- Throws:
IOException- if writing fails
-
write
Writes the providedProcessSystemto a DEXPI XML stream.- Parameters:
processSystem- process model to exportoutputStream- destination stream- Throws:
IOException- if writing fails
-
createDocument
- Throws:
IOException
-
createPlantInformation
-
appendProcessUnit
private static void appendProcessUnit(Document document, Element parent, DexpiProcessUnit processUnit, Set<String> usedIds) -
appendIEC81346Attributes
private static void appendIEC81346Attributes(Document document, Element parent, ProcessEquipmentInterface unit) Appends IEC 81346 reference designation attributes to a GenericAttributes element for a process unit. This mirrors the approach inDexpiXmlWriter.appendIEC81346Attributes(Document, Element, ProcessEquipmentInterface).- Parameters:
document- the XML documentparent- the GenericAttributes element to append tounit- the process equipment to extract IEC 81346 data from
-
appendPipingNetworkSystem
-
appendPipingNetworkSegment
private static void appendPipingNetworkSegment(Document document, Element parent, DexpiStream stream, Set<String> usedIds) -
appendGenericAttribute
-
appendGenericAttribute
-
appendNumericAttribute
-
defaultComponentClass
-
uniqueIdentifier
-
sanitizeIdentifier
-
stripHyphens
-
firstNonBlank
-
isBlank
-
writeDocument
- Throws:
IOException
-