public class Asn1TimeUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ANY
For PER, when ANY is combined with CENTURY/YEAR, it indicates that the
type is constrained to values with Year=Ln or NEGATIVE (as for the defined
types named ANY-*), while absence of ANY indicates the type is
constrained to values with Year=Basic or Proleptic.
|
static int |
CENTURY |
static int |
DATE |
static int |
DATE_TIME |
static int |
DAY |
static int |
DIFF
Indicates a time includes a timezone difference from UTC.
|
static int |
DT_ANY_CENTURY |
static int |
DT_ANY_YEAR |
static int |
DT_ANY_YEAR_DAY |
static int |
DT_ANY_YEAR_MONTH |
static int |
DT_ANY_YEAR_MONTH_DAY |
static int |
DT_ANY_YEAR_WEEK |
static int |
DT_ANY_YEAR_WEEK_DAY |
static int |
DT_CENTURY |
static int |
DT_HOURS |
static int |
DT_HOURS_AND_DIFF |
static int |
DT_HOURS_AND_DIFF_AND_FRACTION |
static int |
DT_HOURS_AND_FRACTION |
static int |
DT_HOURS_UTC |
static int |
DT_HOURS_UTC_AND_FRACTION |
static int |
DT_MINUTES |
static int |
DT_MINUTES_AND_DIFF |
static int |
DT_MINUTES_AND_DIFF_AND_FRACTION |
static int |
DT_MINUTES_AND_FRACTION |
static int |
DT_MINUTES_UTC |
static int |
DT_MINUTES_UTC_AND_FRACTION |
static int |
DT_SECONDS |
static int |
DT_SECONDS_AND_DIFF |
static int |
DT_SECONDS_AND_DIFF_AND_FRACTION |
static int |
DT_SECONDS_AND_FRACTION |
static int |
DT_SECONDS_UTC |
static int |
DT_SECONDS_UTC_AND_FRACTION |
static int |
DT_YEAR |
static int |
DT_YEAR_DAY |
static int |
DT_YEAR_MONTH |
static int |
DT_YEAR_MONTH_DAY |
static int |
DT_YEAR_WEEK |
static int |
DT_YEAR_WEEK_DAY |
static int |
DURATION
Indicates a duration.
|
static int |
FRACTION
This is a mask that is used to mark off the bits used for the number of
decimal places for a fraction.
|
static int |
HOURS |
static int |
MINUTES |
static int |
MONTH |
static int |
SECONDS |
static int |
TIME_OF_DAY |
static int |
UTC
Indicates a time is UTC.
|
static int |
WEEK
Week is present.
|
static int |
YEAR |
Constructor and Description |
---|
Asn1TimeUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
convertToDER(java.lang.String timeValue)
Return the DER representation of a TimeValue.
|
static java.lang.String |
decodeDate(Asn1OerDecodeBuffer source,
int flags)
Decode a date value according to OER from the given source.
|
static java.lang.String |
decodeDate(Asn1PerDecodeBuffer source,
int flags)
Decode a date value from the given source.
|
static java.lang.String |
decodeDateTime(Asn1OerDecodeBuffer source,
int flags)
Decode a date-time value from the given source.
|
static java.lang.String |
decodeDateTime(Asn1PerDecodeBuffer source,
int flags)
Decode a date-time value from the given source.
|
static java.lang.String |
decodeDuration(Asn1OerDecodeBuffer buffer)
Decode a duration according to OER from the given buffer.
|
static java.lang.String |
decodeDuration(Asn1PerDecodeBuffer source,
boolean recurring)
Decode a (possibly recurring) duration from the given source.
|
static java.lang.String |
decodeIntervalDE(Asn1PerDecodeBuffer source,
boolean recurring,
int flags) |
static java.lang.String |
decodeIntervalSD(Asn1PerDecodeBuffer source,
boolean recurring,
int flags) |
static java.lang.String |
decodeIntervalSE(Asn1PerDecodeBuffer source,
boolean recurring,
int flags) |
static java.lang.String |
decodeTime(Asn1OerDecodeBuffer buffer,
int flags)
Decode a time value according to OER from the given source.
|
static java.lang.String |
decodeTime(Asn1PerDecodeBuffer source,
int flags)
Decode a time value from the given source.
|
static void |
encodeDate(Asn1OerEncodeBuffer encoder,
java.lang.String value,
int flags)
Encode a date value according to OER, using the given encoder.
|
static void |
encodeDate(Asn1PerEncoder encoder,
java.lang.String value,
int flags)
Encode a date value according to PER, using the given encoder.
|
static void |
encodeDateTime(Asn1OerEncodeBuffer buffer,
java.lang.String value,
int flags)
Encode a datetime value according to OER.
|
static void |
encodeDateTime(Asn1PerEncoder encoder,
java.lang.String value,
int flags)
Encode a datetime value.
|
static void |
encodeDuration(Asn1OerEncodeBuffer buffer,
java.lang.String value)
Encode a duration according to OER.
|
static void |
encodeDuration(Asn1PerEncoder encoder,
java.lang.String value,
boolean recurring)
Encode a duration according to PER.
|
static void |
encodeIntervalDE(Asn1PerEncoder encoder,
java.lang.String value,
boolean recurring,
int flags) |
static void |
encodeIntervalSD(Asn1PerEncoder encoder,
java.lang.String value,
boolean recurring,
int flags) |
static void |
encodeIntervalSE(Asn1PerEncoder encoder,
java.lang.String value,
boolean recurring,
int flags) |
static void |
encodeTime(Asn1OerEncodeBuffer buffer,
java.lang.String value,
int flags)
Encode a time value according to OER.
|
static void |
encodeTime(Asn1PerEncoder encoder,
java.lang.String value,
int flags)
Encode a time value.
|
public static final int ANY
public static final int CENTURY
public static final int YEAR
public static final int MONTH
public static final int WEEK
When used for a date/datetime (without DURATION), MONTH is excluded.
public static final int DAY
public static final int HOURS
public static final int MINUTES
public static final int SECONDS
public static final int UTC
public static final int DIFF
public static final int FRACTION
value & FRACTION = # of decimal places
public static final int DURATION
public static final int DT_ANY_CENTURY
public static final int DT_ANY_YEAR
public static final int DT_ANY_YEAR_MONTH
public static final int DT_ANY_YEAR_MONTH_DAY
public static final int DT_ANY_YEAR_DAY
public static final int DT_ANY_YEAR_WEEK
public static final int DT_ANY_YEAR_WEEK_DAY
public static final int DT_CENTURY
public static final int DT_YEAR
public static final int DT_YEAR_MONTH
public static final int DT_YEAR_MONTH_DAY
public static final int DT_YEAR_DAY
public static final int DT_YEAR_WEEK
public static final int DT_YEAR_WEEK_DAY
public static final int DT_HOURS
public static final int DT_HOURS_UTC
public static final int DT_HOURS_AND_DIFF
public static final int DT_MINUTES
public static final int DT_MINUTES_UTC
public static final int DT_MINUTES_AND_DIFF
public static final int DT_SECONDS
public static final int DT_SECONDS_UTC
public static final int DT_SECONDS_AND_DIFF
public static final int DT_HOURS_AND_FRACTION
public static final int DT_HOURS_UTC_AND_FRACTION
public static final int DT_HOURS_AND_DIFF_AND_FRACTION
public static final int DT_MINUTES_AND_FRACTION
public static final int DT_MINUTES_UTC_AND_FRACTION
public static final int DT_MINUTES_AND_DIFF_AND_FRACTION
public static final int DT_SECONDS_AND_FRACTION
public static final int DT_SECONDS_UTC_AND_FRACTION
public static final int DT_SECONDS_AND_DIFF_AND_FRACTION
public static final int DATE
public static final int TIME_OF_DAY
public static final int DATE_TIME
public static java.lang.String convertToDER(java.lang.String timeValue)
timeValue
- public static java.lang.String decodeDate(Asn1OerDecodeBuffer source, int flags) throws java.io.IOException
source
- flags
- java.io.IOException
public static java.lang.String decodeDateTime(Asn1OerDecodeBuffer source, int flags) throws java.io.IOException
source
- flags
- Indicates what fields are expected. The flags should indicate a
complete date (YMD, YWD, or YD) and at least an hour component.java.io.IOException
public static java.lang.String decodeDuration(Asn1OerDecodeBuffer buffer) throws java.io.IOException
buffer
- java.io.IOException
public static java.lang.String decodeTime(Asn1OerDecodeBuffer buffer, int flags) throws java.io.IOException
buffer
- flags
- Indicates the expected fields.java.io.IOException
public static java.lang.String decodeDuration(Asn1PerDecodeBuffer source, boolean recurring) throws Asn1Exception
source
- recurring
- true if the duration is a recurring durationAsn1Exception
public static java.lang.String decodeIntervalSE(Asn1PerDecodeBuffer source, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static java.lang.String decodeIntervalSD(Asn1PerDecodeBuffer source, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static java.lang.String decodeIntervalDE(Asn1PerDecodeBuffer source, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static java.lang.String decodeDate(Asn1PerDecodeBuffer source, int flags) throws Asn1Exception
source
- flags
- Asn1Exception
public static java.lang.String decodeDateTime(Asn1PerDecodeBuffer source, int flags) throws Asn1Exception
source
- flags
- Indicates what fields are expected. The flags should indicate a
complete date (YMD, YWD, or YD) and at least an hour component.Asn1Exception
public static java.lang.String decodeTime(Asn1PerDecodeBuffer source, int flags) throws Asn1Exception
source
- flags
- Indicates the expected fields.Asn1Exception
public static void encodeDate(Asn1OerEncodeBuffer encoder, java.lang.String value, int flags) throws java.io.IOException
encoder
- value
- flags
- Must have YEAR set.Asn1Exception
java.io.IOException
public static void encodeDateTime(Asn1OerEncodeBuffer buffer, java.lang.String value, int flags) throws java.io.IOException
buffer
- value
- flags
- java.io.IOException
public static void encodeDuration(Asn1OerEncodeBuffer buffer, java.lang.String value) throws java.io.IOException
buffer
- value
- The durationjava.io.IOException
public static void encodeTime(Asn1OerEncodeBuffer buffer, java.lang.String value, int flags) throws java.io.IOException
buffer
- value
- flags
- Indicates the property constraints on the TIME typeAsn1Exception
java.io.IOException
public static void encodeDate(Asn1PerEncoder encoder, java.lang.String value, int flags) throws Asn1Exception
encoder
- value
- flags
- Asn1Exception
public static void encodeDateTime(Asn1PerEncoder encoder, java.lang.String value, int flags) throws Asn1Exception
encoder
- value
- flags
- Asn1Exception
public static void encodeDuration(Asn1PerEncoder encoder, java.lang.String value, boolean recurring) throws Asn1Exception
encoder
- value
- The durationrecurring
- true if value represents a recurring duration.Asn1Exception
public static void encodeIntervalSE(Asn1PerEncoder encoder, java.lang.String value, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static void encodeIntervalSD(Asn1PerEncoder encoder, java.lang.String value, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static void encodeIntervalDE(Asn1PerEncoder encoder, java.lang.String value, boolean recurring, int flags) throws Asn1Exception
Asn1Exception
public static void encodeTime(Asn1PerEncoder encoder, java.lang.String value, int flags) throws Asn1Exception
encoder
- value
- flags
- Asn1Exception