|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.attr.AttributeValue
org.wso2.balana.attr.DateAttribute
public class DateAttribute
Representation of an xs:date value. This class supports parsing xs:date values. All objects of
this class are immutable and thread-safe. The Date
objects returned are not, but
these objects are cloned before being returned.
Field Summary | |
---|---|
static String |
identifier
Official name of this type |
static int |
TZ_UNSPECIFIED
Time zone value that indicates that the time zone was not specified. |
Constructor Summary | |
---|---|
DateAttribute()
Creates a new TimeAttribute that represents the current date in the default time
zone. |
|
DateAttribute(Date date)
Creates a new TimeAttribute that represents the given date with default timezone
values. |
|
DateAttribute(Date date,
int timeZone,
int defaultedTimeZone)
Creates a new DateAttribute that represents the date supplied. |
Method Summary | |
---|---|
String |
encode()
Encodes the value in a form suitable for including in XML data like a request or an obligation. |
boolean |
equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class. |
int |
getDefaultedTimeZone()
Gets the time zone actually used for this object (if it was originally unspecified, the default time zone used). |
static DateAttribute |
getInstance(Node root)
Returns a new DateAttribute that represents the xs:date at a particular DOM
node. |
static DateAttribute |
getInstance(String value)
Returns a new DateAttribute that represents the xs:date value indicated by the
string provided. |
int |
getTimeZone()
Gets the specified time zone of this object (or TZ_UNSPECIFIED if unspecified). |
Date |
getValue()
Gets the date represented by this object. |
int |
hashCode()
Returns the hashcode value used to index and compare this object with others of the same type. |
String |
toString()
Converts to a String representation. |
Methods inherited from class org.wso2.balana.attr.AttributeValue |
---|
encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String identifier
public static final int TZ_UNSPECIFIED
Constructor Detail |
---|
public DateAttribute()
TimeAttribute
that represents the current date in the default time
zone.
public DateAttribute(Date date)
TimeAttribute
that represents the given date with default timezone
values.
date
- a Date
object representing the instant at which the specified date
began (midnight) in the specified time zone (the actual time value will be forced
to midnight)public DateAttribute(Date date, int timeZone, int defaultedTimeZone)
DateAttribute
that represents the date supplied.
date
- a Date
object representing the instant at which the specified date
began (midnight) in the specified time zonetimeZone
- the time zone specified for this object (or TZ_UNSPECIFIED if unspecified).
The offset to GMT, in minutes.defaultedTimeZone
- the time zone actually used for this object (if it was originally
unspecified, the default time zone used). The offset to GMT, in minutes.Method Detail |
---|
public static DateAttribute getInstance(Node root) throws ParseException
DateAttribute
that represents the xs:date at a particular DOM
node.
root
- the Node
that contains the desired value
DateAttribute
representing the appropriate value (null if there is
a parsing error)
ParseException
public static DateAttribute getInstance(String value) throws ParseException
DateAttribute
that represents the xs:date value indicated by the
string provided.
value
- a string representing the desired value
DateAttribute
representing the desired value (null if there is a
parsing error)
ParseException
public Date getValue()
Date
object
representing the instant at which the specified date began (midnight) in the time zone.
NOTE: The Date
object is cloned before it is returned to avoid
unauthorized changes.
Date
object representing the instant at which the date beganpublic int getTimeZone()
public int getDefaultedTimeZone()
public boolean equals(Object o)
Two DateAttribute
s are equal if and only if the instant on which the date began
is equal. This means that they must have the same time zone.
equals
in class Object
o
- the object to compare
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String encode()
encode
in class AttributeValue
String
form of the value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |