Class ImageLinkEmoticonUnmarshaller

  • All Implemented Interfaces:
    Unmarshaller<Emoticon>

    public class ImageLinkEmoticonUnmarshaller
    extends Object
    implements Unmarshaller<Emoticon>
    Due to CONFSERVER-52441, instances may have emoticons which have been incorrectly stored as images. This unmarshaller will handle such content by converting it to a valid emoticon object.
    • Constructor Detail

      • ImageLinkEmoticonUnmarshaller

        public ImageLinkEmoticonUnmarshaller()
    • Method Detail

      • handles

        public boolean handles​(StartElement startElementEvent,
                               ConversionContext conversionContext)
        Handle elements with the "emoticon" class and the emoticon-[type] attribute where [type] is a valid Confluence emoticon
        Specified by:
        handles in interface Unmarshaller<Emoticon>
        Parameters:
        startElementEvent - start element
        conversionContext - the conversion context
        Returns:
        true if this unmarshaller can be applied, false otherwise
      • unmarshal

        public Emoticon unmarshal​(XMLEventReader xmlEventReader,
                                  FragmentTransformer mainFragmentTransformer,
                                  ConversionContext conversionContext)
                           throws XhtmlException
        Description copied from interface: Unmarshaller
        Unmarshalls a StAX event stream to an object.
        Specified by:
        unmarshal in interface Unmarshaller<Emoticon>
        Parameters:
        xmlEventReader - a reader over the fragment to unmarshall
        mainFragmentTransformer - TODO
        conversionContext - the conversion context
        Returns:
        the emoticon represented in the supplied XMLEventReader or throws an exception if no Emoticon can be created.
        Throws:
        XhtmlException - if some other problem occurs