com.sun.syndication.feed.module.georss.GMLGenerator Maven / Gradle / Ivy
/*
* Copyright 2006 Marc Wick, geonames.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.sun.syndication.feed.module.georss;
import java.util.*;
import org.jdom.Element;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
import com.sun.syndication.feed.module.georss.geometries.*;
/**
* GMLGenerator produces georss elements in georss GML format.
*
* @author Marc Wick
* @version $Id: GMLGenerator.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $
*
*/
public class GMLGenerator implements ModuleGenerator {
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
nss.add(GeoRSSModule.GML_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
private Element createPosListElement(PositionList posList) {
Element posElement = new Element("posList", GeoRSSModule.GML_NS);
StringBuffer sb = new StringBuffer();
for (int i=0; i