org.scribble.protocol.model
Class DefaultVisitor

java.lang.Object
  extended by org.scribble.protocol.model.DefaultVisitor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
InteractionUtil.InitialInteractionVisitor, RoleUtil.RoleLocator

public class DefaultVisitor
extends Object
implements Visitor

This class provides a default visitor which can be used to traverse a model.


Constructor Summary
DefaultVisitor()
          This is the default constructor.
DefaultVisitor(boolean defaultGroupReturn)
          This constructor configures the default group return value.
 
Method Summary
 void accept(End elem)
          This method visits an end statement.
 void accept(Inline elem)
          This method visits a use component.
 void accept(Interaction elem)
          This method visits an interaction component.
 void accept(Introduces elem)
          This method visits the role list.
 void accept(ProtocolImport elem)
          This method visits a protocol import component.
 void accept(ProtocolImportList elem)
          This method visits an import component.
 void accept(Recursion elem)
          This method visits a recursion component.
 void accept(Run elem)
          This method indicates the start of a run construct.
 void accept(TypeImport elem)
          This method visits a type component.
 void accept(TypeImportList elem)
          This method visits an import component.
 void end(Block elem)
          This method indicates the end of a block.
 void end(Choice elem)
          This method indicates the end of a choice.
 void end(DirectedChoice elem)
          This method indicates the end of a directed choice.
 void end(Do elem)
          This method indicates the end of a try escape.
 void end(Interrupt elem)
          This method indicates the end of a catch block.
 void end(OnMessage elem)
          This method indicates the end of a on-message.
 void end(Parallel elem)
          This method indicates the end of a parallel.
 void end(Protocol elem)
          This method indicates the end of a protocol.
 void end(RecBlock elem)
          This method indicates the end of a labelled block.
 void end(Repeat elem)
          This method indicates the end of a repeat.
 void end(Unordered elem)
          This method indicates the end of an Unordered construct.
 void setDefaultGroupReturn(boolean b)
          This method sets the default group construct return value.
 boolean start(Block elem)
          This method indicates the start of a block.
 boolean start(Choice elem)
          This method indicates the start of a choice.
 boolean start(DirectedChoice elem)
          This method indicates the start of a directed choice.
 boolean start(Do elem)
          This method indicates the start of a try escape.
 boolean start(Interrupt elem)
          This method indicates the start of a catch block.
 boolean start(OnMessage elem)
          This method indicates the start of a on-message.
 boolean start(Parallel elem)
          This method indicates the start of a parallel.
 boolean start(Protocol elem)
          This method indicates the start of a protocol.
 boolean start(RecBlock elem)
          This method indicates the start of a labelled block.
 boolean start(Repeat elem)
          This method indicates the start of a repeat.
 boolean start(Unordered elem)
          This method indicates the start of an Unordered construct.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultVisitor

public DefaultVisitor()
This is the default constructor.


DefaultVisitor

public DefaultVisitor(boolean defaultGroupReturn)
This constructor configures the default group return value.

Parameters:
defaultGroupReturn - The default group return value
Method Detail

setDefaultGroupReturn

public void setDefaultGroupReturn(boolean b)
This method sets the default group construct return value.

Parameters:
b - The value

start

public boolean start(Block elem)
This method indicates the start of a block.

Specified by:
start in interface Visitor
Parameters:
elem - The block
Returns:
Whether to process the contents

end

public void end(Block elem)
This method indicates the end of a block.

Specified by:
end in interface Visitor
Parameters:
elem - The block

accept

public void accept(TypeImportList elem)
This method visits an import component.

Specified by:
accept in interface Visitor
Parameters:
elem - The import

accept

public void accept(ProtocolImportList elem)
This method visits an import component.

Specified by:
accept in interface Visitor
Parameters:
elem - The import

accept

public void accept(Interaction elem)
This method visits an interaction component.

Specified by:
accept in interface Visitor
Parameters:
elem - The interaction

accept

public void accept(Inline elem)
This method visits a use component.

Specified by:
accept in interface Visitor
Parameters:
elem - The use component

accept

public void accept(Recursion elem)
This method visits a recursion component.

Specified by:
accept in interface Visitor
Parameters:
elem - The recursion

accept

public void accept(Introduces elem)
This method visits the role list.

Specified by:
accept in interface Visitor
Parameters:
elem - The role list

start

public boolean start(Protocol elem)
This method indicates the start of a protocol.

Specified by:
start in interface Visitor
Parameters:
elem - The protocol
Returns:
Whether to process the contents

end

public void end(Protocol elem)
This method indicates the end of a protocol.

Specified by:
end in interface Visitor
Parameters:
elem - The protocol

start

public boolean start(Choice elem)
This method indicates the start of a choice.

Specified by:
start in interface Visitor
Parameters:
elem - The choice
Returns:
Whether to process the contents

end

public void end(Choice elem)
This method indicates the end of a choice.

Specified by:
end in interface Visitor
Parameters:
elem - The choice

start

public boolean start(DirectedChoice elem)
This method indicates the start of a directed choice.

Specified by:
start in interface Visitor
Parameters:
elem - The directed choice
Returns:
Whether to process the contents

end

public void end(DirectedChoice elem)
This method indicates the end of a directed choice.

Specified by:
end in interface Visitor
Parameters:
elem - The directed choice

start

public boolean start(OnMessage elem)
This method indicates the start of a on-message.

Specified by:
start in interface Visitor
Parameters:
elem - The on-message element
Returns:
Whether to process the contents

end

public void end(OnMessage elem)
This method indicates the end of a on-message.

Specified by:
end in interface Visitor
Parameters:
elem - The on-message element

start

public boolean start(Parallel elem)
This method indicates the start of a parallel.

Specified by:
start in interface Visitor
Parameters:
elem - The parallel
Returns:
Whether to process the contents

end

public void end(Parallel elem)
This method indicates the end of a parallel.

Specified by:
end in interface Visitor
Parameters:
elem - The parallel

start

public boolean start(Repeat elem)
This method indicates the start of a repeat.

Specified by:
start in interface Visitor
Parameters:
elem - The repeat
Returns:
Whether to process the contents

end

public void end(Repeat elem)
This method indicates the end of a repeat.

Specified by:
end in interface Visitor
Parameters:
elem - The repeat

start

public boolean start(RecBlock elem)
This method indicates the start of a labelled block.

Specified by:
start in interface Visitor
Parameters:
elem - The labelled block
Returns:
Whether to process the contents

end

public void end(RecBlock elem)
This method indicates the end of a labelled block.

Specified by:
end in interface Visitor
Parameters:
elem - The labelled block

start

public boolean start(Unordered elem)
This method indicates the start of an Unordered construct.

Specified by:
start in interface Visitor
Parameters:
elem - The Unordered construct
Returns:
Whether to process the contents

end

public void end(Unordered elem)
This method indicates the end of an Unordered construct.

Specified by:
end in interface Visitor
Parameters:
elem - The Unordered construct

start

public boolean start(Do elem)
This method indicates the start of a try escape.

Specified by:
start in interface Visitor
Parameters:
elem - The try escape
Returns:
Whether to process the contents

end

public void end(Do elem)
This method indicates the end of a try escape.

Specified by:
end in interface Visitor
Parameters:
elem - The try escape

start

public boolean start(Interrupt elem)
This method indicates the start of a catch block.

Specified by:
start in interface Visitor
Parameters:
elem - The catch block
Returns:
Whether to process the contents

end

public void end(Interrupt elem)
This method indicates the end of a catch block.

Specified by:
end in interface Visitor
Parameters:
elem - The catch block

accept

public void accept(Run elem)
This method indicates the start of a run construct.

Specified by:
accept in interface Visitor
Parameters:
elem - The run

accept

public void accept(TypeImport elem)
This method visits a type component.

Specified by:
accept in interface Visitor
Parameters:
elem - The type

accept

public void accept(ProtocolImport elem)
This method visits a protocol import component.

Specified by:
accept in interface Visitor
Parameters:
elem - The protocol import

accept

public void accept(End elem)
This method visits an end statement.

Specified by:
accept in interface Visitor
Parameters:
elem - The end statement


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