Package org.apache.padaf.xmpbox.type

Examples of org.apache.padaf.xmpbox.type.Attribute


                            prop.getContainer().removeProperty(tmp);
                            TextType langValue;
                            langValue = new TextType(metadata, "rdf", "li",
                                    value);

                            langValue.setAttribute(new Attribute(null, "xml",
                                    "lang", language));
                            prop.getContainer().addProperty(langValue);
                        }
                        reorganizeAltOrder(prop.getContainer());
                        return;
                    }
                }
                // if no definition found, we add a new one
                TextType langValue;
                langValue = new TextType(metadata, "rdf", "li", value);
                langValue.setAttribute(new Attribute(null, "xml", "lang",
                        language));
                prop.getContainer().addProperty(langValue);
                reorganizeAltOrder(prop.getContainer());
            }
        } else {
            String[] splittedQualifiedName = qualifiedName.split(":");
            prop = new ComplexProperty(metadata, splittedQualifiedName[0],
                    splittedQualifiedName[1], ComplexProperty.ALTERNATIVE_ARRAY);
            TextType langValue;
            langValue = new TextType(metadata, "rdf", "li", value);
            langValue
            .setAttribute(new Attribute(null, "xml", "lang", language));
            prop.getContainer().addProperty(langValue);
            content.addProperty(prop);
        }
    }
View Full Code Here


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

            if (property instanceof ComplexProperty) {
                ComplexProperty prop = (ComplexProperty) property;
                Iterator<AbstractField> langsDef = prop.getContainer()
                .getAllProperties().iterator();
                AbstractField tmp;
                Attribute text;
                while (langsDef.hasNext()) {
                    tmp = langsDef.next();
                    text = tmp.getAttribute("xml:lang");
                    if (text != null) {
                        retval.add(text.getValue());
                    } else {
                        retval.add("x-default");
                    }
                }
                return retval;
View Full Code Here

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

        Iterator<Attribute> itAtt = xmpSchema.content.getAllAttributes()
        .iterator();
        Attribute att;
        while (itAtt.hasNext()) {
            att = itAtt.next();
            if (att.getPrefix().equals(getPrefix())) {
                content.setAttribute(att);
            }
        }

        String analyzedPropQualifiedName;
View Full Code Here

   */
  public PDFAValueTypeDescription(XMPMetadata metadata) {
    this.metadata = metadata;
    content = new ComplexPropertyContainer(metadata, "rdf", "li");
    content
        .setAttribute(new Attribute(null, "rdf", "parseType",
            "Resource"));
    fields = new FieldDescriptionContainer();
    content.getElement().appendChild(fields.getElement());

  }
View Full Code Here

          }
        }
        rdfAboutFound = true;
      }

      Attribute attr = new Attribute(null, reader.get()
          .getAttributePrefix(i), reader.get()
          .getAttributeLocalName(i), reader.get()
          .getAttributeValue(i));

      if (!addAttributeAsProperty(metadata, schema, attr)) {
        // attribute isn't a property, so add the attribute
        schema.setAttribute(attr)
      }

      i++;
    }
    if (!rdfAboutFound) {
      // create rdf:about if not found
      Attribute attr = new Attribute(null,"rdf","about","");
      schema.setAttribute(attr);
    }
  }
View Full Code Here

      } else {
        schema = metadata.createAndAddDefaultSchema(namespacePrefix,namespaceUri);
      }

      for (int i = 1; i < cptNS; i++) {
        schema.setAttribute(new Attribute(XMPSchema.NS_NAMESPACE,
            "xmlns", reader.get().getNamespacePrefix(i), reader.get().getNamespaceURI(i)));
      }
      treatDescriptionAttributes(metadata, schema);
      while (reader.get().nextTag() == XMLStreamReader.START_ELEMENT) {
        parseProperty(schema, metadata);
View Full Code Here

   */
  private String getPropertyDeclarationInNamespaces(XMPSchema schema,
      QName prop) throws XmpParsingException {

    Iterator<Attribute> it = schema.getAllAttributes().iterator();
    Attribute tmp;
    ArrayList<Attribute> list = new ArrayList<Attribute>();
    while (it.hasNext()) {
      tmp = it.next();
      if (tmp.getPrefix() != null) {
        if (tmp.getPrefix().equals("xmlns")) {
          list.add(tmp);
        }
      }
    }
    it = list.iterator();
View Full Code Here

    try {
      AbstractSimpleProperty prop = null;
      ArrayList<Attribute> attributes = new ArrayList<Attribute>();
      int cpt = reader.get().getAttributeCount();
      for (int i = 0; i < cpt; i++) {
        attributes.add(new Attribute(null, reader.get()
            .getAttributePrefix(i), reader.get()
            .getAttributeLocalName(i), reader.get()
            .getAttributeValue(i)));
      }
      if (stype == XmpPropertyType.Text) {
View Full Code Here

      XmpPropertyFormatException, XmpParsingException,
      XMLStreamException, XmpUnknownPropertyTypeException {
    ComplexPropertyContainer field = new ComplexPropertyContainer(metadata,
        propertyName.getPrefix(), propertyName.getLocalPart());
    schema.addProperty(field);
    field.setAttribute(new Attribute(null, "rdf", "parseType", "Resource"));
    String type;
    int elmtType = reader.get().nextTag();
    while ((elmtType != XMLStreamReader.END_ELEMENT)
        && !reader.get().getName().getLocalPart().equals(SEQ_NAME)) {
View Full Code Here

TOP

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