001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-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.style;
033    
034    import java.util.List;
035    import java.util.Set;
036    import org.opengis.annotation.Extension;
037    import org.opengis.annotation.UML;
038    import org.opengis.annotation.XmlElement;
039    
040    import org.opengis.feature.type.Name;
041    import org.opengis.filter.Id;
042    import org.opengis.metadata.citation.OnlineResource;
043    import static org.opengis.annotation.Obligation.*;
044    import static org.opengis.annotation.Specification.*;
045    
046    /**
047     * Represents a style that applies to features or coverage.
048     *
049     * @version <A HREF="http://www.opengeospatial.org/standards/symbol">Symbology Encoding Implementation Specification 1.1.0</A>
050     * @author Open Geospatial Consortium
051     * @author Johann Sorel (Geomatys)
052     * @author Chris Dillard (SYS Technologies)
053     * @since GeoAPI 2.2
054     */
055    @XmlElement("FeatureTypeStyle")
056    @UML(identifier="PF_FeaturePortrayal", specification=ISO_19117)
057    public interface FeatureTypeStyle {
058    
059        /**
060         * Returns a name for this style.
061         * This can be any string that uniquely identifies this style within a given
062         * canvas.  It is not meant to be human-friendly.  (The "title" property is
063         * meant to be human friendly.)
064         * @return a name for this style.
065         */
066        @XmlElement("Name")
067        String getName();
068    
069        /**
070         * Returns the description of this style.
071         *
072         * @return Description with usual informations used
073         * for user interfaces.
074         */
075        @XmlElement("Description")
076        @UML(identifier="description", obligation=OPTIONAL, specification=ISO_19117)
077        Description getDescription();
078    
079        /**
080         * Returns a collection of Object identifying features object.
081         *
082         * <p>
083         * ISO 19117 extends FeatureTypeStyle be providing this method.
084         * This method enable the possibility to use a feature type style
085         * on a given list of features only, which is not possible in OGC SE.
086         * </p>
087         *
088         * @return Collection<String>
089         */
090        @UML(identifier="definedForInst", obligation=OPTIONAL, specification=ISO_19117)
091        Id getFeatureInstanceIDs();
092        
093        /**
094         * <p>
095         * Returns the names of the feature type that this style is meant to act
096         * upon.
097         * </p>
098         * <p>
099         * In OGC Symbology Encoding define this method to return a single
100         * String, and ISO 19117 use a Collection of String. We've chosen
101         * ISO because it is more logic that a featureTypeStyle can be applied
102         * to multiple featuretypes and not limited to a single one.
103         * </p>
104         *
105         * @return the name of the feature type that this style is meant
106         * to act upon.
107         */
108        @XmlElement("FeatureTypeName")
109        @UML(identifier="definedFor", obligation=OPTIONAL, specification=ISO_19117)
110        Set<Name> featureTypeNames();
111    
112        /**
113         * Returns a collection that identifies the more general "type" of geometry
114         * that this style is meant to act upon.
115         * In the current OGC SE specifications, this is an experimental element and
116         * can take only one of the following values:
117         * <p>
118         * <ul>
119         *   <li>{@code generic:point}</li>
120         *   <li>{@code generic:line}</li>
121         *   <li>{@code generic:polygon}</li>
122         *   <li>{@code generic:text}</li>
123         *   <li>{@code generic:raster}</li>
124         *   <li>{@code generic:any}</li>
125         * </ul>
126         * <p>
127         *
128         */
129        @XmlElement("SemanticTypeIdentifier")
130        Set<SemanticType> semanticTypeIdentifiers();
131    
132        /**
133         * Returns the list of rules contained by this style.
134         *
135         * @return the list of rules. can not be null but can be empty.
136         */
137        @XmlElement("Rule")
138        @UML(identifier="portrayalRule", obligation=MANDATORY, specification=ISO_19117)
139        List<? extends Rule> rules();
140    
141        /**
142         * It is common to have a style coming from a external xml file, this method
143         * provide a way to get the original source if there is one.
144         * OGC SLD specification can use this method to know if a style must be
145         * written completely or if writing the online resource path is enough.
146         * 
147         * @return OnlineResource or null
148         */
149        OnlineResource getOnlineResource();
150        
151        /**
152         * calls the visit method of a StyleVisitor
153         *
154         * @param visitor the style visitor
155         */
156        @Extension
157        Object accept(StyleVisitor visitor, Object extraData);
158    
159    }