|
JBoss port of sunxacml 2.0.8.Final-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.xacml.sunxacml.attr.AttributeValue
org.jboss.security.xacml.sunxacml.attr.DateTimeAttribute
public class DateTimeAttribute
Representation of an xs:dateTime value. This class supports parsing
xs:dateTime 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 | |
---|---|
DateTimeAttribute()
Creates a new DateTimeAttribute that represents
the current date in the default time zone. |
|
DateTimeAttribute(Date dateTime)
Creates a new DateTimeAttribute that represents
the supplied date but uses default timezone and offset values. |
|
DateTimeAttribute(Date dateTime,
int nanoseconds,
int timeZone,
int defaultedTimeZone)
Creates a new DateTimeAttribute 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 DateTimeAttribute |
getInstance(Node root)
Returns a new DateTimeAttribute that represents
the xs:dateTime at a particular DOM node. |
static DateTimeAttribute |
getInstance(String value)
Returns a new DateTimeAttribute that represents
the xs:dateTime value indicated by the string provided. |
int |
getNanoseconds()
Gets the nanoseconds of this object. |
int |
getTimeZone()
Gets the time zone of this object (or TZ_UNSPECIFIED if unspecified). |
Date |
getValue()
Gets the date and time 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.jboss.security.xacml.sunxacml.attr.AttributeValue |
---|
encode, 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 DateTimeAttribute()
DateTimeAttribute
that represents
the current date in the default time zone.
public DateTimeAttribute(Date dateTime)
DateTimeAttribute
that represents
the supplied date but uses default timezone and offset values.
dateTime
- a Date
object representing the
specified date and time down to second
resolution. If this object has non-zero
milliseconds, they are combined
with the nanoseconds parameter.public DateTimeAttribute(Date dateTime, int nanoseconds, int timeZone, int defaultedTimeZone)
DateTimeAttribute
that represents
the date supplied.
dateTime
- a Date
object representing the
specified date and time down to second
resolution. If this object has non-zero
milliseconds, they are combined
with the nanoseconds parameter.nanoseconds
- the number of nanoseconds beyond the
Date specified in the date parametertimeZone
- 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 DateTimeAttribute getInstance(Node root) throws ParsingException, NumberFormatException, ParseException
DateTimeAttribute
that represents
the xs:dateTime at a particular DOM node.
root
- the Node
that contains the desired value
DateTimeAttribute
representing the
appropriate value
ParsingException
- if any problems occurred while parsing
NumberFormatException
ParseException
public static DateTimeAttribute getInstance(String value) throws ParsingException, NumberFormatException, ParseException
DateTimeAttribute
that represents
the xs:dateTime value indicated by the string provided.
value
- a string representing the desired value
DateTimeAttribute
representing the
desired value
ParsingException
- if the text is formatted incorrectly
NumberFormatException
- if the nanosecond format is incorrect
ParseException
public Date getValue()
Date
object representing the
specified date and time down to second resolution.
Subsecond values are handled by the
getNanoseconds
method.
NOTE: The Date
object is cloned before it
is returned to avoid unauthorized changes.
getValue
in class AttributeValue
Date
object representing the date and
time represented by this objectpublic int getNanoseconds()
public int getTimeZone()
public int getDefaultedTimeZone()
public boolean equals(Object o)
Two DateTimeAttribute
s are equal if and only if the
dates and times represented are identical (down to the nanosecond).
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
|
JBoss port of sunxacml 2.0.8.Final-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |