public class DocumentProperty
extends java.lang.Object
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");
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Returns the name of the property.
|
java.lang.String |
getSource()
The linked content source.
|
int |
getType()
Gets the data type of the property.
|
java.lang.Object |
getValue()
Gets the value of the property.
|
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.
|
boolean |
isLinkedToContent()
Indicates whether this property is linked to content
|
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
boolean |
toBool()
Returns the property value as bool.
|
DateTime |
toDateTime()
Returns the property value as DateTime in local timezone.
|
double |
toDouble()
Returns the property value as double.
|
int |
toInt()
Returns the property value as integer.
|
java.lang.String |
toString()
Returns the property value as a string.
|
public java.lang.String getName()
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public boolean isLinkedToContent()
public java.lang.String getSource()
public int getType()
See PropertyType.
public boolean isGeneratedName()
public java.lang.String toString()
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.
toString in class java.lang.Objectpublic int toInt()
Remarks
Throws an exception if the property type is not PropertyType.Number.public double toDouble()
Remarks
Throws an exception if the property type is not PropertyType.Float.public DateTime toDateTime()
Remarks
Throws an exception if the property type is not PropertyType.Date.
public boolean toBool()
Remarks
Throws an exception if the property type is not PropertyType.Boolean.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.