org.xwiki.rendering.internal.renderer.xhtml.image
Class DefaultXHTMLImageRenderer

java.lang.Object
  extended by org.xwiki.rendering.internal.renderer.xhtml.image.DefaultXHTMLImageRenderer
All Implemented Interfaces:
Initializable, XHTMLImageRenderer, ImageListener

@Component
@InstantiationStrategy(value=PER_LOOKUP)
public class DefaultXHTMLImageRenderer
extends Object
implements XHTMLImageRenderer, Initializable

Default implementation for rendering images as XHTML. We handle both cases:

Since:
2.0M3

Field Summary
 
Fields inherited from interface org.xwiki.rendering.internal.renderer.xhtml.image.XHTMLImageRenderer
ALTERNATE, IMG, SRC
 
Constructor Summary
DefaultXHTMLImageRenderer()
           
 
Method Summary
 XHTMLWikiPrinter getXHTMLWikiPrinter()
           
 void initialize()
          Method called by the Component Manager when the component is created for the first time (i.e.
 void onImage(ResourceReference reference, boolean isFreeStandingURI, Map<String,String> parameters)
          An image.
 void setXHTMLWikiPrinter(XHTMLWikiPrinter printer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXHTMLImageRenderer

public DefaultXHTMLImageRenderer()
Method Detail

initialize

public void initialize()
                throws InitializationException
Description copied from interface: Initializable
Method called by the Component Manager when the component is created for the first time (i.e. when it's looked up for the first time or if the component is specified as being loaded on startup). If the component instantiation strategy is singleton then this method is called only once during the lifecycle of the Component Manager. Otherwise the component is created at each lookup and thus this method is called at each lookup too.

Specified by:
initialize in interface Initializable
Throws:
InitializationException - if an error happens during a component's initialization

setXHTMLWikiPrinter

public void setXHTMLWikiPrinter(XHTMLWikiPrinter printer)
Specified by:
setXHTMLWikiPrinter in interface XHTMLImageRenderer
Parameters:
printer - the XHTML printer to use to output images as XHTML

getXHTMLWikiPrinter

public XHTMLWikiPrinter getXHTMLWikiPrinter()
Specified by:
getXHTMLWikiPrinter in interface XHTMLImageRenderer
Returns:
the XHTML printer to use to output images as XHTML

onImage

public void onImage(ResourceReference reference,
                    boolean isFreeStandingURI,
                    Map<String,String> parameters)
An image.

Specified by:
onImage in interface ImageListener
Parameters:
reference - the image reference
isFreeStandingURI - if true then the image is defined directly as a URI in the text
parameters - a generic list of parameters. Example: style="background-color: blue"
Since:
2.5RC1
See Also:
ImageListener.onImage(org.xwiki.rendering.listener.reference.ResourceReference , boolean, java.util.Map)