de.bea.domingo.proxy
Class ItemProxy

java.lang.Object
  extended by de.bea.domingo.monitor.AbstractMonitorEnabled
      extended by de.bea.domingo.proxy.BaseProxy
          extended by de.bea.domingo.proxy.BaseItemProxy
              extended by de.bea.domingo.proxy.ItemProxy
All Implemented Interfaces:
DBase, DBaseItem, DItem, MonitorEnabled, java.io.Serializable

public final class ItemProxy
extends BaseItemProxy
implements DItem

This class represents the Domino-Class Item.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.bea.domingo.proxy.BaseProxy
BaseProxy.DocumentCollectionIterator
 
Field Summary
static int MAX_VALUE_SIZE
          Maximum size of an items value.
static int VALUE_SEPERATOR_SIZE
          Size of a multiple value separator.
static int VALUE_SIZE_CALENDAR
          Value size of date/time value stored in a Notes item.
static int VALUE_SIZE_NUMBER
          Value size of numeric value stored in a Notes item.
 
Fields inherited from class de.bea.domingo.proxy.BaseProxy
DATETIME_STRING_LENGTH, EMPTY_STRING, MAX_DATETIME_LENGTH, NUM_DATETIME_VALUES, RESOURCES
 
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
protected ItemProxy(NotesProxyFactory theFactory, DBase parent, lotus.domino.Item theItem, DNotesMonitor monitor)
          Constructor for DItemImpl.
 
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.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 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 value)
          Sets the value of an item to a date range.
 void setValueDateTime(java.util.Calendar value)
          Sets the value of an item to a single datetime value.
 void setValueDateTime(java.util.TimeZone value)
          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 de.bea.domingo.proxy.BaseItemProxy
getInstance, getItem, getName, remove, toString
 
Methods inherited from class de.bea.domingo.proxy.BaseProxy
checkSession, clearNotesObject, convertCalendarsToNotesDateTime, convertListToVector, convertNotesDateTimesToCalendar, convertVectorToList, createCalendar, createDateRange, createDateTime, decrementDateTimeCounter, finalize, getCountDateTime, getDSession, getFactory, getNotesObject, getParent, incrementDateTimeCounter, newException, newException, newException, newRuntimeException, newRuntimeException, newRuntimeException, recycleDateTimeList, refereceHashCode, toStringGeneric, toStringIntern
 
Methods inherited from class de.bea.domingo.monitor.AbstractMonitorEnabled
getMonitor, setMonitor
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bea.domingo.DBaseItem
getName, remove
 
Methods inherited from interface de.bea.domingo.DBase
equals, hashCode, toString
 

Field Detail

MAX_VALUE_SIZE

public static final int MAX_VALUE_SIZE
Maximum size of an items value.

See Also:
Constant Field Values

VALUE_SEPERATOR_SIZE

public static final int VALUE_SEPERATOR_SIZE
Size of a multiple value separator.

See Also:
Constant Field Values

VALUE_SIZE_NUMBER

public static final int VALUE_SIZE_NUMBER
Value size of numeric value stored in a Notes item.

See Also:
Constant Field Values

VALUE_SIZE_CALENDAR

public static final int VALUE_SIZE_CALENDAR
Value size of date/time value stored in a Notes item.

See Also:
Constant Field Values
Constructor Detail

ItemProxy

protected ItemProxy(NotesProxyFactory theFactory,
                    DBase parent,
                    lotus.domino.Item theItem,
                    DNotesMonitor monitor)
Constructor for DItemImpl.

Parameters:
theFactory - the controlling factory
parent - the parent object
theItem - the Notes item object
monitor - the monitor
Method Detail

getValues

public java.util.List getValues()
Returns the value of an item.

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.

Specified by:
getValues in interface DItem
Returns:
The value or values contained in the item. The data type of the value depends on the data type of the item.
See Also:
DItem.getValues()

getValueString

public java.lang.String getValueString()
Returns the value of an item with a single text value.

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.

Specified by:
getValueString in interface DItem
Returns:
The value of the item as a String.
See Also:
DItem.getValueString()

getValueInteger

public java.lang.Integer getValueInteger()
Returns the value of an item with a single int value.

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.

Specified by:
getValueInteger in interface DItem
Returns:
The value of the item, rounded to the nearest integer or null
See Also:
DItem.getValueInteger()

getValueDouble

public java.lang.Double getValueDouble()
Returns the value of an item with a single double value.

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.

Specified by:
getValueDouble in interface DItem
Returns:
The value of the item, rounded to the nearest integer or null
See Also:
DItem.getValueDouble()

getValueDateTime

public java.util.Calendar getValueDateTime()
Returns the value of an item with a single Calendar value. The date/time value of the item is stored in the calendar in the default time zone of the client.

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.

Specified by:
getValueDateTime in interface DItem
Returns:
The value of the item as a Calendar or null if the item doesn't contain a date/time value
See Also:
DItem.getValueDateTime()

getValueDateRange

public DDateRange getValueDateRange()
Returns the value of an item with two Calendar value, a date range.

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.

Specified by:
getValueDateRange in interface DItem
Returns:
The value of the item as a DDateRange or null if the item doesn't contain any date/time value. The second value may be null if only one date/time was specified.
See Also:
DItem.getValueDateRange()

appendToTextList

public 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.

Specified by:
appendToTextList in interface DItem
Parameters:
value - The string you want to add to the item.
See Also:
DItem.appendToTextList(java.lang.String)

appendToTextList

public 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.

Specified by:
appendToTextList in interface DItem
Parameters:
values - The string(s) you want to add to the item. Each list element is an object of type String.
See Also:
DItem.appendToTextList(java.util.List)

containsValue

public boolean containsValue(java.lang.String value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - String value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(java.lang.String)

containsValue

public boolean containsValue(java.lang.Integer value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - integer value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(java.lang.Integer)

containsValue

public boolean containsValue(int value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - integer value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(int)

containsValue

public boolean containsValue(java.lang.Double value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - integer value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(java.lang.Double)

containsValue

public boolean containsValue(double value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - integer value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(double)

containsValue

public boolean containsValue(java.util.Calendar value)
Checks whether a value matches at least one of an item's values.

Specified by:
containsValue in interface DItem
Parameters:
value - Calendar value to check for
Returns:
true if the value matches one of the values in the item
See Also:
DItem.containsValue(java.util.Calendar)

setValueDateTime

public void setValueDateTime(java.util.Calendar value)
Sets the value of an item to a single datetime value. The milliseconds are cut off.

Specified by:
setValueDateTime in interface DItem
Parameters:
value - the date
See Also:
DItem.setValueDateTime(java.util.Calendar)

setValueDateRange

public void setValueDateRange(DDateRange value)
Sets the value of an item to a date range.

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.

Specified by:
setValueDateRange in interface DItem
Parameters:
value - the date range
See Also:
DItem.setValueDateRange(de.bea.domingo.DDateRange)

setValueDateRange

public void setValueDateRange(java.util.Calendar calendar1,
                              java.util.Calendar calendar2)
Sets the value of an item to a date range.

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.

Specified by:
setValueDateRange in interface DItem
Parameters:
calendar1 - start date/time of range
calendar2 - end date/time of range
See Also:
DItem.setValueDateRange(java.util.Calendar, java.util.Calendar)

setValueDouble

public void setValueDouble(double d)
Sets the value of an item to a single numeric value.

If you want to simulate an empty field in the Lotus Notes Client, you should use this method with an object argument.

Specified by:
setValueDouble in interface DItem
Parameters:
d - the value
See Also:
DItem.setValueDouble(double)

setValueDouble

public void setValueDouble(java.lang.Double d)
Sets the value of an item to a single numeric value.

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.

Specified by:
setValueDouble in interface DItem
Parameters:
d - the value
See Also:
DItem.setValueDouble(java.lang.Double)

setValueInteger

public void setValueInteger(int i)
Sets the value of an item to a single numeric value.

If you want to simulate an empty field in the Lotus Notes Client, you should use this method with an object argument.

Specified by:
setValueInteger in interface DItem
Parameters:
i - the value
See Also:
DItem.setValueInteger(int)

setValueInteger

public void setValueInteger(java.lang.Integer i)
Sets the value of an item to a single numeric value.

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.

Specified by:
setValueInteger in interface DItem
Parameters:
i - the value
See Also:
DItem.setValueInteger(java.lang.Integer)

setValues

public void setValues(java.util.List values)
Sets the value of an item.

The value of an item in general is a list of values.

Legal types for the list elements are:

Specified by:
setValues in interface DItem
Parameters:
values - the values
See Also:
DItem.setValues(java.util.List)

setValueString

public void setValueString(java.lang.String value)
Sets the value of an item to a single string value.

Specified by:
setValueString in interface DItem
Parameters:
value - the value to set
See Also:
DItem.setValueString(java.lang.String)

isSummary

public boolean isSummary()
Indicates whether an item contains summary or non-summary data.

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.

Specified by:
isSummary in interface DItem
Returns:
true if the item contains summary data false if the item contains non-summary data
See Also:
DItem.isSummary()

setSummary

public void setSummary(boolean flag)
Indicates whether an item contains summary or non-summary data.

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);
 

Specified by:
setSummary in interface DItem
Parameters:
flag - true if the item contains summary data false if the item contains non-summary data
See Also:
DItem.setSummary(boolean)

isNames

public boolean isNames()
Indicates whether an item is of type Names.

Usage
A Names item contains a list of user names. A Names item returns Item.TEXT for getType.

Specified by:
isNames in interface DItem
Returns:
true if the item is of type Names, else false.
See Also:
DItem.isNames()

setNames

public void setNames(boolean flag)
Indicates whether an item is of type Names.

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);
 

Specified by:
setNames in interface DItem
Parameters:
flag - true if the item should be of type Names, elsefalse.
See Also:
DItem.setNames(boolean)

isReaders

public boolean isReaders()
Indicates whether an item is of type Readers.

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.

Specified by:
isReaders in interface DItem
Returns:
true if the item is of type Readers, else false.
See Also:
DItem.isReaders()

setReaders

public void setReaders(boolean flag)
Indicates whether an item is of type Readers.

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);
 

Specified by:
setReaders in interface DItem
Parameters:
flag - true if the item should be of type Readers, elsefalse.
See Also:
DItem.setReaders(boolean)

isAuthors

public boolean isAuthors()
Indicates whether an item is of type Authors.

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.

Specified by:
isAuthors in interface DItem
Returns:
true if the item is of type Authors, else false.
See Also:
DItem.isAuthors()

setAuthors

public void setAuthors(boolean flag)
Indicates whether an item is of type Authors.

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);
 

Specified by:
setAuthors in interface DItem
Parameters:
flag - true if the item should be of type Authors, elsefalse.
See Also:
DItem.setAuthors(boolean)

getSize

public int getSize()
Returns the number of values in a item.

Specified by:
getSize in interface DItem
Returns:
number of values in an item.
See Also:
DItem.getSize()

isProtected

public boolean isProtected()
Indicates whether a user needs at least Editor access to modify an item.

Specified by:
isProtected in interface DItem
Returns:
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 better
See Also:
DItem.isProtected()

setProtected

public void setProtected(boolean flag)
Indicates whether a user needs at least Editor access to modify an item.

Specified by:
setProtected in interface DItem
Parameters:
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 better
See Also:
DItem.setProtected(boolean)

abstractText

public java.lang.String abstractText(int maxlen,
                                     boolean dropVowels,
                                     boolean userDict)
Abbreviates the contents of a text item.

Specified by:
abstractText in interface DItem
Parameters:
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.
Returns:
The contents of the item, with vowels dropped and abbreviations substituted (if specified), then truncated to fit to maximum length.
See Also:
DItem.abstractText(int, boolean, boolean)

copyItemToDocument

public DItem copyItemToDocument(DDocument document)
Copies an item to a specified 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.

Specified by:
copyItemToDocument in interface DItem
Parameters:
document - The document on which to create the item. Cannot be null.
Returns:
The new item.
See Also:
DItem.copyItemToDocument(de.bea.domingo.DDocument)

copyItemToDocument

public DItem copyItemToDocument(DDocument document,
                                java.lang.String newName)
Copies an item to a specified 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.

Specified by:
copyItemToDocument in interface DItem
Parameters:
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.
Returns:
The new item.
See Also:
DItem.copyItemToDocument(de.bea.domingo.DDocument, java.lang.String)

getLastModified

public java.util.Calendar getLastModified()
The date that an item was last modified.

Specified by:
getLastModified in interface DItem
Returns:
The date that an item was last modified
See Also:
DItem.getLastModified()

getText

public java.lang.String getText()
A plain text representation of an item's value.

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.

Specified by:
getText in interface DItem
Returns:
plain text representation of an item's value
See Also:
DItem.getText()

getText

public java.lang.String getText(int maxLen)
A plain text representation of an item's value.

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.

Specified by:
getText in interface DItem
Parameters:
maxLen - Maximum length of returned text
Returns:
plain text representation of an item's value
See Also:
DItem.getText(int)

getType

public int getType()
The data type of an item.

Specified by:
getType in interface DItem
Returns:
type of an item
See Also:
DItem.getType()

getValueLength

public int getValueLength()
The bytes of internal storage, including overhead, required to store an item.

Specified by:
getValueLength in interface DItem
Returns:
length of value
See Also:
DItem.getValueLength()

setValueCustomData

public void setValueCustomData(java.lang.String type,
                               java.lang.Object obj)
Sets the value of an item to custom data from an object.

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.

Specified by:
setValueCustomData in interface DItem
Parameters:
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.
See Also:
DItem.setValueCustomData(java.lang.String, java.lang.Object)

setValueCustomData

public void setValueCustomData(java.lang.Object obj)
Sets the value of an item to custom data from an object.

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.

Specified by:
setValueCustomData in interface DItem
Parameters:
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.
See Also:
DItem.setValueCustomData(java.lang.Object)

setValueCustomDataBytes

public void setValueCustomDataBytes(java.lang.String type,
                                    byte[] bytes)
Sets the value of an item to custom data from a byte array.

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.

Specified by:
setValueCustomDataBytes in interface DItem
Parameters:
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.
See Also:
DItem.setValueCustomDataBytes(java.lang.String, byte[])

getValueCustomData

public java.lang.Object getValueCustomData(java.lang.String type)
Returns as an object the value of an item containing custom data.

Specified by:
getValueCustomData in interface DItem
Parameters:
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.
Returns:
An object that receives the value of the item. Must have the same class definition as the object written to the item.
See Also:
DItem.getValueCustomData(java.lang.String)

getValueCustomData

public java.lang.Object getValueCustomData()
Returns as an object the value of an item containing custom data.

Specified by:
getValueCustomData in interface DItem
Returns:
An object that receives the value of the item. Must have the same class definition as the object written to the item.
See Also:
DItem.getValueCustomData()

getValueCustomDataBytes

public byte[] getValueCustomDataBytes(java.lang.String type)
Returns as a byte array the value of an item containing custom data.

Specified by:
getValueCustomDataBytes in interface DItem
Parameters:
type - The name of the data type. This name must match the data type name specified when the item was written.
Returns:
A byte array that receives the value of the item.
See Also:
DItem.getValueCustomDataBytes(java.lang.String)

isEncrypted

public boolean isEncrypted()
Indicates whether an item is encrypted.

If you set this property to true, the item is not actually encrypted until you call DBaseDocument.encrypt() on the parent Document.

Specified by:
isEncrypted in interface DItem
Returns:
true if the item is encrypted, else false
See Also:
DItem.isEncrypted()

setEncrypted

public void setEncrypted(boolean flag)
Indicates whether an item is encrypted.

Specified by:
setEncrypted in interface DItem
Parameters:
flag - true if the item is encrypted, else false
See Also:
DItem.setEncrypted(boolean)

isSaveToDisk

public boolean isSaveToDisk()
Indicates whether an item is saved when the document is saved.

Specified by:
isSaveToDisk in interface DItem
Returns:
flag true (default) if the item is saved when the document is saved, else false
See Also:
DItem.isSaveToDisk()

setSaveToDisk

public void setSaveToDisk(boolean flag)
Indicates whether an item is saved when the document is saved.

Specified by:
setSaveToDisk in interface DItem
Parameters:
flag - true (default) if the item is saved when the document is saved, else false
See Also:
DItem.setSaveToDisk(boolean)

isSigned

public boolean isSigned()
Indicates whether a document contains a signature.

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.

Specified by:
isSigned in interface DItem
Returns:
true if the document contains one or more signatures, else false
See Also:
DItem.isSigned()

setSigned

public void setSigned(boolean flag)
Indicates whether an item contains a signature the next time the document is signed.

Specified by:
setSigned in interface DItem
Parameters:
flag - true if the item is signed when the document is next signed
See Also:
DItem.setSigned(boolean)

getReader

public java.io.Reader getReader()
Contents of an EmbeddedObject, Item, or MIMEEntity object in the form of a java.io.Reader object.

Specified by:
getReader in interface DItem
Returns:
Contents of an EmbeddedObject, Item, or MIMEEntity object in the form of a java.io.Reader object

This method creates a temporary file. The file is deleted when EmbeddedObject is recycled.

See Also:
DItem.getReader()

getInputStream

public java.io.InputStream getInputStream()
InputStream representation of the contents of an EmbeddedObject, Item, or MIMEEntity object.

This method creates a temporary file. The file is deleted when EmbeddedObject is recycled.

Specified by:
getInputStream in interface DItem
Returns:
InputStream representation of the contents of an EmbeddedObject, Item, or MIMEEntity object
See Also:
DItem.getInputStream()

setValueDateTime

public void setValueDateTime(java.util.TimeZone value)
Sets the value of an item to a single time zone value.

Specified by:
setValueDateTime in interface DItem
Parameters:
value - the time zone
See Also:
DItem.setValueDateTime(java.util.TimeZone)


Domingo Java-API