gate.creole
Class Parameter

java.lang.Object
  extended by gate.creole.Parameter
All Implemented Interfaces:
Serializable

public class Parameter
extends Object
implements Serializable

Models a resource parameter.

See Also:
Serialized Form

Field Summary
protected  URL baseURL
          The URL to the creole.xml file that defines the resource this parameter belongs to.
protected  Class paramClass
          The Class for the parameter type
protected  ResourceData resData
          The resource data that this parameter is part of.
 
Constructor Summary
Parameter(URL baseUrl)
          Constructor
 
Method Summary
 Object calculateDefaultValue()
          Calculate and return the default value for this parameter
 Object calculateValueFromString(String stringValue)
          Calculate and return the value for this parameter starting from a String
 String getComment()
          Get the comment for this parameter
 Object getDefaultValue()
          Get the default value for this parameter.
 String getDefaultValueString()
          Get the default value string (unprocessed, from the metadata) for the parameter
 String gethelpURL()
          Get the helpURL for this parameter
 String getItemClassName()
          If this parameter is a List type this will return the type of the items in the list.
 String getName()
          Get the name for this parameter
protected  Class getParameterClass()
          Find the class for this parameter type.
 Set getSuffixes()
          Get the suffixes atached with this param.
 String getTypeName()
          Get the type name for this parameter
 boolean isOptional()
          Is the parameter optional?
 boolean isRuntime()
          Is the parameter runtime?
 void setComment(String comment)
          Set the comment for this parameter
 void setDefaultValueString(String defaultValueString)
          Set the default value string (from the metadata) for the parameter
 void sethelpURL(String helpURL)
          Set the helpURL for this parameter
 void setName(String name)
          Set the name for this parameter
 void setOptional(boolean optional)
          Set optionality of this parameter
 void setRuntime(boolean runtime)
          Set runtime status of this parameter
 void setTypeName(String typeName)
          Set the type name for this parameter
 String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resData

protected ResourceData resData
The resource data that this parameter is part of.


baseURL

protected URL baseURL
The URL to the creole.xml file that defines the resource this parameter belongs to. It is used for deriving default values for parameters of type URL.


paramClass

protected Class paramClass
The Class for the parameter type

Constructor Detail

Parameter

public Parameter(URL baseUrl)
Constructor

Parameters:
baseUrl - the URL to the creole.xml file that defines the resource this parameter belongs to. This will be used a context when deriving default values for the parameters of type URL.
Method Detail

setTypeName

public void setTypeName(String typeName)
Set the type name for this parameter


getTypeName

public String getTypeName()
Get the type name for this parameter


setOptional

public void setOptional(boolean optional)
Set optionality of this parameter


isOptional

public boolean isOptional()
Is the parameter optional?


calculateDefaultValue

public Object calculateDefaultValue()
                             throws ParameterException
Calculate and return the default value for this parameter

Throws:
ParameterException

calculateValueFromString

public Object calculateValueFromString(String stringValue)
                                throws ParameterException
Calculate and return the value for this parameter starting from a String

Throws:
ParameterException

getDefaultValue

public Object getDefaultValue()
                       throws ParameterException
Get the default value for this parameter. If the value is currently null it will try and calculate a value.

Throws:
ParameterException
See Also:
calculateDefaultValue()

setDefaultValueString

public void setDefaultValueString(String defaultValueString)
Set the default value string (from the metadata) for the parameter


getDefaultValueString

public String getDefaultValueString()
Get the default value string (unprocessed, from the metadata) for the parameter


setComment

public void setComment(String comment)
Set the comment for this parameter


getComment

public String getComment()
Get the comment for this parameter


sethelpURL

public void sethelpURL(String helpURL)
Set the helpURL for this parameter


gethelpURL

public String gethelpURL()
Get the helpURL for this parameter


setName

public void setName(String name)
Set the name for this parameter


getName

public String getName()
Get the name for this parameter


getSuffixes

public Set getSuffixes()
Get the suffixes atached with this param. If it's null then there are no suffices attached with it


setRuntime

public void setRuntime(boolean runtime)
Set runtime status of this parameter


isRuntime

public boolean isRuntime()
Is the parameter runtime?


getParameterClass

protected Class getParameterClass()
                           throws ParameterException
Find the class for this parameter type.

Throws:
ParameterException

toString

public String toString()
String representation

Overrides:
toString in class Object

getItemClassName

public String getItemClassName()
If this parameter is a List type this will return the type of the items in the list. If the type is null String will be assumed.