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 ornullif 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, setDocumentationMethods inherited from class org.java.plugin.tools.mocks.MockIdentity
getId, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.java.plugin.registry.Documentable
getDocsPath, getDocumentationMethods 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:
getDeclaringExtensionin 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.ParameterReturns definition for this extension parameter. May returnnullfor "invalid" parameters.- Specified by:
getDefinitionin 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.ParameterReturns sub-parameter with given ID ornullif no sub-parameters exist. If more than one sub-parameters with given ID found, the method should throw anIllegalArgumentException.- Specified by:
getSubParameterin 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.ParameterReturns collection of all sub-parameters defined in this parameter.- Specified by:
getSubParametersin interfaceExtension.Parameter- Returns:
- collection of
Extension.Parameterobjects - See Also:
-
getSubParameters
- Specified by:
getSubParametersin 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:
getSuperParameterin interfaceExtension.Parameter- Returns:
- parameter, of which this one is child or
nullif this is top level parameter - See Also:
-
setSuperParameter
- Parameters:
value- the super parameter to set- Returns:
- this instance
-
rawValue
- Specified by:
rawValuein 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.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.BOOLEAN, this method should throw anUnsupportedOperationException.- Specified by:
valueAsBooleanin interfaceExtension.Parameter- Returns:
- value as Boolean object
- See Also:
-
valueAsDate
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.DATE,ParameterType.TIMEorParameterType.DATE_TIME, this method should throw anUnsupportedOperationException.- Specified by:
valueAsDatein interfaceExtension.Parameter- Returns:
- value as Date object
- See Also:
-
valueAsExtension
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.EXTENSION_ID, this method should throw anUnsupportedOperationException.- Specified by:
valueAsExtensionin interfaceExtension.Parameter- Returns:
- value as Extension object
- See Also:
-
valueAsExtensionPoint
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.EXTENSION_POINT_ID, this method should throw anUnsupportedOperationException.- Specified by:
valueAsExtensionPointin interfaceExtension.Parameter- Returns:
- value as ExtensionPoint object
- See Also:
-
valueAsNumber
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.NUMBER, this method should throw anUnsupportedOperationException.- Specified by:
valueAsNumberin interfaceExtension.Parameter- Returns:
- value as Number object
- See Also:
-
valueAsPluginDescriptor
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.PLUGIN_ID, this method should throw anUnsupportedOperationException.- Specified by:
valueAsPluginDescriptorin interfaceExtension.Parameter- Returns:
- value as PluginDescriptor object
- See Also:
-
valueAsString
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.STRING, this method should throw anUnsupportedOperationException.- Specified by:
valueAsStringin interfaceExtension.Parameter- Returns:
- value as String object
- See Also:
-
valueAsUrl
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.RESOURCE, this method should throw anUnsupportedOperationException.- Specified by:
valueAsUrlin interfaceExtension.Parameter- Returns:
- value as absolute or relative URL as specified in manifest
- See Also:
-
valueAsUrl
Description copied from interface:Extension.ParameterReturns "typed" value of parameter. If this parameter is invalid or is not of typeParameterType.RESOURCE, this method should throw anUnsupportedOperationException.- Specified by:
valueAsUrlin interfaceExtension.Parameter- Parameters:
pathResolver- path resolver to make URL absolute- Returns:
- value as absolute URL
- See Also:
-