public class

W3CPoint

extends ExtensionPoint
implements Point
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.geo.impl.W3CPoint

Class Overview

Extension for a W3C geo:Point element. It contains the getter/setter for specifying the longitude and latitude of a geo-coordinate. Please see the W3C document http://www.w3.org/2003/01/geo for more information.

Summary

Nested Classes
class W3CPoint.Handler Simple delegating handler implementation that uses (only) ExtensionProfile linkages for child element lookup. 
Constants
String NAME
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
W3CPoint()
Constructs an empty geo:Point element.
W3CPoint(Double lat, Double lon)
Constructs a geo:Point element with child geo:lat and geo:long elements based on the parameters passed in.
W3CPoint(Point copyFrom)
Constructs a geo:Point element copying the lat and lon values from the given point.
Public Methods
void declareExtensions(ExtensionProfile extProfile)
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
void generate(XmlWriter w, ExtensionProfile extProfile)
Generates the XML corresponding to this GeoPoint.
static ExtensionDescription getDefaultDescription(boolean repeatable)
Returns the suggested extension description with configurable repeatability.
static ExtensionDescription getDefaultDescription()
Returns the suggested extension description and is repeatable.
XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)
The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.
Double getLatitude()
Double getLongitude()
void setGeoLocation(Double lat, Double lon)
Sets the geo location based on the passed in lat and lon values.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.geo.Point

Constants

static final String NAME

Constant Value: "Point"

Public Constructors

public W3CPoint ()

Constructs an empty geo:Point element.

public W3CPoint (Double lat, Double lon)

Constructs a geo:Point element with child geo:lat and geo:long elements based on the parameters passed in.

Parameters
lat The latitude coordinate of this point.
lon The longitude coordinate of this point.

public W3CPoint (Point copyFrom)

Constructs a geo:Point element copying the lat and lon values from the given point. If the given point is null an empty geo:Point element will be created.

Parameters
copyFrom

Public Methods

public void declareExtensions (ExtensionProfile extProfile)

Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

Parameters
extProfile The ExtensionProfile to initialize.

public void generate (XmlWriter w, ExtensionProfile extProfile)

Generates the XML corresponding to this GeoPoint.

Parameters
w XML writer
extProfile Extension profile
Throws
IOException

public static ExtensionDescription getDefaultDescription (boolean repeatable)

Returns the suggested extension description with configurable repeatability.

Parameters
repeatable

public static ExtensionDescription getDefaultDescription ()

Returns the suggested extension description and is repeatable.

public XmlParser.ElementHandler getHandler (ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)

The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.

Parameters
extProfile Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • a handler for processing a W3C geo:Point element. All points must have a latitude and longitude element.

public Double getLatitude ()

Returns
  • the value of the geo:lat element within this Point.

public Double getLongitude ()

Returns
  • the value of the geo:long element within this Point.

public void setGeoLocation (Double lat, Double lon)

Sets the geo location based on the passed in lat and lon values. Both must be null or non null, and the lat must be between -90 and 90, and the lon between -180 and 180.

Parameters
lat The latitude in degrees, from -90 to 90.
lon The longitude in degrees, from -180 to 180.