Class EmfConverter


  • @Deprecated
    public class EmfConverter
    extends ConverterHelper
    Deprecated.
    Will be removed in next minor release.
    Converter between the XML/XMI/ECore and representation classes based on EMF.
    • Field Detail

      • VARIANT_APPLICATION_ALL_XML

        private static final VariantInfo VARIANT_APPLICATION_ALL_XML
        Deprecated.
      • VARIANT_APPLICATION_ECORE

        private static final VariantInfo VARIANT_APPLICATION_ECORE
        Deprecated.
      • VARIANT_APPLICATION_XMI

        private static final VariantInfo VARIANT_APPLICATION_XMI
        Deprecated.
      • VARIANT_APPLICATION_XML

        private static final VariantInfo VARIANT_APPLICATION_XML
        Deprecated.
      • VARIANT_TEXT_HTML

        private static final VariantInfo VARIANT_TEXT_HTML
        Deprecated.
      • VARIANT_TEXT_XML

        private static final VariantInfo VARIANT_TEXT_XML
        Deprecated.
    • Constructor Detail

      • EmfConverter

        public EmfConverter()
        Deprecated.
    • Method Detail

      • create

        protected <T extends org.eclipse.emf.ecore.EObject> EmfRepresentation<T> create​(MediaType mediaType,
                                                                                        T source)
        Deprecated.
        Creates the marshaling EmfRepresentation.
        Type Parameters:
        T -
        Parameters:
        mediaType - The target media type.
        source - The source object to marshal.
        Returns:
        The marshaling EmfRepresentation.
      • getObjectClasses

        public java.util.List<java.lang.Class<?>> getObjectClasses​(Variant source)
        Deprecated.
        Description copied from class: ConverterHelper
        Returns the list of object classes that can be converted from a given variant.
        Specified by:
        getObjectClasses in class ConverterHelper
        Parameters:
        source - The source variant.
        Returns:
        The list of object class that can be converted.
      • getVariants

        public java.util.List<VariantInfo> getVariants​(java.lang.Class<?> source)
        Deprecated.
        Description copied from class: ConverterHelper
        Returns the list of variants that can be converted from a given object class. The preferred variant should be set in first position.
        Specified by:
        getVariants in class ConverterHelper
        Parameters:
        source - The source object class.
        Returns:
        The list of variants that can be converted.
      • isCompatible

        protected boolean isCompatible​(Variant variant)
        Deprecated.
        Indicates if the given variant is compatible with the media types supported by this converter.
        Parameters:
        variant - The variant.
        Returns:
        True if the given variant is compatible with the media types supported by this converter.
      • score

        public float score​(java.lang.Object source,
                           Variant target,
                           Resource resource)
        Deprecated.
        Description copied from class: ConverterHelper
        Scores the affinity of this helper with the source class.
        Specified by:
        score in class ConverterHelper
        Parameters:
        source - The source object to convert.
        target - The expected representation metadata.
        resource - The calling resource.
        Returns:
        The affinity score of this helper.
      • score

        public <T> float score​(Representation source,
                               java.lang.Class<T> target,
                               Resource resource)
        Deprecated.
        Description copied from class: ConverterHelper
        Scores the affinity of this helper with the source class.
        Specified by:
        score in class ConverterHelper
        Parameters:
        source - The source representation to convert.
        target - The expected class of the Java object.
        resource - The calling resource.
        Returns:
        The affinity score of this helper.
      • toObject

        public <T> T toObject​(Representation source,
                              java.lang.Class<T> target,
                              Resource resource)
                       throws java.io.IOException
        Deprecated.
        Description copied from class: ConverterHelper
        Converts a Representation into a regular Java object.
        Specified by:
        toObject in class ConverterHelper
        Type Parameters:
        T - The expected class of the Java object.
        Parameters:
        source - The source representation to convert.
        target - The expected class of the Java object.
        resource - The calling resource.
        Returns:
        The converted Java object.
        Throws:
        java.io.IOException
      • toRepresentation

        public Representation toRepresentation​(java.lang.Object source,
                                               Variant target,
                                               Resource resource)
        Deprecated.
        Description copied from class: ConverterHelper
        Converts a regular Java object into a Representation.
        Specified by:
        toRepresentation in class ConverterHelper
        Parameters:
        source - The source object to convert.
        target - The expected representation metadata.
        resource - The calling resource.
        Returns:
        The converted representation.
      • updatePreferences

        public <T> void updatePreferences​(java.util.List<Preference<MediaType>> preferences,
                                          java.lang.Class<T> entity)
        Deprecated.
        Description copied from class: ConverterHelper
        Updates the preferences of the given ClientInfo object with conversion capabilities for the given entity class.
        Overrides:
        updatePreferences in class ConverterHelper
        Parameters:
        preferences - The media type preferences.
        entity - The entity class to convert.