Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.model.impl
Class ExtensionImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.impl.ExtensionImpl
All Implemented Interfaces:
Serializable, Extension

public class ExtensionImpl
extends Object
implements Extension

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Constructor Summary
ExtensionImpl()
           
 
Method Summary
 void dispose()
          Disposes this extension.
static ExtensionImpl fromXML(RuntimeContext context, String xml)
           
 ComponentInstance getComponent()
          Gets the component instance owning this extension.
 RuntimeContext getContext()
          Gets the context of the component who contributed this extension.
 Object[] getContributions()
          Gets the extension contribution objects.
 String getDocumentation()
          Gets any comment on this extension.
 Element getElement()
          Gets the DOM element held by this extension.
 String getExtensionPoint()
          Gets the extension point name where this extension should be contributed.
 String getId()
          Identifies the extension inside the contributing component.
 ComponentName getTargetComponent()
          Gets the component name where this extension should be contributed.
 void setComponent(ComponentInstance component)
          Sets the component owning this extension.
 void setContributions(Object[] contributions)
          Sets the contribution objects.
 void setElement(Element element)
          Sets the DOM element that defines this extension.
 String toString()
           
 String toXML()
          Gets the XML string for this extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionImpl

public ExtensionImpl()
Method Detail

dispose

public void dispose()
Description copied from interface: Extension
Disposes this extension.

This will erase any data held by the extension.

Specified by:
dispose in interface Extension

getElement

public Element getElement()
Description copied from interface: Extension
Gets the DOM element held by this extension.

The DOM element correspond to the "extension" element in the component XML descriptor.

Specified by:
getElement in interface Extension
Returns:
the DOM element

setElement

public void setElement(Element element)
Description copied from interface: Extension
Sets the DOM element that defines this extension.

Specified by:
setElement in interface Extension
Parameters:
element - the extension DOM element

getExtensionPoint

public String getExtensionPoint()
Description copied from interface: Extension
Gets the extension point name where this extension should be contributed.

Specified by:
getExtensionPoint in interface Extension
Returns:
the target extension point

getTargetComponent

public ComponentName getTargetComponent()
Description copied from interface: Extension
Gets the component name where this extension should be contributed.

Specified by:
getTargetComponent in interface Extension
Returns:
the target component name

getContributions

public Object[] getContributions()
Description copied from interface: Extension
Gets the extension contribution objects.

These objects are generated by the extension point from the DOM element and then attached to the extension.

Specified by:
getContributions in interface Extension
Returns:
the contribution objects or null if none

setContributions

public void setContributions(Object[] contributions)
Description copied from interface: Extension
Sets the contribution objects.

This method is used by the extension point to attach the contribution objects to the extension.

Specified by:
setContributions in interface Extension
Parameters:
contributions - the contribution objects

setComponent

public void setComponent(ComponentInstance component)
Description copied from interface: Extension
Sets the component owning this extension.

Specified by:
setComponent in interface Extension
Parameters:
component - the component instance owning this extension

getComponent

public ComponentInstance getComponent()
Description copied from interface: Extension
Gets the component instance owning this extension.

Specified by:
getComponent in interface Extension
Returns:
the component instance owning this extension

getContext

public RuntimeContext getContext()
Description copied from interface: Extension
Gets the context of the component who contributed this extension.

Specified by:
getContext in interface Extension
Returns:
the extension context

getId

public String getId()
Description copied from interface: Extension
Identifies the extension inside the contributing component. The id should be unique in the application. It is recommended to use the following name convention for the ID: 'component_name#contribution_name'.

The id is never null. If the user is not specifying an ID, one will be generated as follow: componentName#targetExtensionPoint.randomNumber

Specified by:
getId in interface Extension

getDocumentation

public String getDocumentation()
Description copied from interface: Extension
Gets any comment on this extension.

Comments can be used to document extensions.

Comments should be short because they are stored in memory.

Specified by:
getDocumentation in interface Extension

toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()
Gets the XML string for this extension.

Specified by:
toXML in interface Extension

fromXML

public static ExtensionImpl fromXML(RuntimeContext context,
                                    String xml)
                             throws Exception
Throws:
Exception

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.