public class DelegatingLinkMarshaller extends Object implements Marshaller<Link>
Constructor and Description |
---|
DelegatingLinkMarshaller(Map<String,Marshaller<Link>> marshallersByClassSimpleName,
ResourceIdentifierContextUtility resourceIdentifierContextUtility) |
Modifier and Type | Method and Description |
---|---|
protected Marshaller<Link> |
getMarshallerForResourceIdentifier(ResourceIdentifier ri) |
protected ResourceIdentifier |
getResourceIdentifier(Link link,
ConversionContext conversionContext) |
Streamable |
marshal(Link link,
ConversionContext conversionContext)
Marshals an object to XML.
|
public DelegatingLinkMarshaller(Map<String,Marshaller<Link>> marshallersByClassSimpleName, ResourceIdentifierContextUtility resourceIdentifierContextUtility)
marshallersByClassSimpleName
- a Map where the keys are the simple names (Class.getSimpleName()
)
of ResourceIdentifier
and the values are the Marshaller suitable for handling that type of resource
identifier.resourceIdentifierContextUtility
- a utility capable of converting relative ResourceIdentifiers to being absolute.public Streamable marshal(Link link, ConversionContext conversionContext) throws XhtmlException
Marshaller
marshal
in interface Marshaller<Link>
link
- object to marshalconversionContext
- the conversion contextXhtmlException
- if an error occurs during marshallingprotected ResourceIdentifier getResourceIdentifier(Link link, ConversionContext conversionContext) throws XhtmlException
XhtmlException
protected Marshaller<Link> getMarshallerForResourceIdentifier(ResourceIdentifier ri)
Copyright © 2003–2020 Atlassian. All rights reserved.