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

## org.opengis.sld
Interface StyleVisitor

    @Extension
    public interface StyleVisitor

Interface that can be implemented by objects that want to perform some action on style objects. The visitor design pattern is used to avoid runtime type checking of objects that descend from a common superclass. So instead of code that looks like this, with costly instanceof checks:

     Symbol s = ... ;
     if (s instanceof LineSymbol) {
       // Do Line stuff
     }
     else if (s instanceof PointSymbol) {
       // Do Point stuff
     }
     ...

you can implement the `SymbolVisitor` interface and the object itself will invoke the appropriate method:

     class MyVisitor implements SymbolVisitor {
       public Object visit(LineSymbol symbol, Object userData) {
         // Do Line stuff
       }
       public Object visit(PointSymbol symbol, Object userData) {
         // Do Point stuff
       }
       ...
     }
     ...
     Symbol s = ... ;
     MyVisitor visitor = new MyVisitor(...);
     Object o = s.accept(visitor, myData);

Since:
  GeoAPI 2.0
Version:
  Implementation specification 1.0

Method Summary
`Object` | `visit(ExternalGraphic externalGraphic, Object userData)`
`Object` | `visit(LinePlacement placement, Object userData)`
`Object` | `visit(LineSymbol symbol, Object userData)`
`Object` | `visit(Mark mark, Object userData)`
`Object` | `visit(PointPlacement placement, Object userData)`
`Object` | `visit(PointSymbol symbol, Object userData)`
`Object` | `visit(PolygonSymbol symbol, Object userData)`
`Object` | `visit(TextSymbol symbol, Object userData)`

Method Detail

### visit

    Object visit(LineSymbol symbol,
                 Object userData)

### visit

    Object visit(PointSymbol symbol,
                 Object userData)

### visit

    Object visit(PolygonSymbol symbol,
                 Object userData)

### visit

    Object visit(TextSymbol symbol,
                 Object userData)

### visit

    Object visit(ExternalGraphic externalGraphic,
                 Object userData)

### visit

    Object visit(Mark mark,
                 Object userData)

### visit

    Object visit(LinePlacement placement,
                 Object userData)

### visit

    Object visit(PointPlacement placement,
                 Object userData)

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

Copyright © 1994-2008 Open Geospatial Consortium. All Rights Reserved.