ASPOSE home

com.aspose.words
Class DocumentProperty

java.lang.Object
    extended by com.aspose.words.DocumentProperty
All Implemented Interfaces:
java.lang.Cloneable

public class DocumentProperty
extends java.lang.Object

Represents a custom or built-in document property.
See Also:
DocumentProperties

Property Getters/Setters Summary
java.lang.StringgetName()
           Returns the name of the property.
intgetType()
           Gets the data type of the property. The value of the property is PropertyType integer constant.
java.lang.ObjectgetValue()
voidsetValue(java.lang.Object value)
           Gets or sets the value of the property.
 
Method Summary
booleantoBool()
           Returns the property value as bool.
java.util.DatetoDateTime()
           Returns the property value as DateTime in local timezone.
doubletoDouble()
           Returns the property value as double.
inttoInt()
           Returns the property value as integer.
java.lang.StringtoString()
           Returns the property value as a string.
 

Property Getters/Setters Detail

getName

public java.lang.String getName()
Returns the name of the property.

getValue/setValue

public java.lang.Object getValue()

public void setValue(java.lang.Object value)
Gets or sets the value of the property.

getType

public int getType()
Gets the data type of the property. The value of the property is PropertyType integer constant.

Method Detail

toString

public java.lang.String toString()
               throws com.aspose.words.PleaseReportException
Returns the property value as a string.

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


toInt

public int toInt()
Returns the property value as integer. Throws an exception if the property type is not PropertyType.Number.

toDouble

public double toDouble()
Returns the property value as double. Throws an exception if the property type is not PropertyType.Float.

toDateTime

public java.util.Date toDateTime()
Returns the property value as DateTime in local timezone.

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


toBool

public boolean toBool()
Returns the property value as bool.

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


See Also:
          Wiki - the home page for the Aspose.Words Product Documentation that includes Programmer's Guide, Knowledge Base and other articles.
          Aspose.Words Support Forum - our preferred method of support.
          Aspose.Words Team - contact Aspose.Words Team.


ASPOSE home