com.aspose.words
Class PropertyType

java.lang.Object
    extended by 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 intBOOLEAN
           The property is a boolean value.
static final intDATE_TIME
           The property is a date time value.
static final intDOUBLE
           The property is a floating number.
static final intNUMBER
           The property is an integer number.
static final intSTRING
           The property is a string value.
static final intSTRING_ARRAY
           The property is an array of strings.
static final intOBJECT_ARRAY
           The property is an array of objects.
static final intOTHER
           The property is some other type.
 

Field Detail

BOOLEAN

public static final int BOOLEAN
The property is a boolean value.

DATE_TIME

public static final int DATE_TIME
The property is a date time value.

DOUBLE

public static final int DOUBLE
The property is a floating number.

NUMBER

public static final int NUMBER
The property is an integer number.

STRING

public static final int STRING
The property is a string value.

STRING_ARRAY

public static final int STRING_ARRAY
The property is an array of strings.

OBJECT_ARRAY

public static final int OBJECT_ARRAY
The property is an array of objects.

OTHER

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.