com.atlassian.confluence.content.render.xhtml.editor.link
Class EditorLinkUnmarshaller

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.editor.link.EditorLinkUnmarshaller
All Implemented Interfaces:
Unmarshaller<Link>

public class EditorLinkUnmarshaller
extends Object
implements Unmarshaller<Link>

Responsible for unmarshalling links in editor XML.

Currently, there are two strategies. One relies on resource id and type being declared in the link and the other on the actual link state (such as space key and title) being found as attributes on the link itself. We still need to retain the latter strategy due to unresolved links.


Constructor Summary
EditorLinkUnmarshaller(Unmarshaller<LinkBody<?>> linkBodyUnmarshaller, Unmarshaller<ResourceIdentifier> actualLinkStateAnalyzingResourceIdentifierUnmarshaller, Unmarshaller<ResourceIdentifier> idAndTypeResourceIdentifierUnmarshaller, ResourceIdentifierResolver<IdAndTypeResourceIdentifier,Object> idAndTypeResourceIdentifierResolver)
           
 
Method Summary
 boolean handles(StartElement startElementEvent, ConversionContext conversionContext)
          Determines whether or not this unmarshaller should be applied to a fragment with the specified start element.
 Link unmarshal(XMLEventReader reader, FragmentTransformer mainFragmentTransformer, ConversionContext conversionContext)
          Unmarshalls a StAX event stream to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorLinkUnmarshaller

public EditorLinkUnmarshaller(Unmarshaller<LinkBody<?>> linkBodyUnmarshaller,
                              Unmarshaller<ResourceIdentifier> actualLinkStateAnalyzingResourceIdentifierUnmarshaller,
                              Unmarshaller<ResourceIdentifier> idAndTypeResourceIdentifierUnmarshaller,
                              ResourceIdentifierResolver<IdAndTypeResourceIdentifier,Object> idAndTypeResourceIdentifierResolver)
Method Detail

unmarshal

public Link unmarshal(XMLEventReader reader,
                      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<Link>
Parameters:
reader - a reader over the fragment to unmarshall
mainFragmentTransformer - TODO
conversionContext - the conversion context
Returns:
the unmarshalled object
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<Link>
Parameters:
startElementEvent - start element
conversionContext - the conversion context
Returns:
true if this unmarshaller can be applied, false otherwise


Copyright © 2003–2015 Atlassian. All rights reserved.