Class GenericStoExSerialiserImpl

    • Constructor Detail

      • GenericStoExSerialiserImpl

        public GenericStoExSerialiserImpl​(javax.inject.Provider<org.eclipse.xtext.serializer.ISerializer> serialiserProvider)
        Constructs new serialiser instance.
    • Method Detail

      • serialiseWithoutTypeCheck

        protected String serialiseWithoutTypeCheck​(EObject stoexElement)
                                            throws NotSerializableException
        Serialises the given EObject assuming that the serialiser can handle that particular type of element.
        Parameters:
        stoexElement - The stoex element to seriale.
        Returns:
        The serialised representation of the stoex element.
        Throws:
        NotSerializableException - thrown if the serialisation fails.
      • createStoexElementCopy

        protected <T extends EObject> T createStoexElementCopy​(T eobject)
        Creates a copy of the given stoex element that will be contained in an XtextResource. This is necessary because the serialiser demands the expression to be in such a resource. Please note that this implementation changes the ResourceSet that transitively contains the stoex element. Therefore, the effect has to be undone as soon as the copy is not required anymore by calling removeStoexElementCopy(EObject).
        Parameters:
        eobject - The stoex element to copy.
        Returns:
        The copy of the stoex element.
        See Also:
        removeStoexElementCopy(EObject)
      • removeStoexElementCopy

        protected <T extends EObject> void removeStoexElementCopy​(T copy)
        Undoes the changes done by createStoexElementCopy(EObject).
        Parameters:
        copy - The stoex element copy.