Package org.apache.padaf.xmpbox.type

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


    String integerv = "10";
    String realv = "1.92";
    String textv = "text";

    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(boolv, bool.getStringValue());
    Assert.assertEquals(datev, date.getStringValue());
    Assert.assertEquals(integerv, integer.getStringValue());
    Assert.assertEquals(realv, real.getStringValue());
    Assert.assertEquals(textv, text.getStringValue());
  }
View Full Code Here


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

    Assert.assertEquals(ns, bool.getNamespace());
    Assert.assertEquals(ns, date.getNamespace());
    Assert.assertEquals(ns, integer.getNamespace());
    Assert.assertEquals(ns, real.getNamespace());
    Assert.assertEquals(ns, text.getNamespace());

    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

    Calendar dateVal = Calendar.getInstance();
    String date = "nsSchem:dateProp";
    schem.setDatePropertyValue(date, dateVal);
    Assert.assertEquals(dateVal, schem.getDatePropertyValue(date));

    DateType dateType = new DateType(parent, "nsSchem", "dateType",
        Calendar.getInstance());
    schem.setDateProperty(dateType);
    Assert
        .assertEquals(dateType, schem
            .getDateProperty("nsSchem:dateType"));
View Full Code Here

  protected void testGetSetDateProperty() throws Exception {
    String setName = setMethod(property);
    String getName = getMethod(property);

    DateType dt = new DateType(metadata, schema.getLocalPrefix(), property,
        value);
    Method setMethod = schemaClass.getMethod(setName, DateType.class);
    Method getMethod = schemaClass.getMethod(getName);

    setMethod.invoke(schema, dt);
View Full Code Here

     *            namespace prefix. ie "pdf:Keywords"
     * @param date
     *            The date to add to the sequence property.
     */
    public void addSequenceDateValue(String qualifiedSeqName, Calendar date) {
        addSequenceValue(qualifiedSeqName, new DateType(metadata, "rdf", "li",
                date));
    }
View Full Code Here

        added = true;
      } else if (type.equals("Real")) {
        schema.getContent().addProperty(new RealType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("Date")) {
        schema.getContent().addProperty(new DateType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("URI")) {
        schema.getContent().addProperty(new TextType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("URL")) {
View Full Code Here

      } else if (stype == XmpPropertyType.Integer) {
        prop = new IntegerType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
            .getElementText());
      } else if (stype == XmpPropertyType.Date) {
        prop = new DateType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
            .getElementText());
      } else if (stype == XmpPropertyType.Boolean) {
        prop = new BooleanType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
View Full Code Here

   *
   * @param date
   *            the value to set
   */
  public void setCreateDateValue(Calendar date) {
    addProperty(new DateType(metadata, localPrefix, CREATEDATE, date));
  }
View Full Code Here

   *
   * @param date
   *            the Metadata Date value to set
   */
  public void setMetadataDateValue(Calendar date) {
    addProperty(new DateType(metadata, localPrefix, METADATADATE, date));
  }
View Full Code Here

   *
   * @param date
   *            the Modify Date value to set
   */
  public void setModifyDateValue(Calendar date) {
    addProperty(new DateType(metadata, localPrefix, MODIFYDATE, date));
  }
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.