001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2006-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.filter;
033    
034    import org.opengis.annotation.Extension;
035    import org.opengis.filter.spatial.BBOX;
036    import org.opengis.filter.spatial.Beyond;
037    import org.opengis.filter.spatial.Contains;
038    import org.opengis.filter.spatial.Crosses;
039    import org.opengis.filter.spatial.DWithin;
040    import org.opengis.filter.spatial.Disjoint;
041    import org.opengis.filter.spatial.Equals;
042    import org.opengis.filter.spatial.Intersects;
043    import org.opengis.filter.spatial.Overlaps;
044    import org.opengis.filter.spatial.Touches;
045    import org.opengis.filter.spatial.Within;
046    
047    
048    /**
049     * Visitor with {@code visit} methods to be called by {@link Filter#accept Filter.accept(...)}.
050     * <p>
051     * Consider: It is unclear if this visitor should be applied directly to Filter, or should be walked accross
052     * the data structure by hand.  The standard complient structure is well defined, and this should negate
053     * the need for a formal visitor (we don't have internal structure we are hiding).
054     * </p>
055     * <p>
056     * There is still a very valid use for FilterVisitor, a instance may implement both FilterVisitor and ExpressionVisitor
057     * and ExpressionVisitory in one direction, and a FilterVisitor and a StyleVisitor in the other. The ability
058     * to directly focus on transforming data within a larger structure is something a normal data walk
059     * can not accomplish in a scalable manner.
060     * </p>
061     * @version <A HREF="http://www.opengis.org/docs/02-059.pdf">Implementation specification 1.0</A>
062     * @author Chris Dillard (SYS Technologies)
063     * @since GeoAPI 2.0
064     */
065    @Extension
066    public interface FilterVisitor {
067        /**
068         * Used to account for a <code>null</code> filter value.
069         * <p>
070         * This is particularly used during data structure transofrmations, however
071         * the use of <code>null</code> is not recommended. Please make use of Filter.NONE
072         * and Filter.ALL as placeholder objects that communicate intent.
073         * </p>
074         * @param extraData Value object provided to visitor
075         * @return subclass defined
076         */
077        Object visitNullFilter(Object extraData);
078    
079        /**
080         * Visit {@link Filter#EXCLUDE} (often used during data structure transformations).
081         *
082         * @param filter {@link Filter#EXCLUDE}.
083         * @param extraData Value object provided to visitor
084         * @return subclass supplied
085         */
086        Object visit(ExcludeFilter filter, Object extraData);
087    
088        /**
089         * Visit {@link Filter#INCLUDE} (often used during data structure transformations).
090         *
091         * @param filter {@link Filter#INCLUDE}.
092         * @param extraData Value object provided to visitor
093         * @return subclass supplied
094         */
095        Object visit(IncludeFilter filter, Object extraData);
096    
097        Object visit(And filter,                            Object extraData);
098        Object visit(Id filter,                             Object extraData);
099        Object visit(Not filter,                            Object extraData);
100        Object visit(Or filter,                             Object extraData);
101        Object visit(PropertyIsBetween filter,              Object extraData);
102        Object visit(PropertyIsEqualTo filter,              Object extraData);
103        Object visit(PropertyIsNotEqualTo filter,           Object extraData);
104        Object visit(PropertyIsGreaterThan filter,          Object extraData);
105        Object visit(PropertyIsGreaterThanOrEqualTo filter, Object extraData);
106        Object visit(PropertyIsLessThan filter,             Object extraData);
107        Object visit(PropertyIsLessThanOrEqualTo filter,    Object extraData);
108        Object visit(PropertyIsLike filter,                 Object extraData);
109        Object visit(PropertyIsNull filter,                 Object extraData);
110    
111        Object visit(BBOX filter,       Object extraData);
112        Object visit(Beyond filter,     Object extraData);
113        Object visit(Contains filter,   Object extraData);
114        Object visit(Crosses filter,    Object extraData);
115        Object visit(Disjoint filter,   Object extraData);
116        Object visit(DWithin filter,    Object extraData);
117        Object visit(Equals filter,     Object extraData);
118        Object visit(Intersects filter, Object extraData);
119        Object visit(Overlaps filter,   Object extraData);
120        Object visit(Touches filter,    Object extraData);
121        Object visit(Within filter,     Object extraData);
122    }