Class DefaultPlugger

  • All Implemented Interfaces:
    IPlugger

    public class DefaultPlugger
    extends java.lang.Object
    implements IPlugger
    This class is a default implementation of the IPlugger interface. The extension points are stored in an underlying HashMap.
    Since:
    1.0.0
    Author:
    Julien Seinturier - (c) 2009 - JOrigin project - http:/www.jorigin.org
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultPlugger()
      Create a new default plugger.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addExtensionPoint​(java.lang.String key, java.lang.Object extensionPoint)
      Add a new extension point to the plugger.
      java.lang.Object getExensionPoint​(java.lang.String key)
      Return the extension point referenced by the given key.
      java.lang.String[] getExtensionPointKeys()
      Return all the keys identifying extension points.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultPlugger

        public DefaultPlugger()
        Create a new default plugger.
    • Method Detail

      • addExtensionPoint

        public boolean addExtensionPoint​(java.lang.String key,
                                         java.lang.Object extensionPoint)
        Description copied from interface: IPlugger
        Add a new extension point to the plugger. The extension point is assigned to the key given. If the key is already affected to another extension point, the new extension point is not added.
        Specified by:
        addExtensionPoint in interface IPlugger
        Parameters:
        key - the key of the extension point to add
        extensionPoint - the extension point to add
        Returns:
        true if the extension point is added, false otherwise
      • getExensionPoint

        public java.lang.Object getExensionPoint​(java.lang.String key)
        Description copied from interface: IPlugger
        Return the extension point referenced by the given key. If the key does not patch a plugin, null is returned.
        Specified by:
        getExensionPoint in interface IPlugger
        Parameters:
        key - the key of the extension point.
        Returns:
        the extension point.
      • getExtensionPointKeys

        public java.lang.String[] getExtensionPointKeys()
        Description copied from interface: IPlugger
        Return all the keys identifying extension points.
        Specified by:
        getExtensionPointKeys in interface IPlugger
        Returns:
        an array of String representing the key referencing extension points.