com.aspose.words

Class PropertyType

  • 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 docProperty : doc.getCustomDocumentProperties())
{
    System.out.println(docProperty.getName());
    switch (docProperty.getType())
    {
        case PropertyType.STRING:
            System.out.println("It's a string value.");
            System.out.println(docProperty.toString());
            break;
        case PropertyType.BOOLEAN:
            System.out.println("It's a boolean value.");
            System.out.println(docProperty.toBool());
            break;
        case PropertyType.NUMBER:
            System.out.println("It's an integer value.");
            System.out.println(docProperty.toInt());
            break;
        case PropertyType.DATE_TIME:
            System.out.println("It's a date time value.");
            System.out.println(docProperty.toDateTime());
            break;
        case PropertyType.DOUBLE:
            System.out.println("It's a double value.");
            System.out.println(docProperty.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 intBOOLEAN = 0
The property is a boolean value.
static final intDATE_TIME = 1
The property is a date time value.
static final intDOUBLE = 2
The property is a floating number.
static final intNUMBER = 3
The property is an integer number.
static final intSTRING = 4
The property is a string value.
static final intSTRING_ARRAY = 5
The property is an array of strings.
static final intOBJECT_ARRAY = 6
The property is an array of objects.
static final intBYTE_ARRAY = 7
The property is an array of bytes.
static final intOTHER = 8
The property is some other type.
 

    • Field Detail

      • 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.