Package org.apache.padaf.xmpbox.type

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


    Assert.assertNull(schem.getAboutValue());
  }

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


  public void testProperties() throws Exception {

    Assert.assertEquals("nsURI", schem.getNamespaceValue());

    // In real cases, rdf ns will be declared before !
    schem.setAttribute(new Attribute("http://www.w3.org/2000/xmlns/",
        "xmlns", "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));

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

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

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

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

    Assert.assertEquals(schem.getAllProperties(), schem.getContent()
        .getAllProperties());
View Full Code Here

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

    // <pdfaSchema:property><seq>
    properties = new PropertyDescriptionContainer();
    content.getElement().appendChild(properties.getElement());
View Full Code Here

    String nsUri = "nsUri";
    String prefix = "prefix";
    String localName = "localName";
    String value = "value";

    Attribute att = new Attribute(nsUri, prefix, localName, value);

    Assert.assertEquals(nsUri, att.getNamespace());
    Assert.assertEquals(prefix, att.getPrefix());
    Assert.assertEquals(localName, att.getLocalName());
    Assert.assertEquals(prefix + ":" + localName, att.getQualifiedName());
    Assert.assertEquals(value, att.getValue());

    String nsUri2 = "nsUri2";
    String prefix2 = "prefix2";
    String localName2 = "localName2";
    String value2 = "value2";

    att.setNsURI(nsUri2);
    att.setPrefix(prefix2);
    att.setLocalName(localName2);
    att.setValue(value2);

    Assert.assertEquals(nsUri2, att.getNamespace());
    Assert.assertEquals(prefix2, att.getPrefix());
    Assert.assertEquals(localName2, att.getLocalName());
    Assert.assertEquals(prefix2 + ":" + localName2, att.getQualifiedName());
    Assert.assertEquals(value2, att.getValue());

  }
View Full Code Here

    // PDFAExtension is removed during the building of
    // PDFAExtensionSchemaWithNS
    namespaces.put(PDFAExtensionSchema.PDFAEXTENSION,
        PDFAExtensionSchema.PDFAEXTENSIONURI);
    Attribute tmp;

    while (att.hasNext()) {
      // System.out.println(att.next().getPropertyName());
      tmp = att.next();
      if (!tmp.getLocalName().equals("about")) {
        Assert.assertTrue(namespaces.containsKey(tmp.getLocalName()));
      }
    }
  }
View Full Code Here

  public void testAttWithoutPrefix() {
    String nsUri = "nsUri";
    String localName = "localName";
    String value = "value";

    Attribute att = new Attribute(nsUri, null, localName, value);

    Assert.assertEquals(nsUri, att.getNamespace());
    Assert.assertNull(att.getPrefix());
    Assert.assertEquals(localName, att.getLocalName());
    Assert.assertEquals(localName, att.getQualifiedName());

    att = new Attribute(nsUri, "", localName, value);
    Assert.assertEquals(nsUri, att.getNamespace());
    Assert.assertNull(att.getPrefix());
    Assert.assertEquals(localName, att.getLocalName());
    Assert.assertEquals(localName, att.getQualifiedName());
  }
View Full Code Here

        "Description");

        localPrefix = namespaceName;
        localPrefixSep = localPrefix + ":";
        localNSUri = namespaceURI;
        content.setAttribute(new Attribute(NS_NAMESPACE, "xmlns",
                namespaceName, namespaceURI));

    }
View Full Code Here

     * Get the RDF about value.
     *
     * @return The RDF 'about' value.
     */
    public String getAboutValue() {
        Attribute prop = content.getAttribute(RDFABOUT);
        if (prop != null) {
            return prop.getValue();
        }
        return null;
    }
View Full Code Here

     */
    public void setAboutAsSimple(String about) {
        if (about == null) {
            content.removeAttribute(RDFABOUT);
        } else {
            content.setAttribute(new Attribute(null, "rdf", "about", about));

        }
    }
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.