/*******************************************************************************
 * Copyright 2014, 2016 gwt-ol3
 *
 * 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 ol.format;

import javax.annotation.Nullable;

import jsinterop.annotations.JsType;
import ol.Feature;
import ol.geom.Geometry;

/**
 * Geometry format for reading and writing data in the WellKnownText (WKT)
 * format.
 *
 * @author Elena Guandalini
 *
 */

/**
 * The {@link Wkt} class is used
 * 
 * for reading and writing data in the WellKnownText (WKT) format.
 * 
 */
@JsType(isNative = true, name = "WKT")
public class Wkt extends TextFeature {

	/**
	 * Constructs a(n) {@link Wkt} object.
	 */
	public Wkt() {};

    public Wkt(WktOptions wktOptions) {}

	/**
	 * Read a feature from a WKT source.
	 * 
	 * @param source
	 * @param readOptions
	 * @return feature
	 */
	public native Feature readFeature(java.lang.Object source, @Nullable WktReadOptions readOptions);
	
	/**
	 * Read all features from a WKT source.
	 * 
	 * @param source
	 * @param readOptions
	 * @return features
	 */
	public native Feature[] readFeatures(java.lang.Object source, @Nullable WktReadOptions readOptions);

	/**
	 * Read a single geometry from a WKT source.
	 * 
	 * @param source
	 * @param readOptions
	 * @return geometry
	 */
	public native Geometry readGeometry(java.lang.Object source, @Nullable WktReadOptions readOptions);
	
	/**
	 * Encode a feature as a WKT string.
	 * 
	 * @param feature Feature.
	 * @param writeOptions Write options.
	 * @return WKT string.
	 */
	public native String writeFeature(Feature feature, @Nullable WktWriteOptions writeOptions);

	/**
	 * Encode an array of features as a WKT string.
	 * 
	 * @param features Features.
	 * @param writeOptions Write options.
	 * @return WKT string.
	 */
	public native String writeFeatures(Feature[] features, @Nullable WktWriteOptions writeOptions);

	/**
	 * Write a single geometry as a WKT string.
	 * 
	 * @param geometry Geometry.
	 * @return WKT string.
	 */
	public native String writeGeometry(Geometry geometry);

}

@@ -1392,151 +1392,464 @@
  * @
-param readOptions%0A%09 * @return feature%0A%09 */%0A%09public native Feature readFeature(java.lang.Object source, @Nullable WktReadOptions readOptions);%0A%09
+return feature%0A%09 */%0A%09public native Feature readFeature(java.lang.Object source);%0A%09%0A%09/**%0A%09 * Read a feature from a WKT source.%0A%09 * %0A%09 * @param source%0A%09 * @param readOptions%0A%09 * @return feature%0A%09 */%0A%09public native Feature readFeature(java.lang.Object source, @Nullable WktReadOptions readOptions);%0A%0A%09/**%0A%09 * Read all features from a WKT source.%0A%09 * %0A%09 * @param source%0A%09 * @return features%0A%09 */%0A%09public native Feature%5B%5D readFeatures(java.lang.Object source);%0A
 %0A%09/*
@@ -2058,32 +2058,197 @@
  readOptions);%0A%0A
+%09/**%0A%09 * Read a single geometry from a WKT source.%0A%09 * %0A%09 * @param source%0A%09 * @return geometry%0A%09 */%0A%09public native Geometry readGeometry(java.lang.Object source);%0A%09%0A
 %09/**%0A%09 * Read a 
@@ -2453,24 +2453,183 @@
 Options);%0A%09%0A
+%09/**%0A%09 * Encode a feature as a WKT string.%0A%09 * %0A%09 * @param feature Feature.%0A%09 * @return WKT string.%0A%09 */%0A%09public native String writeFeature(Feature feature);%0A%0A
 %09/**%0A%09 * Enc
@@ -2846,32 +2846,208 @@
 writeOptions);%0A%0A
+%09/**%0A%09 * Encode an array of features as a WKT string.%0A%09 * %0A%09 * @param features Features.%0A%09 * @return WKT string.%0A%09 */%0A%09public native String writeFeatures(Feature%5B%5D features);%0A%0A
 %09/**%0A%09 * Encode 
@@ -3456,10 +3456,260 @@
 etry);%0A%0A
+%09/**%0A%09 * Write a single geometry as a WKT string.%0A%09 * %0A%09 * @param geometry Geometry.%0A%09 * @param writeOptions Write options.%0A%09 * @return WKT string.%0A%09 */%0A%09public native String writeGeometry(Geometry geometry, @Nullable WktWriteOptions writeOptions);%0A%0A
 %7D%0A

Add full support for Read/WriteOptions in ol.format.Wkt