public abstract class Value
extends java.lang.Object
getStringValue creates an object carrying a stringgetBinaryValue creates an object carrying binary data
(stream or byte array)getLongValue creates an object carrying an integergetDoubleValue creates an object carrying a
floating-point valuegetDateValue creates an object carrying a dategetBooleanValue creates an object carrying a boolean| Constructor and Description |
|---|
Value() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
calendarToFeedXml(java.util.Calendar calendar)
Formats a calendar object for the Feeds Protocol, using the
ISO-8601 format for just the date portion.
|
static java.lang.String |
calendarToIso8601(java.util.Calendar calendar)
Formats a calendar object according to the
ISO-8601 specification.
|
static java.lang.String |
calendarToRfc822(java.util.Calendar calendar)
Formats a calendar object according to the
RFC 822
specification.
|
static Value |
getBinaryValue(byte[] byteArrayValue)
Creates a value carrying binary data.
|
static Value |
getBinaryValue(java.io.InputStream inputStreamValue)
Creates a value carrying binary data.
|
static Value |
getBinaryValue(InputStreamFactory inputStreamFactory)
Creates a value carrying binary data.
|
static Value |
getBooleanValue(boolean booleanValue)
Creates a value carrying a boolean.
|
static Value |
getBooleanValue(java.lang.String stringValue)
Creates a value carrying a boolean.
|
static Value |
getDateValue(java.util.Calendar calendarValue)
Creates a value carrying a date.
|
static Value |
getDoubleValue(double doubleValue)
Creates a value carrying an integer.
|
static Value |
getLongValue(long longValue)
Creates a value carrying an integer.
|
static Value |
getPrincipalValue(Principal principal)
Creates a value carrying a principal.
|
static Value |
getPrincipalValue(java.lang.String name)
Creates a value carrying a principal.
|
static Value |
getSingleValue(Document document,
java.lang.String propertyName)
Convenience function for access to a single named value from a
Document. |
static java.lang.String |
getSingleValueString(Document document,
java.lang.String propertyName)
Convenience function for access to a single string value from a
Document. |
static Value |
getStringValue(java.lang.String stringValue)
Creates a value carrying a String.
|
static java.util.Calendar |
iso8601ToCalendar(java.lang.String dateString)
Parses a String in
ISO-8601 format (GMT zone) and returns an equivalent
java.util.Calendar object. |
static void |
setFeedTimeZone(java.lang.String id)
Sets the time zone used to format date values for the feed to the
given time zone.
|
abstract java.lang.String |
toString()
Returns a string representation of the
Value. |
public static Value getStringValue(java.lang.String stringValue)
stringValue - the String valueValue instance carrying this valuepublic static Value getBinaryValue(java.io.InputStream inputStreamValue)
inputStreamValue - an InputStream containing the dataValue instance carrying this datapublic static Value getBinaryValue(InputStreamFactory inputStreamFactory)
inputStreamFactory - an InputStreamFactoryValue instance carrying this datapublic static Value getBinaryValue(byte[] byteArrayValue)
byteArrayValue - an byte array containing the dataValue instance carrying this datapublic static Value getLongValue(long longValue)
longValue - a long containing the dataValue instance carrying this datapublic static Value getDoubleValue(double doubleValue)
doubleValue - a double containing the dataValue instance carrying this datapublic static Value getDateValue(java.util.Calendar calendarValue)
calendarValue - a Calendar object containing the dataValue instance carrying this datapublic static Value getBooleanValue(boolean booleanValue)
booleanValue - a boolean containing the dataValue instance carrying this datapublic static Value getBooleanValue(java.lang.String stringValue)
stringValue - A String containing the data. The String
is converted as follows:
false.null and the empty
string) return true.Value instance carrying this datapublic static Value getPrincipalValue(java.lang.String name)
name - a String representing the name of a principal.public static Value getPrincipalValue(Principal principal)
principal - a Principalpublic static Value getSingleValue(Document document, java.lang.String propertyName) throws RepositoryException
Document.document - the Document from which to extract the
ValuepropertyName - the name of the PropertyValue of that named property, if there is one -
null otherwiseRepositoryExceptionpublic static java.lang.String getSingleValueString(Document document, java.lang.String propertyName) throws RepositoryException
Document.document - the Document from which to extract the
ValuepropertyName - the name of the PropertyValue of that named property, if there is one -
null otherwiseRepositoryExceptionpublic abstract java.lang.String toString()
Value. Connector developers
may count on this for debugging.toString in class java.lang.ObjectValuepublic static void setFeedTimeZone(java.lang.String id)
id - the time zone ID, or null or
"" (empty string) to specify the default time zoneTimeZone.getTimeZone(java.lang.String),
TimeZone.getDefault()public static java.lang.String calendarToFeedXml(java.util.Calendar calendar)
calendar - a Calendarpublic static java.lang.String calendarToRfc822(java.util.Calendar calendar)
calendar - a Calendarpublic static java.lang.String calendarToIso8601(java.util.Calendar calendar)
calendar - a Calendarpublic static java.util.Calendar iso8601ToCalendar(java.lang.String dateString)
throws java.text.ParseException
java.util.Calendar object.dateString - the date string to parsejava.text.ParseException - if the the String can not be parsed