Package org.java.plugin.tools.mocks
Class MockExtensionPoint
java.lang.Object
org.java.plugin.tools.mocks.MockIdentity
org.java.plugin.tools.mocks.MockPluginElement<ExtensionPoint>
org.java.plugin.tools.mocks.MockExtensionPoint
- All Implemented Interfaces:
Documentable<ExtensionPoint>
,ExtensionPoint
,Identity
,PluginElement<ExtensionPoint>
,UniqueIdentity
- Version:
- $Id$
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.java.plugin.registry.ExtensionPoint
ExtensionPoint.ParameterDefinition
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExtension
(Extension extension, boolean isConnected) addParameter
(ExtensionPoint extensionPoint) addParameterDefinition
(ExtensionPoint.ParameterDefinition parameterDefinition) addPredecessors
(String pluginId, String extensionPointId) getAvailableExtension
(String uniqueId) Returns a collection of all extensions that available for this point.getConnectedExtension
(String uniqueId) Returns a collection of all extensions that was successfully "connected" to this point.Looks for all available (valid) successors of this extension point.Returns collection of all top level parameter definitions declared in this extension point and all it parents.boolean
isExtensionAvailable
(String uniqueId) Checks if extension is available for this extension point.boolean
isExtensionConnected
(String uniqueId) Checks if extension is in valid state and successfully "connected" to this extension point.boolean
isSuccessorOf
(ExtensionPoint extensionPoint) boolean
isValid()
setParentExtensionPoint
(String pluginId, String extensionPointId) setValid
(boolean value) Methods inherited from class org.java.plugin.tools.mocks.MockPluginElement
getDeclaringPluginDescriptor, getDeclaringPluginFragment, getDocsPath, getDocumentation, setDeclaringPluginDescriptor, setDeclaringPluginFragment, setDocsPath, setDocumentation
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.Documentable
getDocsPath, getDocumentation
Methods inherited from interface org.java.plugin.registry.PluginElement
getDeclaringPluginDescriptor, getDeclaringPluginFragment
-
Constructor Details
-
MockExtensionPoint
public MockExtensionPoint()
-
-
Method Details
-
getAvailableExtension
- Specified by:
getAvailableExtension
in interfaceExtensionPoint
- Parameters:
uniqueId
- unique ID of extension- Returns:
- extension that is available for this point
- See Also:
-
getAvailableExtensions
Description copied from interface:ExtensionPoint
Returns a collection of all extensions that available for this point.- Specified by:
getAvailableExtensions
in interfaceExtensionPoint
- Returns:
- collection of
Extension
objects - See Also:
-
getConnectedExtension
- Specified by:
getConnectedExtension
in interfaceExtensionPoint
- Parameters:
uniqueId
- unique ID of extension- Returns:
- extension that was successfully "connected" to this point
- See Also:
-
getConnectedExtensions
Description copied from interface:ExtensionPoint
Returns a collection of all extensions that was successfully "connected" to this point.- Specified by:
getConnectedExtensions
in interfaceExtensionPoint
- Returns:
- collection of
Extension
objects - See Also:
-
addExtension
- Parameters:
extension
- extension to addisConnected
- iftrue
extension will be marked as "connected" also- Returns:
- this instance
-
getDescendants
Description copied from interface:ExtensionPoint
Looks for all available (valid) successors of this extension point. The search should be done recursively including all descendants of this extension point.- Specified by:
getDescendants
in interfaceExtensionPoint
- Returns:
- collection of
ExtensionPoint
objects - See Also:
-
addParameter
- Parameters:
extensionPoint
- descendant extension to add- Returns:
- this instance
-
getMultiplicity
- Specified by:
getMultiplicity
in interfaceExtensionPoint
- Returns:
- multiplicity of this extension point
- See Also:
-
setMultiplicity
- Parameters:
value
- the multiplicity to set- Returns:
- this instance
-
getParameterDefinition
- Specified by:
getParameterDefinition
in interfaceExtensionPoint
- Parameters:
id
- ID of parameter definition to look for- Returns:
- parameter definition with given ID
- See Also:
-
getParameterDefinitions
Description copied from interface:ExtensionPoint
Returns collection of all top level parameter definitions declared in this extension point and all it parents.- Specified by:
getParameterDefinitions
in interfaceExtensionPoint
- Returns:
- collection of
ExtensionPoint.ParameterDefinition
objects - See Also:
-
addParameterDefinition
public MockExtensionPoint addParameterDefinition(ExtensionPoint.ParameterDefinition parameterDefinition) - Parameters:
parameterDefinition
- parameter definition to add- Returns:
- this instance
-
getParentExtensionPointId
- Specified by:
getParentExtensionPointId
in interfaceExtensionPoint
- Returns:
- parent extension point ID or
null
- See Also:
-
setParentExtensionPoint
- Parameters:
pluginId
- the parent plug-in id to setextensionPointId
- the parent extension point id to set- Returns:
- this instance
-
getParentPluginId
- Specified by:
getParentPluginId
in interfaceExtensionPoint
- Returns:
- parent extension point plug-in ID or
null
- See Also:
-
isExtensionAvailable
Description copied from interface:ExtensionPoint
Checks if extension is available for this extension point. If this method returnstrue
, the methodExtensionPoint.getAvailableExtension(String)
should return valid extension for the same UID.- Specified by:
isExtensionAvailable
in interfaceExtensionPoint
- Parameters:
uniqueId
- unique ID of extension- Returns:
true
if extension is available for this extension point- See Also:
-
isExtensionConnected
Description copied from interface:ExtensionPoint
Checks if extension is in valid state and successfully "connected" to this extension point. If this method returnstrue
, the methodExtensionPoint.getConnectedExtension(String)
should return valid extension for the same UID.- Specified by:
isExtensionConnected
in interfaceExtensionPoint
- Parameters:
uniqueId
- unique ID of extension- Returns:
true
if extension was successfully "connected" to this extension point- See Also:
-
isSuccessorOf
- Specified by:
isSuccessorOf
in interfaceExtensionPoint
- Parameters:
extensionPoint
- extension point- Returns:
true
if this point is successor of given extension point- See Also:
-
addPredecessors
- Parameters:
pluginId
- predecessor plug-in ID to addextensionPointId
- predecessor extension point ID to add- Returns:
- this instance
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceExtensionPoint
- Returns:
true
if extension point is considered to be valid- See Also:
-
setValid
- Parameters:
value
- the valid flag to set- Returns:
- this instance
-
getUniqueId
- Specified by:
getUniqueId
in interfaceUniqueIdentity
- Returns:
- unique ID of plug-in element
- See Also:
-