Package org.apache.xmpbox.type

Examples of org.apache.xmpbox.type.TextType


     * @param url
     *            VersionId value to set
     */
    public void setVersionID(String value)
    {
        TextType tt = (TextType) instanciateSimple(VERSIONID, value);
        setVersionIDProperty(tt);
    }
View Full Code Here


     *
     * @return VersionId value
     */
    public String getVersionID()
    {
        TextType tt = getVersionIDProperty();
        return tt != null ? tt.getStringValue() : null;
    }
View Full Code Here

    protected void testGetSetTextProperty() throws Exception
    {
        String setName = setMethod(property);
        String getName = getMethod(property);

        TextType tt = metadata.getTypeMapping().createText(null, schema.getPrefix(), property, (String) value);
        Method setMethod = schemaClass.getMethod(setName, TextType.class);
        Method getMethod = schemaClass.getMethod(getName);

        setMethod.invoke(schema, tt);
        String found = ((TextType) getMethod.invoke(schema)).getStringValue();
View Full Code Here

     * @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

    }

    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

     */
    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

                            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

                    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()))
                                        {
                                            alreadyPresent = true;
                                        }
                                    }
                                    if (!alreadyPresent)
View Full Code Here

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

     *
     * @return the format value
     */
    public String getFormat()
    {
        TextType tt = (TextType) getProperty(FORMAT);
        return tt == null ? null : tt.getStringValue();
    }
View Full Code Here

TOP

Related Classes of org.apache.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.