Document.java :  » Google-tech » kmlframework » org » boehn » kmlframework » kml » Java Open Source

Java Open Source » Google tech » kmlframework 
kmlframework » org » boehn » kmlframework » kml » Document.java
package org.boehn.kmlframework.kml;

import java.util.ArrayList;
import java.util.List;

import org.boehn.kmlframework.atom.AtomAuthor;
import org.boehn.kmlframework.atom.AtomLink;

public class Document extends Container implements Deletable {

  private List<Schema> schemas;
  
  public Document() {}
  
  public Document(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters, List<Schema> schemas) {
    super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, feauters);
    this.schemas = schemas;
  }
  
  public List<Schema> getSchemas() {
    return schemas;
  }

  public void setSchemas(List<Schema> schemas) {
    this.schemas = schemas;
  }
  
  public void addSchema(Schema schema) {
    if (schemas == null) {
      schemas = new ArrayList<Schema>();
    }
    schemas.add(schema);
  }
  
  public void write(Kml kml) throws KmlException {
    kml.println("<Document" + getIdAndTargetIdFormatted(kml) + ">", 1);
    writeInner(kml);
    if (schemas != null) {
      for (Schema schema: schemas)
      schema.write(kml);
    }
    kml.println(-1, "</Document>");
  }
  
  public void writeDelete(Kml kml) throws KmlException {
    kml.println("<Document" + getIdAndTargetIdFormatted(kml) + "></Document>");
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.