Package org.java.plugin.tools.mocks
Class MockPluginDescriptor
- java.lang.Object
-
- org.java.plugin.tools.mocks.MockIdentity
-
- 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
Constructors Constructor Description MockPluginDescriptor()
No-arguments constructor.MockPluginDescriptor(java.lang.String id)
MockPluginDescriptor(java.lang.String id, Version aVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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 IDaVersion
- plug-in version
-
-
Method Detail
-
getAttribute
public PluginAttribute getAttribute(java.lang.String id)
- Specified by:
getAttribute
in interfacePluginDescriptor
- 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 interfacePluginDescriptor
- Returns:
- collection of
PluginAttribute
objects - See Also:
PluginDescriptor.getAttributes()
-
getAttributes
public java.util.Collection<PluginAttribute> getAttributes(java.lang.String id)
- Specified by:
getAttributes
in interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfacePluginDescriptor
- 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 interfaceUniqueIdentity
- Returns:
- unique ID of plug-in element
- See Also:
UniqueIdentity.getUniqueId()
-
getDocsPath
public java.lang.String getDocsPath()
- Specified by:
getDocsPath
in interfaceDocumentable<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 interfaceDocumentable<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
-
-