use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class XMPSchemaTest method testArrayList.
@Test
public void testArrayList() throws Exception {
XMPMetadata meta = XMPMetadata.createXMPMetadata();
ArrayProperty newSeq = meta.getTypeMapping().createArrayProperty(null, "nsSchem", "seqType", Cardinality.Seq);
TypeMapping tm = meta.getTypeMapping();
TextType li1 = tm.createText(null, "rdf", "li", "valeur1");
TextType li2 = tm.createText(null, "rdf", "li", "valeur2");
newSeq.getContainer().addProperty(li1);
newSeq.getContainer().addProperty(li2);
schem.addProperty(newSeq);
List<AbstractField> list = schem.getUnqualifiedArrayList("seqType");
Assert.assertTrue(list.contains(li1));
Assert.assertTrue(list.contains(li2));
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class XMPSchemaTest method testSpecifiedSimplePropertyFormer.
@Test
public void testSpecifiedSimplePropertyFormer() throws Exception {
String prop = "testprop";
String val = "value";
String val2 = "value2";
schem.setTextPropertyValueAsSimple(prop, val);
TextType text = schem.getMetadata().getTypeMapping().createText(null, schem.getPrefix(), prop, "value2");
schem.setTextProperty(text);
Assert.assertEquals(val2, schem.getUnqualifiedTextPropertyValue(prop));
Assert.assertEquals(text, schem.getUnqualifiedTextProperty(prop));
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class AbstractXMPSchemaTest method testGetSetURIProperty.
protected void testGetSetURIProperty() throws Exception {
String setName = setMethod(property);
String getName = getMethod(property);
URIType tt = metadata.getTypeMapping().createURI(null, schema.getPrefix(), property, (String) value);
Method setMethod = schemaClass.getMethod(setName, URIType.class);
Method getMethod = schemaClass.getMethod(getName);
setMethod.invoke(schema, tt);
String found = ((TextType) getMethod.invoke(schema)).getStringValue();
Assert.assertEquals(value, found);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class AbstractXMPSchemaTest method testGetSetURLProperty.
protected void testGetSetURLProperty() throws Exception {
String setName = setMethod(property);
String getName = getMethod(property);
URLType tt = metadata.getTypeMapping().createURL(null, schema.getPrefix(), property, (String) value);
Method setMethod = schemaClass.getMethod(setName, URLType.class);
Method getMethod = schemaClass.getMethod(getName);
setMethod.invoke(schema, tt);
String found = ((TextType) getMethod.invoke(schema)).getStringValue();
Assert.assertEquals(value, found);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class AdobePDFSchema method setProducer.
/**
* Set the PDFProducer
*
* @param value
* Value to set
*/
public void setProducer(String value) {
TextType producer;
producer = createTextType(PRODUCER, value);
addProperty(producer);
}
Aggregations