Examples of TextType


Examples of org.apache.xmpbox.type.TextType

    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));
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

    {
        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));
    }
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

        String textProp = "textProp";
        String textPropVal = "TextPropTest";
        schem.setTextPropertyValue(textProp, textPropVal);
        Assert.assertEquals(textPropVal, schem.getUnqualifiedTextPropertyValue(textProp));

        TextType text = parent.getTypeMapping().createText(null, "nsSchem", "textType", "GRINGO");
        schem.setTextProperty(text);
        Assert.assertEquals(text, schem.getUnqualifiedTextProperty("textType"));

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

Examples of org.apache.xmpbox.type.TextType

     * @return The value of the text property or the null if there is no value.
     *
     */
    public String getUnqualifiedTextPropertyValue(String name)
    {
        TextType tt = getUnqualifiedTextProperty(name);
        return tt == null ? null : tt.getStringValue();
    }
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

    }

    private void internalAddBagValue(String qualifiedBagName, String bagValue)
    {
        ArrayProperty bag = (ArrayProperty) getAbstractProperty(qualifiedBagName);
        TextType li = createTextType(XmpConstants.LIST_NAME, bagValue);
        if (bag != null)
        {
            bag.getContainer().addProperty(li);
        }
        else
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

     */
    public void addUnqualifiedSequenceValue(String simpleSeqName, String seqValue)
    {
        String qualifiedSeqName = simpleSeqName;
        ArrayProperty seq = (ArrayProperty) getAbstractProperty(qualifiedSeqName);
        TextType li = createTextType(XmpConstants.LIST_NAME, seqValue);
        if (seq != null)
        {
            seq.getContainer().addProperty(li);
        }
        else
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

                            prop.getContainer().removeProperty(tmp);
                        }
                        else
                        {
                            prop.getContainer().removeProperty(tmp);
                            TextType langValue;
                            langValue = createTextType(XmpConstants.LIST_NAME, value);

                            langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME,
                                    language));
                            prop.getContainer().addProperty(langValue);
                        }
                        reorganizeAltOrder(prop.getContainer());
                        return;
                    }
                }
                // if no definition found, we add a new one
                TextType langValue;
                langValue = createTextType(XmpConstants.LIST_NAME, value);
                langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
                prop.getContainer().addProperty(langValue);
                reorganizeAltOrder(prop.getContainer());
            }
        }
        else
        {
            prop = createArrayProperty(name, Cardinality.Alt);
            TextType langValue;
            langValue = createTextType(XmpConstants.LIST_NAME, value);
            langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
            prop.getContainer().addProperty(langValue);
            addProperty(prop);
        }
    }
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

                    analyzedPropQualifiedName = prop.getPropertyName();
                    Iterator<AbstractField> itActualEmbeddedProperties = getAllProperties().iterator();
                    AbstractField tmpEmbeddedProperty;

                    Iterator<AbstractField> itNewValues;
                    TextType tmpNewValue;

                    Iterator<AbstractField> itOldValues;
                    TextType tmpOldValue;

                    boolean alreadyPresent = false;

                    while (itActualEmbeddedProperties.hasNext())
                    {
                        tmpEmbeddedProperty = itActualEmbeddedProperties.next();
                        if (tmpEmbeddedProperty instanceof ArrayProperty)
                        {
                            if (tmpEmbeddedProperty.getPropertyName().equals(analyzedPropQualifiedName))
                            {
                                itNewValues = ((ArrayProperty) prop).getContainer().getAllProperties().iterator();
                                // Merge a complex property
                                while (itNewValues.hasNext())
                                {
                                    tmpNewValue = (TextType) itNewValues.next();
                                    itOldValues = ((ArrayProperty) tmpEmbeddedProperty).getContainer()
                                            .getAllProperties().iterator();
                                    while (itOldValues.hasNext() && !alreadyPresent)
                                    {
                                        tmpOldValue = (TextType) itOldValues.next();
                                        if (tmpOldValue.getStringValue().equals(tmpNewValue.getStringValue()))
                                        {
                                            return;
                                        }
                                    }
                                    if (!alreadyPresent)
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

     *
     * @return Coverage value
     */
    public String getCoverage()
    {
        TextType tt = (TextType) getProperty(COVERAGE);
        return tt == null ? null : tt.getStringValue();
    }
View Full Code Here

Examples of org.apache.xmpbox.type.TextType

     *
     * @return the format value
     */
    public String getFormat()
    {
        TextType tt = (TextType) getProperty(FORMAT);
        return tt == null ? null : tt.getStringValue();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.