org.scribble.protocol.model
Class ParameterDefinition

java.lang.Object
  extended by org.scribble.protocol.model.ModelObject
      extended by org.scribble.protocol.model.ParameterDefinition

public class ParameterDefinition
extends ModelObject

This class represents a parameter.


Constructor Summary
ParameterDefinition()
          This is the default constructor.
ParameterDefinition(String name)
          This constructor initializes the parameter as representing a role with the supplied name.
 
Method Summary
 boolean equals(Object obj)
           
 String getName()
          This method returns the name of the parameter.
 Role getRole()
          This method returns the role associated with the parameter, if the parameter represents a role, otherwise null.
 TypeReference getType()
          This method returns the type of the parameter.
 int hashCode()
           
 boolean isRole()
          This method determines whether the parameter represents a role.
 void setName(String name)
          This method sets the name of the parameter.
 void setType(TypeReference type)
          This method sets the type of the parameter.
 String toString()
           
 void visit(Visitor visitor)
          This method visits the model object using the supplied visitor.
 
Methods inherited from class org.scribble.protocol.model.ModelObject
derivedFrom, getAnnotations, getModel, getParent, getProperties, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterDefinition

public ParameterDefinition()
This is the default constructor.


ParameterDefinition

public ParameterDefinition(String name)
This constructor initializes the parameter as representing a role with the supplied name.

Parameters:
name - The name
Method Detail

getName

public String getName()
This method returns the name of the parameter.

Returns:
The name

setName

public void setName(String name)
This method sets the name of the parameter.

Parameters:
name - The name

getType

public TypeReference getType()
This method returns the type of the parameter. If the type is null, then it means the parameter name represents a role.

Returns:
The type

setType

public void setType(TypeReference type)
This method sets the type of the parameter.

Parameters:
type - The type

isRole

public boolean isRole()
This method determines whether the parameter represents a role.

Returns:
Whether the parameter represents a role

getRole

public Role getRole()
This method returns the role associated with the parameter, if the parameter represents a role, otherwise null.

Returns:
The role, or null if parameter does not represent a role

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

visit

public void visit(Visitor visitor)
This method visits the model object using the supplied visitor.

Specified by:
visit in class ModelObject
Parameters:
visitor - The visitor


Copyright © 2008-Present Scribble.org. All Rights Reserved.