/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2008 - 2009, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotoolkit.wmts.xml.v100; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.geotoolkit.ows.xml.v110.BoundingBoxType; import org.geotoolkit.ows.xml.v110.DatasetDescriptionSummaryBaseType; /** * <p>Java class for LayerType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="LayerType"> * <complexContent> * <extension base="{http://www.opengis.net/ows/1.1}DatasetDescriptionSummaryBaseType"> * <sequence> * <element ref="{http://www.opengis.net/wmts/1.0}Style" maxOccurs="unbounded"/> * <element name="Format" type="{http://www.opengis.net/ows/1.1}MimeType" maxOccurs="unbounded"/> * <element name="InfoFormat" type="{http://www.opengis.net/ows/1.1}MimeType" maxOccurs="unbounded" minOccurs="0"/> * <element ref="{http://www.opengis.net/wmts/1.0}Dimension" maxOccurs="unbounded" minOccurs="0"/> * <element ref="{http://www.opengis.net/wmts/1.0}TileMatrixSetLink" maxOccurs="unbounded"/> * <element name="ResourceURL" type="{http://www.opengis.net/wmts/1.0}URLTemplateType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LayerType", propOrder = { "style", "format", "infoFormat", "dimension", "tileMatrixSetLink", "resourceURL" }) public class LayerType extends DatasetDescriptionSummaryBaseType { @XmlElement(name = "Style", required = true) private List<Style> style; @XmlElement(name = "Format", required = true) private List<String> format; @XmlElement(name = "InfoFormat") private List<String> infoFormat; @XmlElement(name = "Dimension") private List<Dimension> dimension; @XmlElement(name = "TileMatrixSetLink", required = true) private List<TileMatrixSetLink> tileMatrixSetLink; @XmlElement(name = "ResourceURL") private List<URLTemplateType> resourceURL; public LayerType() { } public LayerType(final String identifier, final String title, final String remarks, final BoundingBoxType bbox, final List<Style> style, final List<Dimension> dimension) { super(identifier, title, remarks, Arrays.asList(bbox)); this.style = style; this.dimension = dimension; } public LayerType(final String identifier, final String title, final String remarks, final List<BoundingBoxType> bboxs, final List<Style> style, final List<Dimension> dimension) { super(identifier, title, remarks, bboxs); this.style = style; this.dimension = dimension; } /** * Metadata about the styles of this layer Gets the value of the style property. */ public List<Style> getStyle() { if (style == null) { style = new ArrayList<>(); } return this.style; } public void setStyle(final List<Style> style) { this.style = style; } /** * Gets the value of the format property. */ public List<String> getFormat() { if (format == null) { format = new ArrayList<>(); } return this.format; } public void setFormat(final List<String> format) { this.format = format; } /** * Gets the value of the infoFormat property. */ public List<String> getInfoFormat() { if (infoFormat == null) { infoFormat = new ArrayList<>(); } return this.infoFormat; } public void setInfoFormat(final List<String> infoFormat) { this.infoFormat = infoFormat; } /** * Extra dimensions for a tile and FeatureInfo requests. * Gets the value of the dimension property. */ public List<Dimension> getDimension() { if (dimension == null) { dimension = new ArrayList<>(); } return this.dimension; } public void setDimension(final List<Dimension> dimension) { this.dimension = dimension; } /** * Reference to a tileMatrixSet and limits Gets the value of the tileMatrixSetLink property. * */ public List<TileMatrixSetLink> getTileMatrixSetLink() { if (tileMatrixSetLink == null) { tileMatrixSetLink = new ArrayList<>(); } return this.tileMatrixSetLink; } public void addTileMatrixSetLink(final TileMatrixSetLink tmsl) { if (tmsl != null) { if (tileMatrixSetLink == null) { tileMatrixSetLink = new ArrayList<>(); } this.tileMatrixSetLink.add(tmsl); } } public void setTileMatrixSetLink(final List<TileMatrixSetLink> tileMatrixSetLink) { this.tileMatrixSetLink = tileMatrixSetLink; } /** * Gets the value of the resourceURL property. */ public List<URLTemplateType> getResourceURL() { if (resourceURL == null) { resourceURL = new ArrayList<>(); } return this.resourceURL; } public void setResourceURL(final List<URLTemplateType> resourceURL) { this.resourceURL = resourceURL; } @Override public String toString() { StringBuilder s = new StringBuilder(); s.append("class=LayerType").append('\n'); s.append("style:").append('\n'); for (Style st:getStyle()) { s.append(st).append('\n'); } s.append("format:").append('\n'); for (String f:getFormat()) { s.append(f).append('\n'); } s.append("infoFormat:").append('\n'); for (String infoForm:getInfoFormat()) { s.append(infoForm).append('\n'); } s.append("dimension:").append('\n'); for (Dimension dim:getDimension()) { s.append(dim).append('\n'); } s.append("tileMatrixSetLink:").append('\n'); for (TileMatrixSetLink tms:getTileMatrixSetLink()) { s.append(tms).append('\n'); } return s.toString(); } }