JPF 1.5.1

org.java.plugin.tools.mocks
Class MockPluginDescriptor

java.lang.Object
  extended by org.java.plugin.tools.mocks.MockIdentity
      extended by org.java.plugin.tools.mocks.MockPluginDescriptor
All Implemented Interfaces:
Documentable<PluginDescriptor>, Identity, PluginDescriptor, UniqueIdentity

public class MockPluginDescriptor
extends MockIdentity
implements PluginDescriptor

Version:
$Id$

Constructor Summary
MockPluginDescriptor()
          No-arguments constructor.
MockPluginDescriptor(java.lang.String id)
           
MockPluginDescriptor(java.lang.String id, Version aVersion)
           
 
Method Summary
 MockPluginDescriptor addAttribute(PluginAttribute attribute)
           
 MockPluginDescriptor addExtension(Extension extension)
           
 MockPluginDescriptor addExtensionPoint(ExtensionPoint extPoint)
           
 MockPluginDescriptor addFragment(PluginFragment fragment)
           
 MockPluginDescriptor addLibrary(Library library)
           
 MockPluginDescriptor addPrerequisite(PluginPrerequisite pre)
           
 PluginAttribute getAttribute(java.lang.String id)
           
 java.util.Collection<PluginAttribute> getAttributes()
          Returns collection of all top level attributes defined in manifest.
 java.util.Collection<PluginAttribute> getAttributes(java.lang.String id)
           
 java.lang.String getDocsPath()
           
 Documentation<PluginDescriptor> getDocumentation()
           
 Extension getExtension(java.lang.String id)
           
 ExtensionPoint getExtensionPoint(java.lang.String id)
           
 java.util.Collection<ExtensionPoint> getExtensionPoints()
          Returns collection of all extension points defined in manifest.
 java.util.Collection<Extension> getExtensions()
          Returns collection of all extensions defined in manifest.
 java.util.Collection<PluginFragment> getFragments()
          Returns collection of plug-in fragments which contributes to this plug-in.
 java.util.Collection<Library> getLibraries()
          Returns collection of all libraries defined in manifest.
 Library getLibrary(java.lang.String id)
           
 java.net.URL getLocation()
           
 java.lang.String getPluginClassName()
           
 PluginPrerequisite getPrerequisite(java.lang.String id)
           
 java.util.Collection<PluginPrerequisite> getPrerequisites()
          Returns collection of all prerequisites defined in manifest.
 PluginRegistry getRegistry()
           
 java.lang.String getUniqueId()
           
 java.lang.String getVendor()
           
 Version getVersion()
           
 MockPluginDescriptor setDocsPath(java.lang.String value)
           
 MockPluginDescriptor setDocumentation(Documentation<PluginDescriptor> value)
           
 MockPluginDescriptor setLocation(java.net.URL value)
           
 MockPluginDescriptor setPluginClassName(java.lang.String value)
           
 MockPluginDescriptor setRegistry(PluginRegistry value)
           
 MockPluginDescriptor setVendor(java.lang.String value)
           
 MockPluginDescriptor setVersion(Version value)
           
 
Methods inherited from class org.java.plugin.tools.mocks.MockIdentity
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.java.plugin.registry.Identity
getId
 

Constructor Detail

MockPluginDescriptor

public MockPluginDescriptor()
No-arguments constructor.


MockPluginDescriptor

public MockPluginDescriptor(java.lang.String id)
Parameters:
id - plug-in ID

MockPluginDescriptor

public MockPluginDescriptor(java.lang.String id,
                            Version aVersion)
Parameters:
id - plug-in ID
aVersion - plug-in version
Method Detail

getAttribute

public PluginAttribute getAttribute(java.lang.String id)
Specified by:
getAttribute in interface PluginDescriptor
Parameters:
id - ID of attribute to look for
Returns:
top level attribute with given ID
See Also:
PluginDescriptor.getAttribute( java.lang.String)

getAttributes

public java.util.Collection<PluginAttribute> getAttributes()
Description copied from interface: PluginDescriptor
Returns collection of all top level attributes defined in manifest.

Specified by:
getAttributes in interface PluginDescriptor
Returns:
collection of PluginAttribute objects
See Also:
PluginDescriptor.getAttributes()

getAttributes

public java.util.Collection<PluginAttribute> getAttributes(java.lang.String id)
Specified by:
getAttributes in interface PluginDescriptor
Parameters:
id - ID of attribute to look for
Returns:
collection of all top level attributes with given ID
See Also:
PluginDescriptor.getAttributes( java.lang.String)

addAttribute

public MockPluginDescriptor addAttribute(PluginAttribute attribute)
Parameters:
attribute - attribute to add
Returns:
this instance

getExtension

public Extension getExtension(java.lang.String id)
Specified by:
getExtension in interface PluginDescriptor
Parameters:
id - extension ID
Returns:
extension object or null
See Also:
PluginDescriptor.getExtension( java.lang.String)

getExtensionPoint

public ExtensionPoint getExtensionPoint(java.lang.String id)
Specified by:
getExtensionPoint in interface PluginDescriptor
Parameters:
id - extension point ID
Returns:
extension point object or null
See Also:
PluginDescriptor.getExtensionPoint( java.lang.String)

getExtensionPoints

public java.util.Collection<ExtensionPoint> getExtensionPoints()
Description copied from interface: PluginDescriptor
Returns collection of all extension points defined in manifest.

Specified by:
getExtensionPoints in interface PluginDescriptor
Returns:
collection of ExtensionPoint objects
See Also:
PluginDescriptor.getExtensionPoints()

getExtensions

public java.util.Collection<Extension> getExtensions()
Description copied from interface: PluginDescriptor
Returns collection of all extensions defined in manifest.

Specified by:
getExtensions in interface PluginDescriptor
Returns:
collection of Extension objects
See Also:
PluginDescriptor.getExtensions()

addExtensionPoint

public MockPluginDescriptor addExtensionPoint(ExtensionPoint extPoint)
Parameters:
extPoint - extension point to add
Returns:
this instance

addExtension

public MockPluginDescriptor addExtension(Extension extension)
Parameters:
extension - extension to add
Returns:
this instance

getFragments

public java.util.Collection<PluginFragment> getFragments()
Description copied from interface: PluginDescriptor
Returns collection of plug-in fragments which contributes to this plug-in. One plug-in fragment may contribute to several versions of the same plug-in, according to it's manifest.

Specified by:
getFragments in interface PluginDescriptor
Returns:
collection of PluginFragment objects
See Also:
PluginDescriptor.getFragments()

addFragment

public MockPluginDescriptor addFragment(PluginFragment fragment)
Parameters:
fragment - plug-in fragment to add
Returns:
this instance

getLibraries

public java.util.Collection<Library> getLibraries()
Description copied from interface: PluginDescriptor
Returns collection of all libraries defined in manifest.

Specified by:
getLibraries in interface PluginDescriptor
Returns:
collection of Library objects
See Also:
PluginDescriptor.getLibraries()

addLibrary

public MockPluginDescriptor addLibrary(Library library)
Parameters:
library - library to add
Returns:
this instance

getLibrary

public Library getLibrary(java.lang.String id)
Specified by:
getLibrary in interface PluginDescriptor
Parameters:
id - library ID
Returns:
library object or null
See Also:
PluginDescriptor.getLibrary( java.lang.String)

getLocation

public java.net.URL getLocation()
Specified by:
getLocation in interface PluginDescriptor
Returns:
location from which this plug-in was registered
See Also:
PluginDescriptor.getLocation()

setLocation

public MockPluginDescriptor setLocation(java.net.URL value)
Parameters:
value - the location to set
Returns:
this instance

getPluginClassName

public java.lang.String getPluginClassName()
Specified by:
getPluginClassName in interface PluginDescriptor
Returns:
plug-in class name as specified in manifest file or null
See Also:
PluginDescriptor.getPluginClassName()

setPluginClassName

public MockPluginDescriptor setPluginClassName(java.lang.String value)
Parameters:
value - the plug-in class name to set
Returns:
this instance

getPrerequisite

public PluginPrerequisite getPrerequisite(java.lang.String id)
Specified by:
getPrerequisite in interface PluginDescriptor
Parameters:
id - prerequisite ID
Returns:
plug-in prerequisite object instance or null
See Also:
PluginDescriptor.getPrerequisite( java.lang.String)

getPrerequisites

public java.util.Collection<PluginPrerequisite> getPrerequisites()
Description copied from interface: PluginDescriptor
Returns collection of all prerequisites defined in manifest.

Specified by:
getPrerequisites in interface PluginDescriptor
Returns:
collection of PluginPrerequisite objects
See Also:
PluginDescriptor.getPrerequisites()

addPrerequisite

public MockPluginDescriptor addPrerequisite(PluginPrerequisite pre)
Parameters:
pre - plug-in prerequisite to add
Returns:
this instance

getRegistry

public PluginRegistry getRegistry()
Specified by:
getRegistry in interface PluginDescriptor
Returns:
plug-ins registry
See Also:
PluginDescriptor.getRegistry()

setRegistry

public MockPluginDescriptor setRegistry(PluginRegistry value)
Parameters:
value - the registry to set
Returns:
this instance

getVendor

public java.lang.String getVendor()
Specified by:
getVendor in interface PluginDescriptor
Returns:
vendor as specified in manifest file or empty string
See Also:
PluginDescriptor.getVendor()

setVendor

public MockPluginDescriptor setVendor(java.lang.String value)
Parameters:
value - the vendor to set
Returns:
this instance

getVersion

public Version getVersion()
Specified by:
getVersion in interface PluginDescriptor
Returns:
plug-in version identifier as specified in manifest file
See Also:
PluginDescriptor.getVersion()

setVersion

public MockPluginDescriptor setVersion(Version value)
Parameters:
value - the version to set
Returns:
this instance

getUniqueId

public java.lang.String getUniqueId()
Specified by:
getUniqueId in interface UniqueIdentity
Returns:
unique ID of plug-in element
See Also:
UniqueIdentity.getUniqueId()

getDocsPath

public java.lang.String getDocsPath()
Specified by:
getDocsPath in interface Documentable<PluginDescriptor>
Returns:
path to documentation "home", it is used for resolving documentation references
See Also:
Documentable.getDocsPath()

setDocsPath

public MockPluginDescriptor setDocsPath(java.lang.String value)
Parameters:
value - the docs path to set
Returns:
this instance

getDocumentation

public Documentation<PluginDescriptor> getDocumentation()
Specified by:
getDocumentation in interface Documentable<PluginDescriptor>
Returns:
plug-in element documentation object or null if there is no documentation provided
See Also:
Documentable.getDocumentation()

setDocumentation

public MockPluginDescriptor setDocumentation(Documentation<PluginDescriptor> value)
Parameters:
value - the documentation to set
Returns:
this instance

JPF 1.5.1

Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.