public class DateAttribute extends AttributeValue
Date
objects returned are not, but
these objects are cloned before being returned.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
encode, encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag
public static final String identifier
public static final int TZ_UNSPECIFIED
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.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 valueDateAttribute
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 valueDateAttribute
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.
getValue
in class AttributeValue
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.
public int hashCode()
public String toString()
public String encode()
encode
in class AttributeValue
String
form of the valueCopyright © 2023 JBoss by Red Hat. All rights reserved.