Package org.java.plugin.tools.mocks
Class MockParameter
java.lang.Object
org.java.plugin.tools.mocks.MockIdentity
org.java.plugin.tools.mocks.MockPluginElement<Extension.Parameter>
org.java.plugin.tools.mocks.MockParameter
- All Implemented Interfaces:
Documentable<Extension.Parameter>
,Extension.Parameter
,Identity
,PluginElement<Extension.Parameter>
public class MockParameter
extends MockPluginElement<Extension.Parameter>
implements Extension.Parameter
- Version:
- $Id$
-
Constructor Summary
ConstructorsConstructorDescriptionNo-arguments constructor.MockParameter
(String id, String aRawValue, Object aTypedValue) MockParameter
(String id, String aRawValue, Object aTypedValue, Extension aDeclaringExtension) -
Method Summary
Modifier and TypeMethodDescriptionaddParameter
(Extension.Parameter parameter) Returns definition for this extension parameter.Returns sub-parameter with given ID ornull
if no sub-parameters exist.Returns collection of all sub-parameters defined in this parameter.rawValue()
setDeclaringExtension
(Extension value) Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.Returns "typed" value of parameter.valueAsUrl
(PathResolver pathResolver) Returns "typed" value of parameter.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
-
MockParameter
public MockParameter()No-arguments constructor. -
MockParameter
- Parameters:
id
- parameter IDaRawValue
- raw parameter valueaTypedValue
- typed parameter value
-
MockParameter
public MockParameter(String id, String aRawValue, Object aTypedValue, Extension aDeclaringExtension) - Parameters:
id
- parameter IDaRawValue
- raw parameter valueaTypedValue
- typed parameter valueaDeclaringExtension
- declaring extension
-
-
Method Details
-
getDeclaringExtension
- Specified by:
getDeclaringExtension
in interfaceExtension.Parameter
- Returns:
- extension this parameter belongs to
- See Also:
-
setDeclaringExtension
- Parameters:
value
- the declaring extension to set- Returns:
- this instance
-
getDefinition
Description copied from interface:Extension.Parameter
Returns definition for this extension parameter. May returnnull
for "invalid" parameters.- Specified by:
getDefinition
in interfaceExtension.Parameter
- Returns:
- parameter definition or
null
, if this parameter is "invalid" - See Also:
-
setDefinition
- Parameters:
value
- the parameter definition to set- Returns:
- this instance
-
getSubParameter
Description copied from interface:Extension.Parameter
Returns sub-parameter with given ID ornull
if no sub-parameters exist. If more than one sub-parameters with given ID found, the method should throw anIllegalArgumentException
.- Specified by:
getSubParameter
in interfaceExtension.Parameter
- Parameters:
id
- ID of sub-parameter to look for- Returns:
- sub-parameter with given ID
- See Also:
-
getSubParameters
Description copied from interface:Extension.Parameter
Returns collection of all sub-parameters defined in this parameter.- Specified by:
getSubParameters
in interfaceExtension.Parameter
- Returns:
- collection of
Extension.Parameter
objects - See Also:
-
getSubParameters
- Specified by:
getSubParameters
in interfaceExtension.Parameter
- Parameters:
id
- ID of sub-parameter to look for- Returns:
- collection of all sub-parameters with given ID
- See Also:
-
addParameter
- Parameters:
parameter
- sub-parameter to add- Returns:
- this instance
-
getSuperParameter
- Specified by:
getSuperParameter
in interfaceExtension.Parameter
- Returns:
- parameter, of which this one is child or
null
if this is top level parameter - See Also:
-
setSuperParameter
- Parameters:
value
- the super parameter to set- Returns:
- this instance
-
rawValue
- Specified by:
rawValue
in interfaceExtension.Parameter
- Returns:
- parameter value as it is specified in manifest, if no value provided there, this method should return empty string
- See Also:
-
setValue
- Parameters:
raw
- raw parameter valuetyped
- typed parameter value- Returns:
- this instance
-
valueAsBoolean
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.BOOLEAN
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsBoolean
in interfaceExtension.Parameter
- Returns:
- value as Boolean object
- See Also:
-
valueAsDate
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.DATE
,ParameterType.TIME
orParameterType.DATE_TIME
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsDate
in interfaceExtension.Parameter
- Returns:
- value as Date object
- See Also:
-
valueAsExtension
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.EXTENSION_ID
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsExtension
in interfaceExtension.Parameter
- Returns:
- value as Extension object
- See Also:
-
valueAsExtensionPoint
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.EXTENSION_POINT_ID
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsExtensionPoint
in interfaceExtension.Parameter
- Returns:
- value as ExtensionPoint object
- See Also:
-
valueAsNumber
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.NUMBER
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsNumber
in interfaceExtension.Parameter
- Returns:
- value as Number object
- See Also:
-
valueAsPluginDescriptor
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.PLUGIN_ID
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsPluginDescriptor
in interfaceExtension.Parameter
- Returns:
- value as PluginDescriptor object
- See Also:
-
valueAsString
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.STRING
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsString
in interfaceExtension.Parameter
- Returns:
- value as String object
- See Also:
-
valueAsUrl
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.RESOURCE
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsUrl
in interfaceExtension.Parameter
- Returns:
- value as absolute or relative URL as specified in manifest
- See Also:
-
valueAsUrl
Description copied from interface:Extension.Parameter
Returns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.RESOURCE
, this method should throw anUnsupportedOperationException
.- Specified by:
valueAsUrl
in interfaceExtension.Parameter
- Parameters:
pathResolver
- path resolver to make URL absolute- Returns:
- value as absolute URL
- See Also:
-