Package org.apache.padaf.xmpbox.type

Examples of org.apache.padaf.xmpbox.type.DateType


   * Get the CreateDate property value
   *
   * @return the CreateDate value
   */
  public Calendar getCreateDateValue() {
    DateType createDate = (DateType) getProperty(localPrefixSep
        + CREATEDATE);
    if (createDate != null) {
      return createDate.getValue();
    }
    return null;
  }
View Full Code Here


   * Get the MetadataDate property value
   *
   * @return the MetadataDate value
   */
  public Calendar getMetadataDateValue() {
    DateType dt = ((DateType) getProperty(localPrefixSep + METADATADATE));
    return dt == null ? null : dt.getValue();
  }
View Full Code Here

   * Get the ModifyDate property value
   *
   * @return the ModifyDate value
   */
  public Calendar getModifyDateValue() {
    DateType modifyDate = (DateType) getProperty(localPrefixSep
        + MODIFYDATE);
    if (modifyDate != null) {
      return modifyDate.getValue();
    }
    return null;

  }
View Full Code Here

   *
   * @throws InappropriateTypeException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testDateBadTypeDetection() {
    new DateType(parent, "test", "date", "Bad Date");
  }
View Full Code Here

    Calendar datev = Calendar.getInstance();
    int integerv = 1;
    float realv = Float.parseFloat("1.69");
    String textv = "TEXTCONTENT";
    BooleanType bool = new BooleanType(parent, "test", "booleen", boolv);
    DateType date = new DateType(parent, "test", "date", datev);
    IntegerType integer = new IntegerType(parent, "test", "integer",
        integerv);
    RealType real = new RealType(parent, "test", "real", realv);
    TextType text = new TextType(parent, "test", "text", textv);

    Assert.assertEquals(bool.getNamespace(), bool.getElement()
        .getNamespaceURI());
    Assert.assertEquals(bool.getPrefix() + ":" + bool.getPropertyName(),
        bool.getElement().getNodeName());
    Assert.assertEquals(bool.getQualifiedName(), bool.getElement()
        .getNodeName());
    Assert.assertEquals(boolv, bool.getValue());
    Assert.assertEquals(datev, date.getValue());
    Assert.assertEquals(integerv, integer.getValue());
    Assert.assertEquals(realv, real.getValue(), 0);
    Assert.assertEquals(textv, text.getStringValue());

  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testObjectCreationFromJavaType() throws Exception {
    BooleanType bool = new BooleanType(parent, "test", "booleen", true);
    DateType date = new DateType(parent, "test", "date", Calendar
        .getInstance());
    IntegerType integer = new IntegerType(parent, "test", "integer", 1);
    RealType real = new RealType(parent, "test", "real", (float) 1.6);
    TextType text = new TextType(parent, "test", "text", "TEST");

    Element e = parent.getFuturOwner().createElement("TEST");
    parent.getFuturOwner().appendChild(e);
    e.appendChild(bool.getElement());
    e.appendChild(date.getElement());
    e.appendChild(integer.getElement());
    e.appendChild(real.getElement());
    e.appendChild(text.getElement());

    // XMLUtil.save(parent.getFuturOwner(), System.out, "UTF-8");
View Full Code Here

TOP

Related Classes of org.apache.padaf.xmpbox.type.DateType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.