net.refractions.udig.tool.info
Class LayerPointInfo

java.lang.Object
  extended by net.refractions.udig.tool.info.LayerPointInfo

public abstract class LayerPointInfo
extends java.lang.Object

The response to a getInfo request of a service w.r.t. a layer.

This LayerPointInfo object allows the wrapping arbitrary content, providing type information as a MIME type, and the possability of lazy access.

This class is expected to be subclassed inorder to perform lazy parsing via a custom implementation of getValue();


Field Summary
static java.lang.String ERROR
          Server Error - value is Exception or String
static java.lang.String GML
          The mime type for gml - aka Feature
static java.lang.String HTML
          The mime type for text/html
static LayerPointInfo NOT_FOUND
          Used to indicate an NOT_FOUND result.
static java.lang.String TEXT
          The mime type for text/plain
static java.lang.String XML
          The mime type for text/xml
 
Constructor Summary
LayerPointInfo(ILayer layer)
          Construct an LayerPointInfo for the provided Layer
 
Method Summary
 java.lang.Object acquireValue()
          Subclass must implement to acquire value in a lazy manner.
 ILayer getLayer()
          Layer responsible for providing this information.
abstract  java.lang.String getMimeType()
          The data's MIME type.
 java.net.URL getRequestURL()
          Request url, if applicable, will be sent to an embded browser or something similar.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_FOUND

public static final LayerPointInfo NOT_FOUND
Used to indicate an NOT_FOUND result.

Not found is different from "unavailable".


GML

public static final java.lang.String GML
The mime type for gml - aka Feature

See Also:
Constant Field Values

TEXT

public static final java.lang.String TEXT
The mime type for text/plain

See Also:
Constant Field Values

HTML

public static final java.lang.String HTML
The mime type for text/html

See Also:
Constant Field Values

XML

public static final java.lang.String XML
The mime type for text/xml

See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
Server Error - value is Exception or String

See Also:
Constant Field Values
Constructor Detail

LayerPointInfo

public LayerPointInfo(ILayer layer)
Construct an LayerPointInfo for the provided Layer

Method Detail

acquireValue

public java.lang.Object acquireValue()
                              throws java.io.IOException
Subclass must implement to acquire value in a lazy manner.

The default implementation will make the request specified by getRequestURL().getContent();

Returns:
Object to be used as the Value of this LayerPointInfo
Throws:
java.io.IOException - if an IO error occurs during the request process

getMimeType

public abstract java.lang.String getMimeType()
The data's MIME type.

Well known MIME types:

The system may be extended at a later time to allow the use of additional MIME types. The goal should be to allow the complete set used in WMS getFeatureInfo opperations.

See Also:
http://www.w3.org/Protocols/HTTP/1.1/spec.html#MIME

getRequestURL

public java.net.URL getRequestURL()
Request url, if applicable, will be sent to an embded browser or something similar.

For *real objects* please just return the default value, aka null. acquireValue will be called.

Returns:
requested URL or null if working with a real objects.

getLayer

public ILayer getLayer()
Layer responsible for providing this information.

Can be used as a back point to focus the map on the indicated hit.

Returns:
Returns the layer.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
LayerPointInfo mimeType : request