org.apache.tapestry.spec
Class ParameterSpecification

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.spec.ParameterSpecification
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IParameterSpecification

public class ParameterSpecification
extends org.apache.hivemind.impl.BaseLocatable
implements IParameterSpecification

Defines a formal parameter to a component. A IParameterSpecification is contained by a IComponentSpecification.

TBD: Identify arrays in some way.

Author:
Howard Lewis Ship

Constructor Summary
ParameterSpecification()
           
 
Method Summary
 Collection getAliasNames()
          Returns a non-null collection of strings for the aliases of the parameter.
 boolean getCache()
          Returns true if the parameter property should cache the result of the binding.
 String getDefaultValue()
          Returns the default value for the parameter (or null if the parameter has no default value).
 String getDescription()
          Returns the documentation for this parameter.
 String getParameterName()
          Returns the (primary) name of the parameter.
 String getPropertyName()
          Returns the name of the JavaBeans property to connect the parameter to.
 String getType()
          Returns the class name of the expected type of the parameter.
 boolean isDeprecated()
          Returns true if the parameter is deprecated.
 boolean isRequired()
          Returns true if the parameter is required by the component.
 void setAliases(String nameList)
          Sets the list of aliases as a comma-seperated list.
 void setCache(boolean cache)
           
 void setDefaultValue(String defaultValue)
          Sets the default value of the JavaBeans property if no binding is provided.
 void setDeprecated(boolean deprecated)
           
 void setDescription(String description)
          Sets the documentation for this parameter.
 void setParameterName(String name)
           
 void setPropertyName(String propertyName)
          Sets the property name (of the component class) to connect the parameter to.
 void setRequired(boolean value)
           
 void setType(String value)
          Sets the type of value expected for the parameter.
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ParameterSpecification

public ParameterSpecification()
Method Detail

getType

public String getType()
Returns the class name of the expected type of the parameter. The default value is java.lang.Object which matches anything.

Specified by:
getType in interface IParameterSpecification

isRequired

public boolean isRequired()
Returns true if the parameter is required by the component. The default is false, meaning the parameter is optional.

Specified by:
isRequired in interface IParameterSpecification

setRequired

public void setRequired(boolean value)
Specified by:
setRequired in interface IParameterSpecification

setType

public void setType(String value)
Sets the type of value expected for the parameter. This can be left blank to indicate any type.

Specified by:
setType in interface IParameterSpecification

getDescription

public String getDescription()
Returns the documentation for this parameter.

Specified by:
getDescription in interface IParameterSpecification
Since:
1.0.9

setDescription

public void setDescription(String description)
Sets the documentation for this parameter.

Specified by:
setDescription in interface IParameterSpecification
Since:
1.0.9

setPropertyName

public void setPropertyName(String propertyName)
Sets the property name (of the component class) to connect the parameter to.

Specified by:
setPropertyName in interface IParameterSpecification

getPropertyName

public String getPropertyName()
Returns the name of the JavaBeans property to connect the parameter to.

Specified by:
getPropertyName in interface IParameterSpecification

getDefaultValue

public String getDefaultValue()
Description copied from interface: IParameterSpecification
Returns the default value for the parameter (or null if the parameter has no default value). Required parameters may not have a default value. The default value is a binding locator (a prefixed value, as with a binding element).

Specified by:
getDefaultValue in interface IParameterSpecification
See Also:
IParameterSpecification.getDefaultValue()

setDefaultValue

public void setDefaultValue(String defaultValue)
Description copied from interface: IParameterSpecification
Sets the default value of the JavaBeans property if no binding is provided.

Specified by:
setDefaultValue in interface IParameterSpecification
See Also:
IParameterSpecification.setDefaultValue(java.lang.String)

getCache

public boolean getCache()
Description copied from interface: IParameterSpecification
Returns true if the parameter property should cache the result of the binding.

Specified by:
getCache in interface IParameterSpecification
Since:
4.0

setCache

public void setCache(boolean cache)
Specified by:
setCache in interface IParameterSpecification
Since:
4.0

getAliasNames

public Collection getAliasNames()
Description copied from interface: IParameterSpecification
Returns a non-null collection of strings for the aliases of the parameter. This is usually an empty list.

Specified by:
getAliasNames in interface IParameterSpecification
Since:
4.0

getParameterName

public String getParameterName()
Description copied from interface: IParameterSpecification
Returns the (primary) name of the parameter.

Specified by:
getParameterName in interface IParameterSpecification
Since:
4.0

setAliases

public void setAliases(String nameList)
Description copied from interface: IParameterSpecification
Sets the list of aliases as a comma-seperated list.

Specified by:
setAliases in interface IParameterSpecification
Parameters:
nameList - a comma seperated list of names, which may be null or empty
Since:
4.0

setParameterName

public void setParameterName(String name)
Specified by:
setParameterName in interface IParameterSpecification
Since:
4.0

isDeprecated

public boolean isDeprecated()
Description copied from interface: IParameterSpecification
Returns true if the parameter is deprecated. Deprecated parameter generate a warning when bound.

Specified by:
isDeprecated in interface IParameterSpecification
Since:
4.0

setDeprecated

public void setDeprecated(boolean deprecated)
Specified by:
setDeprecated in interface IParameterSpecification
Since:
4.0


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.