Package org.apache.xmpbox.type

Examples of org.apache.xmpbox.type.Attribute


    }

    @Test(expected = BadFieldValueException.class)
    public void testBadRdfAbout() throws Exception
    {
        schem.setAbout(new Attribute(null, "about", ""));
    }
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.