Class IfcParserWriterUtils


  • public class IfcParserWriterUtils
    extends Object
    • Constructor Detail

      • IfcParserWriterUtils

        public IfcParserWriterUtils()
    • Method Detail

      • convertSimpleValue

        public static Object convertSimpleValue​(org.bimserver.emf.PackageMetaData packageMetaData,
                                                org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
                                                Class<?> instanceClass,
                                                String value,
                                                long lineNumber)
                                         throws org.bimserver.plugins.deserializers.DeserializeException
        Throws:
        org.bimserver.plugins.deserializers.DeserializeException
      • readString

        public static String readString​(String value,
                                        long lineNumber)
                                 throws org.bimserver.plugins.deserializers.DeserializeException
        Decode a piece of text according to ISO-10303-21 Known possible problems: - The order of parsing (X, X2, X4, S) at the time of writing is arbitrary (and has been changed, the S was in front before, causing problems with IFC files outputted by other software). The ISO docs don't say anything about it. - Example: \X2\3010\X0\S\X2\301194DD540891D1\X0\, results will be different depending on whether the 'X2' is parsed first or the 'S' - This code will process the output of one encoding phase, and possibly use it in the next phase, this is most definitely not according to the standard. Somehow it should be marked which parts are still up for parsing and which parst aren't - Overall structure of the code is quite error prone, using a well known parser library/strategy might be better - One more note of frustration: It is completely insane to encode text within text
        Parameters:
        value - The original value
        lineNumber - , used for throwing exceptions with line numbers
        Returns:
        The decoded string
        Throws:
        org.bimserver.plugins.deserializers.DeserializeException
      • writePrimitive

        public static void writePrimitive​(Object val,
                                          OutputStream outputStream)
                                   throws org.bimserver.plugins.serializers.SerializerException,
                                          IOException
        Throws:
        org.bimserver.plugins.serializers.SerializerException
        IOException
      • writePrimitive

        public static void writePrimitive​(Object val,
                                          PrintWriter printWriter)
                                   throws org.bimserver.plugins.serializers.SerializerException,
                                          IOException
        Throws:
        org.bimserver.plugins.serializers.SerializerException
        IOException