Search in sources :

Example 6 with DateType

use of org.apache.xmpbox.type.DateType in project pdfbox by apache.

the class PhotoshopSchema method setDateCreated.

public void setDateCreated(String text) {
    DateType tt = (DateType) instanciateSimple(DATE_CREATED, text);
    setDateCreatedProperty(tt);
}
Also used : DateType(org.apache.xmpbox.type.DateType)

Example 7 with DateType

use of org.apache.xmpbox.type.DateType in project pdfbox by apache.

the class XMPBasicSchema method setCreateDate.

/**
 * Set the date and time the resource was originally created
 *
 * @param date
 *            the value to set
 */
public void setCreateDate(Calendar date) {
    DateType tt = (DateType) instanciateSimple(CREATEDATE, date);
    setCreateDateProperty(tt);
}
Also used : DateType(org.apache.xmpbox.type.DateType)

Example 8 with DateType

use of org.apache.xmpbox.type.DateType in project pdfbox by apache.

the class XMPSchema method getUnqualifiedSequenceDateValueList.

/**
 * Get all the date values in a sequence property.
 *
 * @param seqName
 *            The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords".
 *
 * @return A read-only list of java.util.Calendar objects or null if the property does not exist.
 */
public List<Calendar> getUnqualifiedSequenceDateValueList(String seqName) {
    List<Calendar> retval = null;
    ArrayProperty seq = (ArrayProperty) getAbstractProperty(seqName);
    if (seq != null) {
        retval = new ArrayList<>();
        for (AbstractField child : seq.getContainer().getAllProperties()) {
            if (child instanceof DateType) {
                retval.add(((DateType) child).getValue());
            }
        }
    }
    return retval;
}
Also used : ArrayProperty(org.apache.xmpbox.type.ArrayProperty) AbstractField(org.apache.xmpbox.type.AbstractField) Calendar(java.util.Calendar) DateType(org.apache.xmpbox.type.DateType)

Aggregations

DateType (org.apache.xmpbox.type.DateType)8 Calendar (java.util.Calendar)3 Method (java.lang.reflect.Method)1 AbstractField (org.apache.xmpbox.type.AbstractField)1 ArrayProperty (org.apache.xmpbox.type.ArrayProperty)1 Attribute (org.apache.xmpbox.type.Attribute)1 BooleanType (org.apache.xmpbox.type.BooleanType)1 IntegerType (org.apache.xmpbox.type.IntegerType)1 TextType (org.apache.xmpbox.type.TextType)1 Test (org.junit.Test)1