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
public class MockExtensionPoint
- extends MockPluginElement<ExtensionPoint>
- implements ExtensionPoint
- Version:
- $Id$
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 |
Methods inherited from interface org.java.plugin.registry.Identity |
getId |
MockExtensionPoint
public MockExtensionPoint()
getAvailableExtension
public Extension getAvailableExtension(java.lang.String uniqueId)
- Specified by:
getAvailableExtension
in interface ExtensionPoint
- Parameters:
uniqueId
- unique ID of extension
- Returns:
- extension that is available for this point
- See Also:
ExtensionPoint.getAvailableExtension(
java.lang.String)
getAvailableExtensions
public java.util.Collection<Extension> getAvailableExtensions()
- Description copied from interface:
ExtensionPoint
- Returns a collection of all extensions that available for this point.
- Specified by:
getAvailableExtensions
in interface ExtensionPoint
- Returns:
- collection of
Extension
objects - See Also:
ExtensionPoint.getAvailableExtensions()
getConnectedExtension
public Extension getConnectedExtension(java.lang.String uniqueId)
- Specified by:
getConnectedExtension
in interface ExtensionPoint
- Parameters:
uniqueId
- unique ID of extension
- Returns:
- extension that was successfully "connected" to this point
- See Also:
ExtensionPoint.getConnectedExtension(
java.lang.String)
getConnectedExtensions
public java.util.Collection<Extension> getConnectedExtensions()
- Description copied from interface:
ExtensionPoint
- Returns a collection of all extensions that was successfully "connected"
to this point.
- Specified by:
getConnectedExtensions
in interface ExtensionPoint
- Returns:
- collection of
Extension
objects - See Also:
ExtensionPoint.getConnectedExtensions()
addExtension
public MockExtensionPoint addExtension(Extension extension,
boolean isConnected)
- Parameters:
extension
- extension to addisConnected
- if true
extension will be marked as
"connected" also
- Returns:
- this instance
getDescendants
public java.util.Collection<ExtensionPoint> 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 interface ExtensionPoint
- Returns:
- collection of
ExtensionPoint
objects - See Also:
ExtensionPoint.getDescendants()
addParameter
public MockExtensionPoint addParameter(ExtensionPoint extensionPoint)
- Parameters:
extensionPoint
- descendant extension to add
- Returns:
- this instance
getMultiplicity
public ExtensionMultiplicity getMultiplicity()
- Specified by:
getMultiplicity
in interface ExtensionPoint
- Returns:
- multiplicity of this extension point
- See Also:
ExtensionPoint.getMultiplicity()
setMultiplicity
public MockExtensionPoint setMultiplicity(ExtensionMultiplicity value)
- Parameters:
value
- the multiplicity to set
- Returns:
- this instance
getParameterDefinition
public ExtensionPoint.ParameterDefinition getParameterDefinition(java.lang.String id)
- Specified by:
getParameterDefinition
in interface ExtensionPoint
- Parameters:
id
- ID of parameter definition to look for
- Returns:
- parameter definition with given ID
- See Also:
ExtensionPoint.getParameterDefinition(
java.lang.String)
getParameterDefinitions
public java.util.Collection<ExtensionPoint.ParameterDefinition> 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 interface ExtensionPoint
- Returns:
- collection of
ExtensionPoint.ParameterDefinition
objects - See Also:
ExtensionPoint.getParameterDefinitions()
addParameterDefinition
public MockExtensionPoint addParameterDefinition(ExtensionPoint.ParameterDefinition parameterDefinition)
- Parameters:
parameterDefinition
- parameter definition to add
- Returns:
- this instance
getParentExtensionPointId
public java.lang.String getParentExtensionPointId()
- Specified by:
getParentExtensionPointId
in interface ExtensionPoint
- Returns:
- parent extension point ID or
null
- See Also:
ExtensionPoint.getParentExtensionPointId()
setParentExtensionPoint
public MockExtensionPoint setParentExtensionPoint(java.lang.String pluginId,
java.lang.String extensionPointId)
- Parameters:
pluginId
- the parent plug-in id to setextensionPointId
- the parent extension point id to set
- Returns:
- this instance
getParentPluginId
public java.lang.String getParentPluginId()
- Specified by:
getParentPluginId
in interface ExtensionPoint
- Returns:
- parent extension point plug-in ID or
null
- See Also:
ExtensionPoint.getParentPluginId()
isExtensionAvailable
public boolean isExtensionAvailable(java.lang.String uniqueId)
- Description copied from interface:
ExtensionPoint
- Checks if extension is available for this extension point. If this method
returns
true
, the method
ExtensionPoint.getAvailableExtension(String)
should return valid extension for
the same UID.
- Specified by:
isExtensionAvailable
in interface ExtensionPoint
- Parameters:
uniqueId
- unique ID of extension
- Returns:
true
if extension is available for this extension
point- See Also:
ExtensionPoint.isExtensionAvailable(
java.lang.String)
isExtensionConnected
public boolean isExtensionConnected(java.lang.String uniqueId)
- Description copied from interface:
ExtensionPoint
- Checks if extension is in valid state and successfully "connected"
to this extension point. If this method returns
true
,
the method ExtensionPoint.getConnectedExtension(String)
should return
valid extension for the same UID.
- Specified by:
isExtensionConnected
in interface ExtensionPoint
- Parameters:
uniqueId
- unique ID of extension
- Returns:
true
if extension was successfully "connected" to
this extension point- See Also:
ExtensionPoint.isExtensionConnected(
java.lang.String)
isSuccessorOf
public boolean isSuccessorOf(ExtensionPoint extensionPoint)
- Specified by:
isSuccessorOf
in interface ExtensionPoint
- Parameters:
extensionPoint
- extension point
- Returns:
true
if this point is successor of given extension
point- See Also:
ExtensionPoint.isSuccessorOf(
org.java.plugin.registry.ExtensionPoint)
addPredecessors
public MockExtensionPoint addPredecessors(java.lang.String pluginId,
java.lang.String extensionPointId)
- 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 interface ExtensionPoint
- Returns:
true
if extension point is considered to be valid- See Also:
ExtensionPoint.isValid()
setValid
public MockExtensionPoint setValid(boolean value)
- Parameters:
value
- the valid flag 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()
Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.