DocumentProperty

Inheritance: java.lang.Object

public class DocumentProperty

Represents a custom or built-in document property.

Example

         //Instantiate a Workbook object
         Workbook workbook = new Workbook("book1.xls");
 
         //Retrieve a list of all custom document properties of the Excel file
         DocumentPropertyCollection customProperties = workbook.getWorksheets().getCustomDocumentProperties();
 
         //Accessng a custom document property by using the property index
         DocumentProperty customProperty1 = customProperties.get(3);
 
         //Accessng a custom document property by using the property name
         DocumentProperty customProperty2 = customProperties.get("Owner");

Methods

MethodDescription
equals(Object arg0)
getClass()
getName()Returns the name of the property.
getSource()The linked content source.
getType()Gets the data type of the property.
getValue()Gets the value of the property.
hashCode()
isGeneratedName()Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.
isLinkedToContent()Indicates whether this property is linked to content
notify()
notifyAll()
setValue(Object value)Sets the value of the property.
toBool()Returns the property value as bool.
toDateTime()Returns the property value as DateTime in local timezone.
toDouble()Returns the property value as double.
toInt()Returns the property value as integer.
toString()Returns the property value as a string.
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getName()

public String getName()

Returns the name of the property.

Returns: java.lang.String

getSource()

public String getSource()

The linked content source.

Returns: java.lang.String

getType()

public int getType()

Gets the data type of the property.

See PropertyType.

Returns: int

getValue()

public Object getValue()

Gets the value of the property.

Returns: java.lang.Object

hashCode()

public native int hashCode()

Returns: int

isGeneratedName()

public boolean isGeneratedName()

Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.

Returns: boolean

isLinkedToContent()

public boolean isLinkedToContent()

Indicates whether this property is linked to content

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setValue(Object value)

public void setValue(Object value)

Sets the value of the property.

Parameters:

ParameterTypeDescription
valuejava.lang.Object

toBool()

public boolean toBool()

Returns the property value as bool.

Remarks

Throws an exception if the property type is not PropertyType.Boolean.

Returns: boolean

toDateTime()

public DateTime toDateTime()

Returns the property value as DateTime in local timezone.

Remarks

Throws an exception if the property type is not PropertyType.Date.

Returns: DateTime

toDouble()

public double toDouble()

Returns the property value as double.

Remarks

Throws an exception if the property type is not PropertyType.Float.

Returns: double

toInt()

public int toInt()

Returns the property value as integer.

Remarks

Throws an exception if the property type is not PropertyType.Number.

Returns: int

toString()

public String toString()

Returns the property value as a string.

Remarks

Converts a number property using Object.ToString(). Converts a boolean property into “Y” or “N”. Converts a date property into a short date string.

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int