public class DocumentProperty
extends java.lang.Object
implements java.lang.Cloneable
To learn more, visit the Work with Document Properties documentation article.
DocumentPropertyCollection| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getLinkSource()
Gets the source of a linked custom document property.
|
java.lang.String |
getName()
Returns the name of the property.
|
int |
getType()
Gets the data type of the property.
|
java.lang.Object |
getValue()
Gets the value of the property.
|
boolean |
isLinkToContent()
Shows whether this property is linked to content or not.
|
protected java.lang.Object |
memberwiseClone() |
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
boolean |
toBool()
Returns the property value as bool.
|
byte[] |
toByteArray()
Returns the property value as byte array.
|
java.util.Date |
toDateTime()
Returns the property value as DateTime in UTC.
|
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 formatted according to the current locale.
|
public java.lang.String getName()
Cannot be null and cannot be an empty string.
public java.lang.Object getValue()
Cannot be null.
public void setValue(java.lang.Object value)
Cannot be null.
value - The value of the property.public int getType()
PropertyType constants.public java.lang.String getLinkSource()
public boolean isLinkToContent()
boolean value.public java.lang.String toString()
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().
toString in class java.lang.Objectpublic int toInt()
PropertyType.NUMBER.public double toDouble()
PropertyType.NUMBER.public java.util.Date toDateTime()
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.
public boolean toBool()
Throws an exception if the property type is not PropertyType.BOOLEAN.
public byte[] toByteArray()
Throws an exception if the property type is not PropertyType.BYTE_ARRAY.
protected java.lang.Object memberwiseClone()