Esri Geoportal Server
1.0

com.esri.gpt.framework.util
Class DateProxy

java.lang.Object
  extended by com.esri.gpt.framework.util.DateProxy
All Implemented Interfaces:
Serializable

public class DateProxy
extends Object
implements Serializable

Serves as a proxy for the specification of a date.

The primary purpose is to support input date strings in standard Java yyyy-MM-dd format.

See Also:
Serialized Form

Field Summary
static String DEFAULT_TIME_FORMAT
          default time format used by class
 
Constructor Summary
DateProxy()
          Default constructor.
 
Method Summary
 Timestamp asFromTimestamp()
          Returns a timestamp applicable for the from part of a date range query.
 Timestamp asFromTimestampExcl()
          Returns an exclusive timestamp applicable for the from part of a date range query.
 Timestamp asToTimestamp()
          Returns a timestamp applicable for the to part of a date range query.
 Timestamp asToTimestampExcl()
          Returns an exclusive timestamp applicable for the to part of a date range query.
static String formatDate(Timestamp date)
          Formats a date as "yyyy-MM-dd".
static String formatIso8601Timestamp(Timestamp timestamp)
          Formats a timestamp as "yyyy-MM-dd'T'HH:mm:ssZ".
 String getDate()
          Gets the input date string.
 boolean getIsValid()
          Determines if the date is valid.
 boolean getWasInputStringInvalid()
          Determines if the input date string was invalid.
 void setDate(String date)
          Sets the input date string.
 String toString()
          Returns a string representation this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TIME_FORMAT

public static String DEFAULT_TIME_FORMAT
default time format used by class

Constructor Detail

DateProxy

public DateProxy()
Default constructor.

Method Detail

getDate

public String getDate()
Gets the input date string.

Returns:
the input date string

setDate

public void setDate(String date)
Sets the input date string.

Parameters:
date - the input date string

getIsValid

public boolean getIsValid()
Determines if the date is valid.

Returns:
true if the date is valid

getWasInputStringInvalid

public boolean getWasInputStringInvalid()
Determines if the input date string was invalid.

The input string is only considered invalid if it had non-zero length and failed to eveluate to a date.

Returns:
true if the input date string was invalid

asFromTimestamp

public Timestamp asFromTimestamp()
Returns a timestamp applicable for the from part of a date range query.

Returns:
the timestamp (null in unspecified)

asFromTimestampExcl

public Timestamp asFromTimestampExcl()
Returns an exclusive timestamp applicable for the from part of a date range query.

Returns:
the timestamp (null in unspecified)

asToTimestamp

public Timestamp asToTimestamp()
Returns a timestamp applicable for the to part of a date range query.

Returns:
the timestamp (null in unspecified)

asToTimestampExcl

public Timestamp asToTimestampExcl()
Returns an exclusive timestamp applicable for the to part of a date range query.

Returns:
the timestamp (null in unspecified)

formatDate

public static String formatDate(Timestamp date)
Formats a date as "yyyy-MM-dd".

Parameters:
date - the date to format
Returns:
date represented as string

formatIso8601Timestamp

public static String formatIso8601Timestamp(Timestamp timestamp)
Formats a timestamp as "yyyy-MM-dd'T'HH:mm:ssZ".

Parameters:
timestamp - the timestamp to format
Returns:
the formatted result

toString

public String toString()
Returns a string representation this object.

Overrides:
toString in class Object
Returns:
the string

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.