Package org.apache.xmpbox.type

Examples of org.apache.xmpbox.type.Attribute


                    ((XMPSchema) sp).setAboutAsSimple(attr.getValue());
                }
            }
            else
            {
                Attribute attribute = new Attribute(XMLConstants.XML_NS_URI, attr.getLocalName(), attr.getValue());
                sp.setAttribute(attribute);
            }
        }
    }
View Full Code Here


            if (property instanceof ArrayProperty)
            {
                ArrayProperty prop = (ArrayProperty) property;
                Iterator<AbstractField> langsDef = prop.getContainer().getAllProperties().iterator();
                AbstractField tmp;
                Attribute text;
                while (langsDef.hasNext())
                {
                    tmp = langsDef.next();
                    text = tmp.getAttribute(XmpConstants.LANG_NAME);
                    if (text != null)
                    {
                        retval.add(text.getValue());
                    }
                    else
                    {
                        retval.add(XmpConstants.X_DEFAULT);
                    }
View Full Code Here

        {
            throw new IOException("Can only merge schemas of the same type.");
        }

        Iterator<Attribute> itAtt = xmpSchema.getAllAttributes().iterator();
        Attribute att;
        while (itAtt.hasNext())
        {
            att = itAtt.next();
            if (att.getNamespace().equals(getNamespace()))
            {
                setAttribute(att);
            }
        }
View Full Code Here

    }

    @Test(expected = BadFieldValueException.class)
    public void testBadRdfAbout() throws Exception
    {
        schem.setAbout(new Attribute(null, "about", ""));
    }
View Full Code Here

        String aboutVal = "aboutTest";
        schem.setAboutAsSimple(aboutVal);
        Assert.assertEquals(aboutVal, schem.getAboutValue());

        Attribute about = new Attribute(XmpConstants.RDF_NAMESPACE, "about", "YEP");
        schem.setAbout(about);
        Assert.assertEquals(about, schem.getAboutAttribute());

        String textProp = "textProp";
        String textPropVal = "TextPropTest";
View Full Code Here

    public void testListAndContainerAccessor() throws Exception
    {
        String boolname = "bool";
        boolean boolVal = true;
        BooleanType bool = parent.getTypeMapping().createBoolean(null, schem.getPrefix(), boolname, boolVal);
        Attribute att = new Attribute(XmpConstants.RDF_NAMESPACE, "test", "vgh");
        schem.setAttribute(att);
        schem.setBooleanProperty(bool);

        Assert.assertEquals(schem.getAllProperties(), schem.getAllProperties());
        Assert.assertTrue(schem.getAllProperties().contains(bool));
View Full Code Here

     *
     * @return The RDF 'about' value. If there are not rdf:about attribute, an empty string is returned.
     */
    public String getAboutValue()
    {
        Attribute prop = getAttribute(XmpConstants.ABOUT_NAME);
        if (prop != null)
        {
            return prop.getValue();
        }
        return ""; // PDFBOX-1685 : if missing rdf:about should be considered as empty string
    }
View Full Code Here

        {
            removeAttribute(XmpConstants.ABOUT_NAME);
        }
        else
        {
            setAttribute(new Attribute(XmpConstants.RDF_NAMESPACE, XmpConstants.ABOUT_NAME, about));

        }
    }
View Full Code Here

                        {
                            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

            if (property instanceof ArrayProperty)
            {
                ArrayProperty prop = (ArrayProperty) property;
                Iterator<AbstractField> langsDef = prop.getContainer().getAllProperties().iterator();
                AbstractField tmp;
                Attribute text;
                while (langsDef.hasNext())
                {
                    tmp = langsDef.next();
                    text = tmp.getAttribute(XmpConstants.LANG_NAME);
                    if (text != null)
                    {
                        if (text.getValue().equals(language))
                        {
                            return ((TextType) tmp).getStringValue();
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.xmpbox.type.Attribute

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.