public interface Item extends IAdaptable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Item.ItemFlag
Enum for the field flags for an Item
|
| Modifier and Type | Method and Description |
|---|---|
Item |
convertRFC822TextItem()
This function converts the input
ItemDataType.TYPE_RFC822_TEXT item in an open document
to its pre-V5 equivalent; i.e. |
void |
copyToDocument(Document doc,
boolean overwrite)
Copies this item to a new document, retaining the current name.
|
void |
copyToDocument(Document doc,
String newItemName,
boolean overwrite)
Copies this item to a new document, with a new Item name.
|
<T> T |
get(Class<T> valueType,
T defaultValue)
Returns the item value converted to the specified data type.
We currently support the following value types out of the box: String
Integer
Long
Double
DominoDateTime
LocalDate
LocalTime
OffsetDateTime
TemporalAccessor (returned as DominoDateTime)
Additional value types are supported by implementing and registering DocumentValueConverter as Java services. |
<T> List<T> |
getAsList(Class<T> valueType,
List<T> defaultValue)
Returns a list of item values converted to the specified data type.
We currently support the following value types out of the box: String
Integer
Long
Double
DominoDateTime
LocalDate
LocalTime
OffsetDateTime
TemporalAccessor (returned as DominoDateTime)
Additional value types are supported by implementing and registering DocumentValueConverter as Java services. |
Set<Item.ItemFlag> |
getFlags()
Gets all the field flags corresponding to the Item
|
Optional<MimeEntity> |
getMimeEntity()
Retrieves the item content as a MIME entity, if this is a MIME item.
|
String |
getName()
Gets the field name.
|
DocumentProperties |
getProperties()
Extracts the key elements available in the Notes Client Document Properties window,
so they can be made available in a serializable format
|
int |
getSequenceNumber()
Incremental integer for the nth save this Item was last updated.
|
ItemDataType |
getType()
Gets the data type for a field, converting it to the more readable enum
|
int |
getTypeValue()
Gets the data type for a field, as the internal int
|
List<Object> |
getValue()
Decodes the item value(s).
|
int |
getValueLength()
Returns the value length in bytes
|
boolean |
isEncrypted()
Whether or not the Item requires additional encryption key in addition to database-level
and document-level Reader access in order to see the content.
|
boolean |
isNames()
Whether or not the NAMES field flag is applied on this Item.
|
boolean |
isProtected()
Whether or not the Item prevents access if the person only has Author access to the database.
|
boolean |
isReaders()
Whether or not the READERS field flag is applied on this Item.
|
boolean |
isReadWriters()
Whether or not the READWRITERS field flag is applied on this Item.
|
boolean |
isSigned()
Whether or not the Item will be signed next time the document is saved.
|
boolean |
isSummary()
Whether or not the SUMMARY field flag is applied on this Item.
|
void |
remove()
Remove this item from the parent document
|
void |
setEncrypted(boolean isEncrypted)
Change whether or not the Item requires additional encryption key in addition to database-level
and document-level Reader access in order to see the content.
|
void |
setNames(boolean isNames)
Sets the NAMES field flag on this Item.
|
void |
setProtected(boolean isProtected)
Change whether or not the Item prevents access if the person only has Author access to the database.
|
void |
setReaders(boolean isReaders)
Sets the READERS field flag on this Item.
|
void |
setReadWriters(boolean isReadWriters)
Sets the READWRITERS field flag on this Item.
|
void |
setSigned(boolean isSigned)
Change whether or not the Item will be signed next time the document is saved.
|
void |
setSummary(boolean b)
Changes the summary field flag
|
getAdapterString getName()
int getTypeValue()
ItemDataType getType()
ItemDataType.TYPE_INVALID_OR_UNKNOWN if it is unknown<T> T get(Class<T> valueType, T defaultValue)
StringIntegerLongDoubleDominoDateTimeLocalDateLocalTimeOffsetDateTimeTemporalAccessor (returned as DominoDateTime)DocumentValueConverter as Java services.T - type of return valuevalueType - class of return valuedefaultValue - default value to be returned of object property is not setIllegalArgumentException - if the specified value type is unsupported<T> List<T> getAsList(Class<T> valueType, List<T> defaultValue)
StringIntegerLongDoubleDominoDateTimeLocalDateLocalTimeOffsetDateTimeTemporalAccessor (returned as DominoDateTime)DocumentValueConverter as Java services.T - type of return valuevalueType - class of return valuedefaultValue - default value to be returned of object property is not setIllegalArgumentException - if the specified value type is unsupportedList<Object> getValue()
ItemDataType.TYPE_TEXT.
ItemDataType.TYPE_TEXT - List with String objectItemDataType.TYPE_TEXT_LIST - List of String objectsItemDataType.TYPE_NUMBER - List with Double objectItemDataType.TYPE_NUMBER_RANGE - List of Double objectsItemDataType.TYPE_TIME - List with Calendar objectItemDataType.TYPE_TIME_RANGE - List of Calendar objectsItemDataType.TYPE_OBJECT with the subtype Attachment (e.g. $File items) - List with Attachment objectItemDataType.TYPE_NOTEREF_LIST - List with one UNIDItemDataType.TYPE_UNAVAILABLE - returns an empty listList of objects representing the item valuevoid copyToDocument(Document doc, boolean overwrite)
doc - target document for the new itemoverwrite - true to replace any existing item with the same namevoid copyToDocument(Document doc, String newItemName, boolean overwrite)
doc - target document for the new itemnewItemName - new Item name to save asoverwrite - true to replace any existing item with the same nameint getSequenceNumber()
Set<Item.ItemFlag> getFlags()
boolean isSummary()
void setSummary(boolean b)
b - new flag valueboolean isNames()
boolean isReaders()
boolean isReadWriters()
boolean isProtected()
setProtected(false) before making a change, and
set it back to true afterwards.
Item itm = doc.getFirstItem("Foo");
if (itm.isProtected()) {
itm.setProtected(false);
doc.replaceItemValue("Foo", "bar");
itm.setProtected(true);
}
boolean isEncrypted()
boolean isSigned()
void setNames(boolean isNames)
isNames - true to enable NAMES flag on the Itemvoid setReaders(boolean isReaders)
isReaders - true to enable READERS flag on the Itemvoid setReadWriters(boolean isReadWriters)
isReadWriters - true to enable READWRITERS flag on the Itemvoid setProtected(boolean isProtected)
setProtected(false) before making a change, and
set it back to true afterwards.
Item itm = doc.getFirstItem("Foo");
if (itm.isProtected()) {
itm.setProtected(false);
doc.replaceItemValue("Foo", "bar");
itm.setProtected(true);
}
isProtected - true if editor access or above is required to edit the Itemvoid setEncrypted(boolean isEncrypted)
isEncrypted - true if the Item is encryptedvoid setSigned(boolean isSigned)
isSigned - true if the Item will be signedDocumentProperties getProperties()
DocumentProperties object representing the document's meta propertiesOptional<MimeEntity> getMimeEntity()
Optional describing a MimeEntity for the item content, or
an empty one if this is not a MIME itemItem convertRFC822TextItem()
ItemDataType.TYPE_RFC822_TEXT item in an open document
to its pre-V5 equivalent; i.e. to ItemDataType.TYPE_TEXT, ItemDataType.TYPE_TEXT_LIST,
or ItemDataType.TYPE_TIME.ItemDataType.TYPE_RFC822_TEXT item to a
ItemDataType.TYPE_TIME item.Document.save().void remove()
int getValueLength()
Copyright © 2019–2021 HCL. All rights reserved.