Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.sci.visitor
Class SciElementVisitorAdapter

public class SciElementVisitorAdapter
implements SciElementVisitor

`SciElementVisitorAdapter` class extends `SciElementVisitor` functionality by providing an additional method `visitElement`.

This method is used to perform the same actions for all kinds of `SciElement`s. For example, the `visitClass` perfoms a special action for a `SciClass` (represents a class/interface), which can be different from the action for a variable or a function, while `visitElement` method performs the same action for any `SciElement`:

     public class MyVisitor extends SciElementVisitorAdapter{
      public Object visitVariable(SciVariable variable){
         IdeMessageManagerAccess.printMessage(IdeMessageType.INFORMATION, "An action for SciVariable."); //  specific  action for a variable
         return visitElement(variable);  //the same action for all kinds of elements
      }
      public Object visitFunction(SciFunction funcion){
         IdeMessageManagerAccess.printMessage(IdeMessageType.INFORMATION, "An action for SciFunction."); //  specific  action for a function
         return null; // for example, let's suppose for functions we do not need any additional actions;
      }
      public Object visitElement(SciElement element){
         IdeMessageManagerAccess.printMessage(IdeMessageType.INFORMATION, "An action for SciFunction.");
         return null;
      }
      //since other visitor methods are not overridden, they will call visitElement method (see below)
     }

In this class methods do nothing, here are the bodies of methods:

     public Object visitElement(SciElement sciElement){ return null; }
     public Object visitClass(SciClass sciClass){ return visitElement(sciClass); }
     public Object visitAttribute(SciAttribute sciAttribute){ return visitVariable(sciAttribute); }
     public Object visitOperation(SciOperation sciOperation){ return visitFunction(sciOperation); }
     public Object visitVariable(SciVariable sciVariable){ return visitElement(sciVariable); }
     public Object visitFunction(SciFunction sciFunction){ return visitElement(sciFunction); }
     public Object visitParameter(SciParameter sciParameter){ return visitVariable(sciParameter); }
     public Object visitInheritance(SciInheritance sciInheritance){ return visitElement(sciInheritance); }
     public Object visitThrowSpecifier(SciThrowSpecifier sciThrowSpecifier){ return visitElement(sciThrowSpecifier); }

Author:
  TogetherSoft
See Also: com.togethersoft.openapi.sci.SciElement.accept(com.togethersoft.openapi.sci.visitor.SciElementVisitor), SciElementVisitor

Method Summary
`Object` | `visitAttribute(SciAttribute sciAttribute)`
`Object` | `visitClass(SciClass sciClass)`
`Object` | `visitElement(SciElement sciElement)`
`Object` | `visitFunction(SciFunction sciFunction)`
`Object` | `visitInheritance(SciInheritance sciInheritance)`
`Object` | `visitInitializer(SciInitializer sciInitializer)`
`Object` | `visitOperation(SciOperation sciOperation)`
`Object` | `visitParameter(SciParameter sciParameter)`
`Object` | `visitThrowSpecifier(SciThrowSpecifier sciThrowSpecifier)`
`Object` | `visitVariable(SciVariable sciVariable)`

Method Detail

### visitAttribute

    public Object visitAttribute(SciAttribute sciAttribute)

### visitClass

    public Object visitClass(SciClass sciClass)

### visitElement

    public Object visitElement(SciElement sciElement)

### visitFunction

    public Object visitFunction(SciFunction sciFunction)

### visitInheritance

    public Object visitInheritance(SciInheritance sciInheritance)

### visitInitializer

    public Object visitInitializer(SciInitializer sciInitializer)

### visitOperation

    public Object visitOperation(SciOperation sciOperation)

### visitParameter

    public Object visitParameter(SciParameter sciParameter)

### visitThrowSpecifier

    public Object visitThrowSpecifier(SciThrowSpecifier sciThrowSpecifier)

### visitVariable

    public Object visitVariable(SciVariable sciVariable)

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD