Class StoragePlainTextLinkBodyUnmarshaller
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.storage.link.StoragePlainTextLinkBodyUnmarshaller
-
- All Implemented Interfaces:
Unmarshaller<PlainTextLinkBody>
public class StoragePlainTextLinkBodyUnmarshaller extends Object implements Unmarshaller<PlainTextLinkBody>
Handle a link body that is expected to contain only HTML encoded character data. This data will be decoded and returned in the PlainTextLinkBody.Any events encountered with the reader that are not characters or entity data are ignored.
-
-
Constructor Summary
Constructors Constructor Description StoragePlainTextLinkBodyUnmarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
handles(StartElement startElementEvent, ConversionContext conversionContext)
Determines whether or not this unmarshaller should be applied to a fragment with the specified start element.PlainTextLinkBody
unmarshal(XMLEventReader reader, FragmentTransformer mainFragmentTransformer, ConversionContext conversionContext)
Implementation Note: In actual use this Unmarshaller will be operating on a 'storage reader'.
-
-
-
Method Detail
-
unmarshal
public PlainTextLinkBody unmarshal(XMLEventReader reader, FragmentTransformer mainFragmentTransformer, ConversionContext conversionContext) throws XhtmlException
Implementation Note: In actual use this Unmarshaller will be operating on a 'storage reader'. The storage reader (com.atlassian.confluence.content.render.xhtml.DefaultXmlEventReaderFactory#createXmlEventReaderWithNamespaces(java.io.Reader, java.util.List, boolean)
actually performs entity replacement automatically.However to both allow for unit testing and for safety should the reader configuration change then this unmarshaller will also perform explicit HTML decoding on the link body read.
- Specified by:
unmarshal
in interfaceUnmarshaller<PlainTextLinkBody>
- Parameters:
reader
- a reader over the fragment to unmarshallmainFragmentTransformer
- TODOconversionContext
- the conversion context- Returns:
- the decoded PlainTextLinkBody
- Throws:
XhtmlException
- if some other problem occurs
-
handles
public boolean handles(StartElement startElementEvent, ConversionContext conversionContext)
Description copied from interface:Unmarshaller
Determines whether or not this unmarshaller should be applied to a fragment with the specified start element.- Specified by:
handles
in interfaceUnmarshaller<PlainTextLinkBody>
- Parameters:
startElementEvent
- start elementconversionContext
- the conversion context- Returns:
- true if this unmarshaller can be applied, false otherwise
-
-