|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bea.domingo.mock.MockItem
public final class MockItem
Transient mock implementation of interface DItem.
Field Summary |
---|
Fields inherited from interface de.bea.domingo.DItem |
---|
ACTIONCD, ASSISTANTINFO, ATTACHMENT, AUTHORS, COLLATION, DATETIMES, EMBEDDEDOBJECT, ERRORITEM, FORMULA, HTML, ICON, LSOBJECT, MIME_PART, NAMES, NOTELINKS, NOTEREFS, NUMBERS, OTHEROBJECT, QUERYCD, READERS, RICHTEXT, SIGNATURE, TEXT, UNAVAILABLE, UNKNOWN, USERDATA, USERID, VIEWMAPDATA, VIEWMAPLAYOUT |
Constructor Summary | |
---|---|
MockItem()
|
Method Summary | |
---|---|
java.lang.String |
abstractText(int maxlen,
boolean dropVowels,
boolean userDict)
Abbreviates the contents of a text item. |
void |
appendToTextList(java.util.List values)
For an item that's a text list, adds a new value to the item without erasing any existing values. |
void |
appendToTextList(java.lang.String value)
For an item that's a text list, adds a new value to the item without erasing any existing values. |
boolean |
containsValue(java.util.Calendar value)
Checks whether a value matches at least one of an item's values. |
boolean |
containsValue(double value)
Checks whether a value matches at least one of an item's values. |
boolean |
containsValue(java.lang.Double value)
Checks whether a value matches at least one of an item's values. |
boolean |
containsValue(int value)
Checks whether a value matches at least one of an item's values. |
boolean |
containsValue(java.lang.Integer value)
Checks whether a value matches at least one of an item's values. |
boolean |
containsValue(java.lang.String value)
Checks whether a value matches at least one of an item's values. |
DItem |
copyItemToDocument(DDocument document)
Copies an item to a specified document. |
DItem |
copyItemToDocument(DDocument document,
java.lang.String newName)
Copies an item to a specified document. |
java.io.InputStream |
getInputStream()
InputStream representation of the contents of an EmbeddedObject, Item, or MIMEEntity object. |
java.util.Calendar |
getLastModified()
The date that an item was last modified. |
java.lang.String |
getName()
Returns the name of an item. |
java.io.Reader |
getReader()
Contents of an EmbeddedObject, Item, or MIMEEntity object in the form of a java.io.Reader object. |
int |
getSize()
Returns the number of values in a item. |
java.lang.String |
getText()
A plain text representation of an item's value. |
java.lang.String |
getText(int maxLen)
A plain text representation of an item's value. |
int |
getType()
The data type of an item. |
java.lang.Object |
getValueCustomData()
Returns as an object the value of an item containing custom data. |
java.lang.Object |
getValueCustomData(java.lang.String type)
Returns as an object the value of an item containing custom data. |
byte[] |
getValueCustomDataBytes(java.lang.String type)
Returns as a byte array the value of an item containing custom data. |
DDateRange |
getValueDateRange()
Returns the value of an item with two Calendar value, a date range. |
java.util.Calendar |
getValueDateTime()
Returns the value of an item with a single Calendar value. |
java.lang.Double |
getValueDouble()
Returns the value of an item with a single double value. |
java.lang.Integer |
getValueInteger()
Returns the value of an item with a single int value. |
int |
getValueLength()
The bytes of internal storage, including overhead, required to store an item. |
java.util.List |
getValues()
Returns the value of an item. |
java.lang.String |
getValueString()
Returns the value of an item with a single text value. |
boolean |
isAuthors()
Indicates whether an item is of type Authors. |
boolean |
isEncrypted()
Indicates whether an item is encrypted. |
boolean |
isNames()
Indicates whether an item is of type Names. |
boolean |
isProtected()
Indicates whether a user needs at least Editor access to modify an item. |
boolean |
isReaders()
Indicates whether an item is of type Readers. |
boolean |
isSaveToDisk()
Indicates whether an item is saved when the document is saved. |
boolean |
isSigned()
Indicates whether a document contains a signature. |
boolean |
isSummary()
Indicates whether an item contains summary or non-summary data. |
void |
remove()
Permanently deletes an item from a document. |
void |
setAuthors(boolean flag)
Indicates whether an item is of type Authors. |
void |
setEncrypted(boolean flag)
Indicates whether an item is encrypted. |
void |
setNames(boolean flag)
Indicates whether an item is of type Names. |
void |
setProtected(boolean flag)
Indicates whether a user needs at least Editor access to modify an item. |
void |
setReaders(boolean flag)
Indicates whether an item is of type Readers. |
void |
setSaveToDisk(boolean flag)
Indicates whether an item is saved when the document is saved. |
void |
setSigned(boolean flag)
Indicates whether an item contains a signature the next time the document is signed. |
void |
setSummary(boolean flag)
Indicates whether an item contains summary or non-summary data. |
void |
setValueCustomData(java.lang.Object obj)
Sets the value of an item to custom data from an object. |
void |
setValueCustomData(java.lang.String type,
java.lang.Object obj)
Sets the value of an item to custom data from an object. |
void |
setValueCustomDataBytes(java.lang.String type,
byte[] bytes)
Sets the value of an item to custom data from a byte array. |
void |
setValueDateRange(java.util.Calendar calendar1,
java.util.Calendar calendar2)
Sets the value of an item to a date range. |
void |
setValueDateRange(DDateRange dateRange)
Sets the value of an item to a date range. |
void |
setValueDateTime(java.util.Calendar calendar)
Sets the value of an item to a single datetime value. |
void |
setValueDateTime(java.util.TimeZone timezone)
Sets the value of an item to a single time zone value. |
void |
setValueDouble(double d)
Sets the value of an item to a single numeric value. |
void |
setValueDouble(java.lang.Double d)
Sets the value of an item to a single numeric value. |
void |
setValueInteger(int i)
Sets the value of an item to a single numeric value. |
void |
setValueInteger(java.lang.Integer i)
Sets the value of an item to a single numeric value. |
void |
setValues(java.util.List values)
Sets the value of an item. |
void |
setValueString(java.lang.String value)
Sets the value of an item to a single string value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.bea.domingo.DBase |
---|
equals, hashCode, toString |
Constructor Detail |
---|
public MockItem()
Method Detail |
---|
public java.util.List getValues()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
If the item has no value, this method returns an empty vector.
If no item with the specified name exists, this method returns an empty vector. It does not throw an exception. Use hasItem to verify the existence of an item.
This property returns the same value(s) for an item as getValues in Item.
getValues
in interface DItem
DItem.getValues()
public void setValues(java.util.List values)
The value of an item in general is a list of values.
Legal types for the list elements are:
java.util.Calendar
java.util.Integer
java.util.Double
java.util.String
setValues
in interface DItem
values
- the valuesDItem.setValues(java.util.List)
public java.lang.String getValueString()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
The value of the item cannot be null, but if the value is numeric or Calendar, this method returns an empty String.
If no item with the specified name exists, this method returns null. It does not throw an exception. Use hasItem to verify the existence of an item.
If the item has multiple values, this method returns the first value.
getValueString
in interface DItem
DItem.getValueString()
public java.lang.Integer getValueInteger()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
If
the value is text and is empty, this method returns null
.
If the value is text and cannot be converted to an integer, this
method returns null
.
If no item with the
specified name exists, this method returns null
. It does
not throw an exception. Use hasItem to verify the existence of an item.
If the item has multiple values, this method returns the first value.
A decimal number is rounded down if the fraction is less than 0.5 and up if the fraction is 0.5 or greater.
getValueInteger
in interface DItem
null
DItem.getValueInteger()
public java.lang.Double getValueDouble()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
If
the value is text and is empty, this method returns null
.
If the value is text and cannot be converted to a double, this method
returns null
.
If no item with the specified name
exists, this method returns null
. It does not throw an
exception. Use hasItem to verify the existence of an item.
If the item has multiple values, this method returns the first value.
A decimal number is rounded down if the fraction is less than 0.5 and up if the fraction is 0.5 or greater.
getValueDouble
in interface DItem
null
DItem.getValueDouble()
public java.util.Calendar getValueDateTime()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
If
value is numeric or text, this method returns null
.
If no item with the specified name exists, this method returns
null
. It does not throw an exception. Use hasItem to
verify the existence of an item.
If the item has multiple values, this method returns the first value.
getValueDateTime
in interface DItem
null
if the
item doesn't contain a date/time valueDItem.getValueDateTime()
public void setValueString(java.lang.String value)
setValueString
in interface DItem
value
- the value to setDItem.setValueString(java.lang.String)
public void setValueInteger(int i)
If you want to simulate an empty field in the Lotus Notes Client, you should use this method with an object argument.
setValueInteger
in interface DItem
i
- the valueDItem.setValueInteger(int)
public void setValueInteger(java.lang.Integer i)
If the value is null
, a TEXT
item with
an empty string value is set. This behavior is the same as the Lotus
Notes Client does with empty fields.
setValueInteger
in interface DItem
i
- the valueDItem.setValueInteger(java.lang.Integer)
public void setValueDouble(double d)
If you want to simulate an empty field in the Lotus Notes Client, you should use this method with an object argument.
setValueDouble
in interface DItem
d
- the valueDItem.setValueDouble(double)
public void setValueDouble(java.lang.Double d)
If the value is null
, a TEXT
item with
an empty string value is set. This behavior is the same as the Lotus
Notes Client does with empty fields.
setValueDouble
in interface DItem
d
- the valueDItem.setValueDouble(java.lang.Double)
public void setValueDateTime(java.util.Calendar calendar)
setValueDateTime
in interface DItem
calendar
- the dateDItem.setValueDateTime(java.util.Calendar)
public void appendToTextList(java.lang.String value)
appendToTextList
in interface DItem
value
- The string you want to add to the item.DItem.appendToTextList(java.lang.String)
public boolean isSummary()
Items are flagged as containing summary or non-summary data. Summary data can appear in views and folders; non-summary data cannot. In general, items created through the UI are tagged as non-summary if they contain rich text or are very long.
When you create a new item using appendItemValue or replaceItemValue in NotesDocument, the isSummary property for the item is true. If you don't want the item to appear in views and folders, you must change its IsSummary property to false.
You can enable or disable the appearance of an existing item in views and folders by changing its IsSummary property.
An item whose IsSummary property is true may not appear as expected in views and folders if the data is not suitable. For example, a rich text item whose IsSummary property is true generally appears as a question mark.
isSummary
in interface DItem
true
if the item contains summary data
false
if the item contains non-summary dataDItem.isSummary()
public void setSummary(boolean flag)
Items are flagged as containing summary or non-summary data. Summary data can appear in views and folders; non-summary data cannot. In general, items created through the UI are tagged as non-summary if they contain rich text or are very long.
When you create a new item using appendItemValue or replaceItemValue in NotesDocument, the isSummary property for the item is true. If you don't want the item to appear in views and folders, you must change its IsSummary property to false.
You can enable or disable the appearance of an existing item in views and folders by changing its IsSummary property.
Example:
DDocument doc; //...set value of doc... doc.replaceItemValue("MyNoSummaryItem", "myValue").setSummary(false);
setSummary
in interface DItem
flag
- true
if the item contains summary data
false
if the item contains non-summary dataDItem.setSummary(boolean)
public boolean isNames()
Usage
A Names item contains a list of user names. A
Names item returns Item.TEXT
for getType.
isNames
in interface DItem
true
if the item is of type Names, else
false
.DItem.isNames()
public void setNames(boolean flag)
Usage
A Names item contains a list of user names. A
Readers item returns Item.TEXT
for getType.
Example:
DDocument doc; //...set value of doc... doc.replaceItemValue("MyNames", "[Admin]").setNames(true);
setNames
in interface DItem
flag
- true
if the item should be of type Names, elsefalse
.DItem.setNames(boolean)
public boolean isReaders()
Usage
A Readers item contains a list of user names
indicating people who have Reader access to a document. A Readers item
returns Item.TEXT
for getType.
isReaders
in interface DItem
true
if the item is of type Readers, else
false
.DItem.isReaders()
public void setReaders(boolean flag)
Usage
A Readers item contains a list of user names
indicating people who have Reader access to a document. A Readers item
returns Item.TEXT
for getType.
Example:
DDocument doc; //...set value of doc... doc.replaceItemValue("MyReaders", "[Admin]").setReaders(true);
setReaders
in interface DItem
flag
- true
if the item should be of type Readers,
elsefalse
.DItem.setReaders(boolean)
public boolean isAuthors()
Usage
An Authors item contains a list of user names
indicating people who have Author access to a document. An Authors item
returns Item.TEXT
for getType.
isAuthors
in interface DItem
true
if the item is of type Authors, else
false
.DItem.isAuthors()
public void setAuthors(boolean flag)
Usage
An Authors item contains a list of user names
indicating people who have Author access to a document. An Authors item
returns Item.TEXT
for getType.
Example:
DDocument doc; //...set value of doc... doc.replaceItemValue("MyAuthors", "[Admin]").setAuthors(true);
setAuthors
in interface DItem
flag
- true
if the item should be of type Authors,
elsefalse
.DItem.setAuthors(boolean)
public int getSize()
getSize
in interface DItem
DItem.getSize()
public java.lang.String getName()
getName
in interface DBaseItem
DBaseItem.getName()
public void remove()
remove
in interface DBaseItem
DBaseItem.remove()
public DDateRange getValueDateRange()
If multiple items have the same name, this method returns the value of the first item. Use the Items property to get all the items.
If
value is numeric or text, this method returns null
.
If no item with the specified name exists, this method returns
null
. It does not throw an exception. Use hasItem to
verify the existence of an item.
getValueDateRange
in interface DItem
null
if
the item doesn't contain any date/time value. The second value
may be null
if only one date/time was specified.DItem.getValueDateRange()
public void setValueDateRange(DDateRange dateRange)
If the value is
null
, a TEXT
item with an empty string
value is set. This behavior is the same as the Lotus Notes Client does
with empty fields.
If both calendars are null, an item with an empty string is created. If only one calendar is not null, this calendar is stored as a single date value.
The milliseconds are cut off.
setValueDateRange
in interface DItem
dateRange
- the date rangeDItem.setValueDateRange(de.bea.domingo.DDateRange)
public void setValueDateRange(java.util.Calendar calendar1, java.util.Calendar calendar2)
If both calendars are null, an item with an empty string is created. If only one calendar is not null, this calendar is stored as a single date value.
The milliseconds are cut off.
setValueDateRange
in interface DItem
calendar1
- start date/time of rangecalendar2
- end date/time of rangeDItem.setValueDateRange(java.util.Calendar,
java.util.Calendar)
public void appendToTextList(java.util.List values)
appendToTextList
in interface DItem
values
- The string(s) you want to add to the item. Each list
element is an object of type String.DItem.appendToTextList(java.util.List)
public boolean containsValue(java.lang.String value)
containsValue
in interface DItem
value
- String value to check for
DItem.containsValue(java.lang.String)
public boolean containsValue(java.lang.Integer value)
containsValue
in interface DItem
value
- integer value to check for
DItem.containsValue(java.lang.Integer)
public boolean containsValue(int value)
containsValue
in interface DItem
value
- integer value to check for
DItem.containsValue(int)
public boolean containsValue(java.lang.Double value)
containsValue
in interface DItem
value
- integer value to check for
DItem.containsValue(java.lang.Double)
public boolean containsValue(double value)
containsValue
in interface DItem
value
- integer value to check for
DItem.containsValue(double)
public boolean containsValue(java.util.Calendar value)
containsValue
in interface DItem
value
- Calendar value to check for
DItem.containsValue(java.util.Calendar)
public boolean isProtected()
isProtected
in interface DItem
true
if you need at least Editor access to modify
the item, false
if you do not need Editor access
to modify the item; you can modify it as long as you have Author
access or betterDItem.isProtected()
public void setProtected(boolean flag)
setProtected
in interface DItem
flag
- true
if you need at least Editor access to
modify the item, false
if you do not need
Editor access to modify the item; you can modify it as long as
you have Author access or betterDItem.setProtected(boolean)
public java.lang.String abstractText(int maxlen, boolean dropVowels, boolean userDict)
abstractText
in interface DItem
maxlen
- The maximum length of the abbreviation.dropVowels
- Specify true if you want to drop vowels from the words
in the item. Otherwise, specify false.userDict
- Specify true if you want to use the table of
abbreviations in NOTEABBR.TXT. Otherwise, specify false.
DItem.abstractText(int, boolean, boolean)
public DItem copyItemToDocument(DDocument document)
When you call this method using a RichTextItem object, file attachments, embedded objects, and object links that are contained within the rich-text item are not copied to the destination document.
copyItemToDocument
in interface DItem
document
- The document on which to create the item. Cannot be null.
DItem.copyItemToDocument(de.bea.domingo.DDocument)
public DItem copyItemToDocument(DDocument document, java.lang.String newName)
When you call this method using a RichTextItem object, file attachments, embedded objects, and object links that are contained within the rich-text item are not copied to the destination document.
copyItemToDocument
in interface DItem
document
- The document on which to create the item. Cannot be null.newName
- The name of the new item. Specify an empty string ("") if
you want to keep the name of the original item.
DItem.copyItemToDocument(de.bea.domingo.DDocument, java.lang.String)
public java.util.Calendar getLastModified()
getLastModified
in interface DItem
DItem.getLastModified()
public java.lang.String getText()
Multiple values in a list are separated by semicolons in the returned string. If an item's value is large, the returned string may be truncated.
For rich-text items, this property skips non-text data such as bitmaps and file attachments.
For HTML items, this property returns null.
getText
in interface DItem
DItem.getText()
public java.lang.String getText(int maxLen)
Multiple values in a list are separated by semicolons in the returned string. If an item's value is large, the returned string may be truncated.
For rich-text items, this property skips non-text data such as bitmaps and file attachments.
For HTML items, this property returns null.
getText
in interface DItem
maxLen
- Maximum length of returned text
DItem.getText(int)
public int getType()
getType
in interface DItem
DItem.getType()
public int getValueLength()
getValueLength
in interface DItem
DItem.getValueLength()
public void setValueCustomData(java.lang.String type, java.lang.Object obj)
The new value replaces the existing value.
To keep the changes, you must call Document.save after calling setValueCustomData.
The custom data cannot exceed 64K.
If you intend to get the custom data through a language binding other than Java, use a "Bytes" method.
setValueCustomData
in interface DItem
type
- A name for the data type. When getting custom data, use this
name for verification.obj
- An object that contains the custom data. The class that
defines this object must implement Serializable. If desired,
you can override readObject and writeObject.DItem.setValueCustomData(java.lang.String, java.lang.Object)
public void setValueCustomData(java.lang.Object obj)
The new value replaces the existing value.
To keep the changes, you must call Document.save after calling setValueCustomData.
The custom data cannot exceed 64K.
If you intend to get the custom data through a language binding other than Java, use a "Bytes" method.
setValueCustomData
in interface DItem
obj
- An object that contains the custom data. The class that
defines this object must implement Serializable. If desired,
you can override readObject and writeObject.DItem.setValueCustomData(java.lang.Object)
public void setValueCustomDataBytes(java.lang.String type, byte[] bytes)
The new value replaces the existing value.
To keep the changes, you must call Document.save after calling setValueCustomData.
The custom data cannot exceed 64K.
If you intend to get the custom data through a language binding other than Java, use a "Bytes" method.
setValueCustomDataBytes
in interface DItem
type
- A name for the data type. When getting custom data, use this
name for verification.bytes
- A byte array that contains the custom data.DItem.setValueCustomDataBytes(java.lang.String, byte[])
public java.lang.Object getValueCustomData(java.lang.String type)
getValueCustomData
in interface DItem
type
- The name of the data type. If specified, this name must match
the data type name specified when the item was written. If
omitted, no name checking occurs.
DItem.getValueCustomData(java.lang.String)
public java.lang.Object getValueCustomData()
getValueCustomData
in interface DItem
DItem.getValueCustomData()
public byte[] getValueCustomDataBytes(java.lang.String type)
getValueCustomDataBytes
in interface DItem
type
- The name of the data type. This name must match the data type
name specified when the item was written.
DItem.getValueCustomDataBytes(java.lang.String)
public boolean isEncrypted()
If you set this property to true, the item is not actually encrypted
until you call DBaseDocument.encrypt()
on the parent Document.
isEncrypted
in interface DItem
true
if the item is encrypted, else
false
DItem.isEncrypted()
public void setEncrypted(boolean flag)
setEncrypted
in interface DItem
flag
- true
if the item is encrypted, else
false
DItem.setEncrypted(boolean)
public boolean isSaveToDisk()
isSaveToDisk
in interface DItem
true
(default) if the item is saved when the
document is saved, else false
DItem.isSaveToDisk()
public void setSaveToDisk(boolean flag)
setSaveToDisk
in interface DItem
flag
- true
(default) if the item is saved when the
document is saved, else false
DItem.setSaveToDisk(boolean)
public boolean isSigned()
use DBaseDocument.getSigner()
and DBaseDocument.getVerifier()
to get the Signer and Verifier for a signed document. To access the
signature itself, you must find the item of type SIGNATURE in the
document.
isSigned
in interface DItem
true
if the document contains one or more
signatures, else false
DItem.isSigned()
public void setSigned(boolean flag)
setSigned
in interface DItem
flag
- true
if the item is signed when the document
is next signedDItem.setSigned(boolean)
public java.io.Reader getReader()
getReader
in interface DItem
This method creates a temporary file. The file is deleted when EmbeddedObject is recycled.
DItem.getReader()
public java.io.InputStream getInputStream()
This method creates a temporary file. The file is deleted when EmbeddedObject is recycled.
getInputStream
in interface DItem
DItem.getInputStream()
public void setValueDateTime(java.util.TimeZone timezone)
setValueDateTime
in interface DItem
timezone
- the time zoneDItem.setValueDateTime(java.util.TimeZone)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |