Examples of AbstractField


Examples of org.apache.xmpbox.type.AbstractField

        ArrayProperty seq = (ArrayProperty) getAbstractProperty(qualifiedSeqName);
        if (seq != null)
        {
            retval = new ArrayList<Calendar>();
            Iterator<AbstractField> it = seq.getContainer().getAllProperties().iterator();
            AbstractField tmp;
            while (it.hasNext())
            {
                tmp = it.next();
                if (tmp instanceof DateType)
                {
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

     *            The property to reorganize
     */
    public void reorganizeAltOrder(ComplexPropertyContainer alt)
    {
        Iterator<AbstractField> it = alt.getAllProperties().iterator();
        AbstractField xdefault = null;
        boolean xdefaultFound = false;
        // If alternatives contains x-default in first value
        if (it.hasNext())
        {
            if (it.next().getAttribute(XmpConstants.LANG_NAME).getValue().equals(XmpConstants.X_DEFAULT))
            {
                return;
            }
        }
        // Find the xdefault definition
        while (it.hasNext() && !xdefaultFound)
        {
            xdefault = it.next();
            if (xdefault.getAttribute(XmpConstants.LANG_NAME).getValue().equals(XmpConstants.X_DEFAULT))
            {
                alt.removeProperty(xdefault);
                xdefaultFound = true;
            }
        }
        if (xdefaultFound)
        {
            it = alt.getAllProperties().iterator();
            ArrayList<AbstractField> reordered = new ArrayList<AbstractField>();
            ArrayList<AbstractField> toDelete = new ArrayList<AbstractField>();
            reordered.add(xdefault);
            AbstractField tmp;
            while (it.hasNext())
            {
                tmp = it.next();
                reordered.add(tmp);
                toDelete.add(tmp);
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

     *            The value of the property in the specified language.
     */
    public void setUnqualifiedLanguagePropertyValue(String name, String language, String value)
    {
        String qualifiedName = name;
        AbstractField property = getAbstractProperty(qualifiedName);
        ArrayProperty prop;
        if (property != null)
        {
            // Analyzing content of property
            if (property instanceof ArrayProperty)
            {
                prop = (ArrayProperty) property;
                Iterator<AbstractField> itCplx = prop.getContainer().getAllProperties().iterator();
                // try to find the same lang definition
                AbstractField tmp;
                // Try to find a definition
                while (itCplx.hasNext())
                {
                    tmp = itCplx.next();
                    // System.err.println(tmp.getAttribute("xml:lang").getStringValue());
                    if (tmp.getAttribute(XmpConstants.LANG_NAME).getValue().equals(language))
                    {
                        // the same language has been found
                        if (value == null)
                        {
                            // if value null, erase this definition
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

     * @return The value of the language property.
     */
    public String getUnqualifiedLanguagePropertyValue(String name, String expectedLanguage)
    {
        String language = (expectedLanguage != null) ? expectedLanguage : XmpConstants.X_DEFAULT;
        AbstractField property = getAbstractProperty(name);
        if (property != null)
        {
            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

Examples of org.apache.xmpbox.type.AbstractField

     * @return A list of all languages, this will return an non-null empty list if none have been defined.
     */
    public List<String> getUnqualifiedLanguagePropertyLanguagesValue(String name)
    {
        List<String> retval = new ArrayList<String>();
        AbstractField property = getAbstractProperty(name);
        if (property != null)
        {
            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
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

            }
        }

        String analyzedPropQualifiedName;
        Iterator<AbstractField> itProp = xmpSchema.getContainer().getAllProperties().iterator();
        AbstractField prop;
        while (itProp.hasNext())
        {
            prop = itProp.next();
            if (prop.getPrefix().equals(getPrefix()))
            {
                if (prop instanceof ArrayProperty)
                {
                    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())
                                {
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

     */
    public List<AbstractField> getUnqualifiedArrayList(String name) throws BadFieldValueException
    {
        ArrayProperty array = null;
        Iterator<AbstractField> itProp = getAllProperties().iterator();
        AbstractField tmp;
        while (itProp.hasNext())
        {
            tmp = itProp.next();
            if (tmp.getPropertyName().equals(name))
            {
                if (tmp instanceof ArrayProperty)
                {
                    array = (ArrayProperty) tmp;
                    break;
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

                        // which use title without lang definition
                        // REM : MAY we have to delete this option in the future
                        Iterator<AbstractField> it = dc.getTitleProperty().getContainer().getAllProperties().iterator();
                        if (it.hasNext())
                        {
                            AbstractField tmp = it.next();
                            if (tmp instanceof TextType)
                            {
                                if (!((TextType) tmp).getStringValue().equals(title))
                                {
                                    ve.add(unsynchronizedMetaDataError("Title"));
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

                        // which use title without lang definition
                        // REM : MAY we have to delete this option in the future
                        Iterator<AbstractField> it = dc.getTitleProperty().getContainer().getAllProperties().iterator();
                        if (it.hasNext())
                        {
                            AbstractField tmp = it.next();
                            if (tmp instanceof TextType)
                            {
                                if (!((TextType) tmp).getStringValue().equals(title))
                                {
                                    ve.add(unsynchronizedMetaDataError("Title"));
View Full Code Here

Examples of org.apache.xmpbox.type.AbstractField

        List<Element> lis = DomHelper.getElementChildren(bagOrSeq);

        for (Element element : lis)
        {
            QName propertyQName = DomHelper.getQName(property);
            AbstractField ast = parseLiElement(xmp, propertyQName, element);
            if (ast != null)
            {
                array.addProperty(ast);
            }
        }
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.