@NotThreadSafe public static class JsonReader.DateValueMatcher extends JsonReader.SimpleValueMatcher
values
Constructor and Description |
---|
JsonReader.DateValueMatcher(DocumentValueFactory values)
Create a new matcher that uses the supplied
DocumentValueFactory instance. |
Modifier and Type | Method and Description |
---|---|
protected Date |
evaluateDate(String millisOrIso) |
protected Date |
parseDateFromLiteral(String value)
Parse the date represented by the supplied value.
|
Object |
parseValue(String value)
Parse the value given by the supplied string into an appropriate value object.
|
public JsonReader.DateValueMatcher(DocumentValueFactory values)
DocumentValueFactory
instance.values
- the factory for creating value objects; may not be nullpublic Object parseValue(String value)
parseValue
in interface JsonReader.ValueMatcher
parseValue
in class JsonReader.SimpleValueMatcher
value
- the string representation of the valueprotected Date parseDateFromLiteral(String value)
parseValue(String)
method. This
method checks the following formats:
"yyyy-MM-ddTHH:mm:ss"
where T
is a literal character"yyyy-MM-ddTHH:mm:ssZ"
where T
and Z
are literal characters"yyyy-MM-ddTHH:mm:ssGMT+00:00"
where
T
, and GMT
are literal characters"/Date(millisOrIso)/"
"\/Date(millisOrIso)\/"
Note that this method does not handle the new Date(...)
or Date(...)
representations, as
that's handled elsewhere.
value
- the string representation of the value; never null and never emptyCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.