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:
DocumentPropertyCollection

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.
byte[]toByteArray()
           Returns the property value as byte array.
java.util.DatetoDateTime()
           Returns the property value as DateTime in UTC.
doubletoDouble()
           Returns the property value as double.
inttoInt()
           Returns the property value as integer.
java.lang.StringtoString()
           Returns the property value as a string formatted according to the current locale.
 

Property Getters/Setters Detail

getName

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

Cannot be null and cannot be an empty string.


getType

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

getValue/setValue

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

Cannot be null.


Method Detail

toBool

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

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


toByteArray

public byte[] toByteArray()
Returns the property value as byte array.

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


toDateTime

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

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

Microsoft Word stores only the date part (no time) for custom date properties.


toDouble

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

toInt

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

toString

public java.lang.String toString()
Returns the property value as a string formatted according to the current locale.

Converts a boolean property into "Y" or "N". Converts a date property into a short date string. For all other types converts a property using Object.ToString().


See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.