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 java.util.List;
035    
036    import org.opengis.annotation.Extension;
037    import org.opengis.style.Description;
038    import org.opengis.annotation.XmlElement;
039    import org.opengis.annotation.XmlParameter;
040    
041    /**
042     * The WMS-layers level of SLD is defined in the “StyledLayerDescriptor.xsd” XML-
043     * Schema file and provides the “glue” between feature styling as defined by Symbology
044     * Encoding and WMS layers. This level of definitions has been decoupled from the feature-
045     * style and symbol definitions to make it convenient to perform feature styling in
046     * environments other than inside of a WMS.
047     * 
048     * @version <A HREF="http://www.opengeospatial.org/standards/sld">Implementation specification 1.1.0</A>
049     * @author Open Geospatial Consortium
050     * @author Johann Sorel (Geomatys)
051     * @since GeoAPI 2.2
052     */
053    @XmlElement("StyledLayerDescriptor")
054    public interface StyledLayerDescriptor {
055       
056        /**
057         * The Name element allows a symbolic name to be associated with a given SLD document.
058         * This element is used with most “objects” defined by SE and SLD to allow them to be
059         * referenced. Names must be unique in the context in which they are defined.
060         */
061        @XmlParameter("Name")
062        String getName();
063        
064        /**
065         * The Description element is also reused throughout SE and SLD and gives an informative
066         * description of the “object” being defined. This information can be extracted and used for
067         * such purposes as creating informal searchable metadata in catalogue systems. More
068         * metadata fields may be added to this element in the future. The Name is not considered
069         * to be part of a description since a name has a functional use that is more than just
070         * descriptive.
071         */
072        @XmlElement("Description")
073        Description getDescription();
074        
075        /**
076         * The UseSLDLibrary element provides the ability of handling external SLD documents
077         * to be used in library-mode even when using XML-encoded POST requests with a WMS.
078         * (The library mode can be accessed with the HTTP-GET method by supplying an SLD
079         * CGI parameter in addition to LAYERS and STYLES CGI parameters.) This addition
080         * merely exercises pre-existing functionality in WMS, but it does add the wrinkle of
081         * making SLD-library references iterative and (syntactically) recursive. Successive
082         * definitions are applied “on top of” previous ones to determine the scoping of overlapping
083         * style definitions.
084         */
085        @XmlElement("UseSLDLibrary")
086        List<? extends SLDLibrary> libraries();
087        
088        /**
089         * The styled layers can correspond to either named layers (NamedLayer) or user-defined
090         * layers (UserLayer), which are described in subsequent subclauses. There may be any
091         * number of either type of styled layer, including zero, mixed in any order. The order that
092         * the layer references appear in the SLD document will be the order that the styled layers
093         * are rendered, with successive styled layers rendered on top of previous styled layers.
094         */
095        @XmlElement("NamedLayer,UserLayer")
096        List<? extends Layer> layers();
097        
098        /**
099         * The version attribute gives the SLD version of an SLD document, to
100         * facilitate backward compatibility with static documents stored in various different
101         * versions of the SLD specification. The string has the format “x.y.z”, the same as in other
102         * OGC Implementation specifications. For example, an SLD document stored according to
103         * this specification would have the version string “1.1.0”. The attribute is required.
104         */
105        @XmlParameter("Version")
106        String getVersion();
107        
108        /**
109         * calls the visit method of a SLDVisitor
110         *
111         * @param visitor the sld visitor
112         */
113        @Extension
114        Object accept(SLDVisitor visitor, Object extraData);
115        
116        
117    }