Class DexpiXmlWriter
java.lang.Object
neqsim.process.processmodel.dexpi.DexpiXmlWriter
Utility for exporting
ProcessSystems created from DEXPI data back into a lightweight
DEXPI XML representation.
The writer groups all discovered DexpiStream segments by line number (or fluid code when
a line is not available) to generate simple <PipingNetworkSystem> elements with
associated <PipingNetworkSegment> children.
- Version:
- 1.0
- Author:
- NeqSim
- See Also:
-
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 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) -
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
-