java.lang.Object
com.aspose.words.PropertyType
public class PropertyType
- extends java.lang.Object
Utility class containing constants.
Specifies data type of a document property.
Example:
Retrieves the types and values of the custom document properties.
Document doc = new Document(getMyDir() + "Properties.doc");
for (DocumentProperty prop : doc.getCustomDocumentProperties())
{
System.out.println(prop.getName());
switch (prop.getType())
{
case PropertyType.STRING:
System.out.println("It's a string value.");
System.out.println(prop.toString());
break;
case PropertyType.BOOLEAN:
System.out.println("It's a boolean value.");
System.out.println(prop.toBool());
break;
case PropertyType.NUMBER:
System.out.println("It's an integer value.");
System.out.println(prop.toInt());
break;
case PropertyType.DATE_TIME:
System.out.println("It's a date time value.");
System.out.println(prop.toDateTime());
break;
case PropertyType.DOUBLE:
System.out.println("It's a double value.");
System.out.println(prop.toDouble());
break;
case PropertyType.OTHER:
System.out.println("Other value.");
break;
default:
throw new Exception("Unknown property type.");
}
}
- See Also:
- DocumentProperty, DocumentProperty.Type
Field Summary |
static final int | BOOLEAN = 0 | |
The property is a boolean value.
|
static final int | DATE_TIME = 1 | |
The property is a date time value.
|
static final int | DOUBLE = 2 | |
The property is a floating number.
|
static final int | NUMBER = 3 | |
The property is an integer number.
|
static final int | STRING = 4 | |
The property is a string value.
|
static final int | STRING_ARRAY = 5 | |
The property is an array of strings.
|
static final int | OBJECT_ARRAY = 6 | |
The property is an array of objects.
|
static final int | BYTE_ARRAY = 7 | |
The property is an array of bytes.
|
static final int | OTHER = 8 | |
The property is some other type.
|
BOOLEAN = 0 | |
public static final int BOOLEAN |
-
The property is a boolean value.
DATE_TIME = 1 | |
public static final int DATE_TIME |
-
The property is a date time value.
DOUBLE = 2 | |
public static final int DOUBLE |
-
The property is a floating number.
NUMBER = 3 | |
public static final int NUMBER |
-
The property is an integer number.
STRING = 4 | |
public static final int STRING |
-
The property is a string value.
STRING_ARRAY = 5 | |
public static final int STRING_ARRAY |
-
The property is an array of strings.
OBJECT_ARRAY = 6 | |
public static final int OBJECT_ARRAY |
-
The property is an array of objects.
BYTE_ARRAY = 7 | |
public static final int BYTE_ARRAY |
-
The property is an array of bytes.
OTHER = 8 | |
public static final int OTHER |
-
The property is some other type.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.