Class EmfRepresentation<T extends org.eclipse.emf.ecore.EObject>

  • Type Parameters:
    T - The type to wrap.

    @Deprecated
    public class EmfRepresentation<T extends org.eclipse.emf.ecore.EObject>
    extends OutputRepresentation
    Deprecated.
    Will be removed in next minor release.
    Representation based on the EMF library. By default, it can serialize and deserialize automatically in either XML, XMI or ECore.
    See Also:
    EMF project
    • Field Detail

      • lineWidth

        private volatile int lineWidth
        Deprecated.
        The maximum number of characters per line.
      • object

        private volatile T extends org.eclipse.emf.ecore.EObject object
        Deprecated.
        The (parsed) object to format.
      • representation

        private volatile Representation representation
        Deprecated.
        The representation to parse.
      • usingEncodedAttributeStyle

        private volatile boolean usingEncodedAttributeStyle
        Deprecated.
        Indicates if EMF references should be written as URI anchors.
    • Constructor Detail

      • EmfRepresentation

        public EmfRepresentation​(Representation representation)
        Deprecated.
        Constructor.
        Parameters:
        representation - The representation to parse.
    • Method Detail

      • createEmfResource

        protected org.eclipse.emf.ecore.resource.Resource createEmfResource​(MediaType mediaType)
        Deprecated.
        Creates and configure an EMF resource. Not to be confused with a Restlet resource. By default, it calls createEmfXmlResource(MediaType).
        Parameters:
        mediaType - The associated media type.
        Returns:
        A new configured EMF resource.
      • createEmfXmlResource

        protected org.eclipse.emf.ecore.xmi.XMLResource createEmfXmlResource​(MediaType mediaType)
        Deprecated.
        Creates and configure an EMF resource. Not to be confused with a Restlet resource.
        Parameters:
        mediaType - The associated media type (ECore, XMI or XML).
        Returns:
        A new configured EMF resource.
      • getLineWidth

        public int getLineWidth()
        Deprecated.
        Returns the maximum number of characters per line. Defaults to 80.
        Returns:
        The maximum number of characters per line.
      • getLoadOptions

        protected java.util.Map<?,​?> getLoadOptions()
        Deprecated.
        Returns the loading options. Null by default.
        Returns:
        The loading options.
      • getObject

        public T getObject()
                    throws java.io.IOException
        Deprecated.
        Returns the wrapped object either parsed from the representation or to be formatted.
        Returns:
        The wrapped object.
        Throws:
        java.io.IOException
      • getSaveOptions

        protected java.util.Map<?,​?> getSaveOptions()
        Deprecated.
        Returns the saving options. Null by default.
        Returns:
        The saving options.
      • isUsingEncodedAttributeStyle

        public boolean isUsingEncodedAttributeStyle()
        Deprecated.
        Indicates if EMF references should be written as URI anchors.
        Returns:
        True if EMF references should be written as URI anchors.
      • setLineWidth

        public void setLineWidth​(int lineWidth)
        Deprecated.
        Sets the maximum number of characters per line.
        Parameters:
        lineWidth - The maximum number of characters per line.
      • setUsingEncodedAttributeStyle

        public void setUsingEncodedAttributeStyle​(boolean usingEncodedAttributeStyle)
        Deprecated.
        Indicates if EMF references should be written as URI anchors.
        Parameters:
        usingEncodedAttributeStyle - True if EMF references should be written as URI anchors.
      • write

        public void write​(org.eclipse.emf.ecore.EObject object,
                          java.io.OutputStream outputStream)
                   throws java.io.IOException
        Deprecated.
        Writes the representation based on a given EMF object.
        Parameters:
        object - The EMF object to serialize.
        outputStream - The target output stream.
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.OutputStream outputStream)
                   throws java.io.IOException
        Deprecated.
        If this representation wraps an EObject, then it tries to write it as either XML, XMI or ECore/EMOF depending on the media type set. Note that in order to write this EObject, an EMF resource is created, configured for proper serialization and the EObject is then added to the content of this resource. This could has a side effect of removing it from a previous resource/container.
        Specified by:
        write in class Representation
        Parameters:
        outputStream - The output stream.
        Throws:
        java.io.IOException