Package org.apache.padaf.xmpbox.type

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


  @Test
  public void testBagManagement() throws Exception {
    String bagName = "nsSchem:BAGTEST";
    String value1 = "valueOne";
    String value2 = "valueTwo";
    schem.addBagValue(bagName, new TextType(parent, "rdf", "li", value1));
    schem.addBagValue(bagName, value2);

    List<String> values = schem.getBagValueList(bagName);
    Assert.assertEquals(value1, values.get(0));
    Assert.assertEquals(value2, values.get(1));
View Full Code Here


  @Test
  public void testArrayList() throws Exception {
    ComplexProperty newSeq = new ComplexProperty(parent, "nsSchem",
        "seqType", ComplexProperty.ORDERED_ARRAY);
    TextType li1 = new TextType(parent, "rdf", "li", "valeur1");
    TextType li2 = new TextType(parent, "rdf", "li", "valeur2");
    newSeq.getContainer().addProperty(li1);
    newSeq.getContainer().addProperty(li2);
    schem.addProperty(newSeq);
    List<AbstractField> list = schem.getArrayList("nsSchem:seqType");
    Assert.assertTrue(list.contains(li1));
View Full Code Here

  public void testSpecifiedSimplePropertyFormer() throws Exception {
    String prop = "testprop";
    String val = "value";
    String val2 = "value2";
    schem.setTextPropertyValueAsSimple(prop, val);
    TextType text = new TextType(parent, schem.getPrefix(), prop, "value2");
    schem.setTextProperty(text);
    Assert.assertEquals(val2, schem.getTextPropertyValueAsSimple(prop));
    Assert.assertEquals(text, schem.getTextProperty(schem.getPrefix() + ":"
        + prop));
  }
View Full Code Here

    String textProp = "nsSchem:textProp";
    String textPropVal = "TextPropTest";
    schem.setTextPropertyValue(textProp, textPropVal);
    Assert.assertEquals(textPropVal, schem.getTextPropertyValue(textProp));

    TextType text = new TextType(parent, "nsSchem", "textType", "GRINGO");
    schem.setTextProperty(text);
    Assert.assertEquals(text, schem.getTextProperty("nsSchem:textType"));

    Calendar dateVal = Calendar.getInstance();
    String date = "nsSchem:dateProp";
View Full Code Here

   * @param description
   *            The value to set
   */
  public void setSchemaValue(String description) {
    // <pdfaSchema:schema>
    content.addProperty(new TextType(metadata,
        PDFAExtensionSchema.PDFASCHEMA, PDFAExtensionSchema.SCHEMA,
        description));
  }
View Full Code Here

   * @param uri
   *            the namespace URI to set for this Schema Description
   */
  public void setNameSpaceURIValue(String uri) {
    content
        .addProperty(new TextType(metadata,
            PDFAExtensionSchema.PDFASCHEMA,
            PDFAExtensionSchema.NS_URI, uri));
  }
View Full Code Here

   *
   * @param prefix
   *            the prefix to set for this Schema Description
   */
  public void setPrefixValue(String prefix) {
    content.addProperty(new TextType(metadata,
        PDFAExtensionSchema.PDFASCHEMA, PDFAExtensionSchema.PREFIX,
        prefix));
  }
View Full Code Here

   *
   * @throws InappropriateTypeException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testTextBadTypeDetection() throws Exception {
    new TextType(parent, "test", "text", Calendar.getInstance());
  }
View Full Code Here

    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

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

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.