com.atlassian.confluence.content.render.xhtml.storage.link
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StoragePlainTextLinkBodyUnmarshaller
public StoragePlainTextLinkBodyUnmarshaller()
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
(
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 interface Unmarshaller<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 interface Unmarshaller<PlainTextLinkBody>
- Parameters:
startElementEvent
- start elementconversionContext
- the conversion context
- Returns:
- true if this unmarshaller can be applied, false otherwise
Copyright © 2003–2015 Atlassian. All rights reserved.