001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2008-2012 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.sld;
033    
034    import org.opengis.filter.expression.ExpressionVisitor;
035    import org.opengis.style.Style;
036    import org.opengis.style.StyleVisitor;
037    
038    /**
039     * An interface for classes that want to perform operations on a SLD
040     * hierarchy. It forms part of a GoF Visitor Pattern implementation.
041     * <p>
042     * A call to sld.accept(SLDVisitor) will result in a call to one of the
043     * methods in this interface. The responsibility for traversing sub filters is
044     * intended to lie with the visitor (this is unusual, but permitted under the
045     * Visitor pattern).
046     * <p>
047     * A typical use would be to transcribe a sld into a specific format, e.g. XML or SQL.
048     * Alternatively it may be to extract specific information from the SLD structure, for example a list of all fills.
049     * Finally a a sld visitor is often used (in conjunction with a factory) in the production of a
050     * copy; or slightly modified copy of the original sld.
051     * <p>
052     * It is common practice for a SLDVisitor to also implement a StyleVisitor and ExpressionVisitor in
053     * order to traverse all data structures.
054     * 
055     * @see ExpressionVisitor
056     * @see StyleVisitor
057     * @see StyleFactory
058     * @author Open Geospatial Consortium
059     * @author Johann Sorel (Geomatys)
060     * @since GeoAPI 2.2
061     */
062    public interface SLDVisitor {
063        /**
064         * Called when accept is called on a StyledLayerDescriptor.
065         *
066         * @param sld The style layer descriptor to visit
067         */
068        Object visit(StyledLayerDescriptor sld, Object data );
069        
070        /**
071         * Called when accept is called on a SLDLibrary.
072         *
073         * @param library The SLD library to visit
074         */
075        Object visit(SLDLibrary library, Object data );
076        
077        /**
078         * Called when accept is called on a named layer.
079         *
080         * @param layer The named layer to visit
081         */
082        Object visit(NamedLayer layer, Object data );
083        
084        /**
085         * Called when accept is called on a user layer.
086         *
087         * @param layer The user layer to visit
088         */
089        Object visit(UserLayer layer, Object data );
090        
091        /**
092         * Called when accept is called on a named style.
093         *
094         * @param style The named style to visit
095         */
096        Object visit(NamedStyle style, Object data );
097        
098        /**
099         * Called when accept is called on a user style.
100         *
101         * @param style The user style to visit
102         */
103        Object visit(Style style, Object data );
104        
105        /**
106         * Called when accept is called on a layer coverage constraints.
107         *
108         * @param constraints The layer coverage constraints to visit
109         */
110        Object visit(LayerCoverageConstraints constraints, Object data );
111        
112        /**
113         * Called when accept is called on a layer feature constraints.
114         *
115         * @param constraints The layer feature constraints to visit
116         */
117        Object visit(LayerFeatureConstraints constraints, Object data );
118        
119        /**
120         * Called when accept is called on a coverage constraint.
121         *
122         * @param constraint The coverage constraint to visit
123         */
124        Object visit(CoverageConstraint constraint, Object data );
125        
126        /**
127         * Called when accept is called on a featrure constraint.
128         *
129         * @param constraint The feature constraint to visit
130         */
131        Object visit(FeatureTypeConstraint constraint, Object data );
132        
133        /**
134         * Called when accept is called on a coverage extent.
135         *
136         * @param extent The coverage extent to visit
137         */
138        Object visit(CoverageExtent extent, Object data );
139        
140        /**
141         * Called when accept is called on a feature extent.
142         *
143         * @param extent The feature extent to visit
144         */
145        Object visit(Extent extent, Object data );
146        
147        /**
148         * Called when accept is called on a range axis.
149         *
150         * @param axi The range axi to visit
151         */
152        Object visit(RangeAxis axi, Object data );
153        
154        /**
155         * Called when accept is called on a remoteOWS.
156         *
157         * @param ows The remoteOWS to visit
158         */
159        Object visit(RemoteOWS ows, Object data );
160        
161        /**
162         * Called when accept is called on an InlineFeature.
163         *
164         * @param inline The InlineFeature to visit
165         */
166        Object visit(InlineFeature inline, Object data );
167        
168        
169    }