Package org.jdom

Examples of org.jdom.Attribute


        assertEquals(data.getInHeaders().getReplyTo().getAddress(),
                     "http://www.w3.org/2005/08/addressing/none");
        Element params = data.getInHeaders().getReplyTo().getReferenceParametersElement();
        final Namespace customerNamespace = Namespace.getNamespace("customer",
                                                                   "http://example.org/customer");
        Attribute level = params.getAttribute("level", customerNamespace);
        assertNotNull(level);
        assertEquals(level.getValue(), "premium");
        Element customerKey = params.getChild("CustomerKey", customerNamespace);
        assertNotNull(customerKey);
        assertEquals(customerKey.getValue(), "Key#123456789");

        Element metadata = data.getInHeaders().getReplyTo().getMetadataElement();
        assertNotNull(metadata);
        Attribute total = metadata.getAttribute("total", Namespace
                .getNamespace("customer", "http://example.org/customer"));
        assertNotNull(total);
        assertEquals(total.getValue(), "1");
        Element meta = data.getInHeaders().getReplyTo()
                .getChild("Metadata",
                          Namespace.getNamespace("customer", "http://example.org/customer"));
        assertNotNull(meta);
View Full Code Here


    // spatialDomain/Envelope/gml:pos [2] (space seperated list of double values)
    // spatialDomain/Envelope/gml:pos@dimension [0..1]  (number of entries in list)
    envelopeElem.addContent(
            new Element( "pos", gmlNS )
                    .addContent( firstPosition )
                    .setAttribute( new Attribute( "dimension", posDimString) ) );
    envelopeElem.addContent(
            new Element( "pos", gmlNS )
                    .addContent( secondPosition )
                    .setAttribute( new Attribute( "dimension", posDimString ) ) );

    // spatialDomain/Envelope/gml:timePostion [2]
    if ( gcs.hasTimeAxis() )
    {
      envelopeElem.addContent(
View Full Code Here

    // spatialDomain/Envelope/gml:pos [2] (space seperated list of double values)
    // spatialDomain/Envelope/gml:pos@dimension [0..1]  (number of entries in list)
    envelopeElem.addContent(
            new Element( "pos", gmlNS )
                    .addContent( firstPosition )
                    .setAttribute( new Attribute( "dimension", posDimString) ) );
    envelopeElem.addContent(
            new Element( "pos", gmlNS )
                    .addContent( secondPosition )
                    .setAttribute( new Attribute( "dimension", posDimString ) ) );

    // spatialDomain/Envelope/gml:timePostion [2]
    if ( gcs.hasTimeAxis() )
    {
      envelopeElem.addContent(
View Full Code Here

    String description = null;

    /* Interpret Attributes */
    List< ? > attributes = outline.getAttributes();
    for (Iterator< ? > iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName();

      /* Link */
      if (name.toLowerCase().equals("xmlurl")) //$NON-NLS-1$
        link = attribute.getValue();

      /* Title */
      else if (name.toLowerCase().equals("title")) //$NON-NLS-1$
        title = attribute.getValue();

      /* Text */
      else if (title == null && name.toLowerCase().equals("text")) //$NON-NLS-1$
        title = attribute.getValue();

      /* Homepage */
      else if (name.toLowerCase().equals("htmlurl")) //$NON-NLS-1$
        homepage = attribute.getValue();

      /* Description */
      else if (name.toLowerCase().equals("description")) //$NON-NLS-1$
        description = attribute.getValue();
    }

    /* Outline is a Category */
    if (link == null && title != null) {
      type = Interpreter.getDefault().getTypesFactory().createFolder((IFolder) parent, title);
View Full Code Here

    String description = null;

    /* Interpret Attributes */
    List<?> attributes = outline.getAttributes();
    for (Iterator<?> iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName();

      /* Link */
      if (name.toLowerCase().equals(Attributes.XML_URL.get().toLowerCase()))
        link = attribute.getValue();

      /* Title */
      else if (name.toLowerCase().equals(Attributes.TITLE.get()))
        title = attribute.getValue();

      /* Text */
      else if (title == null && name.toLowerCase().equals(Attributes.TEXT.get()))
        title = attribute.getValue();

      /* Homepage */
      else if (name.toLowerCase().equals(Attributes.HTML_URL.get().toLowerCase()))
        homepage = attribute.getValue();

      /* Description */
      else if (name.toLowerCase().equals(Attributes.DESCRIPTION.get()))
        description = attribute.getValue();
    }

    /* RSSOwl Namespace Attributes */
    Attribute idAttribute = outline.getAttribute(Attributes.ID.get(), RSSOWL_NS);
    if (idAttribute != null)
      id = Long.valueOf(idAttribute.getValue());

    boolean isSet = Boolean.parseBoolean(outline.getAttributeValue(Attributes.IS_SET.get(), RSSOWL_NS));

    /* Outline is a Folder */
    if (link == null && title != null) {
View Full Code Here

  private void processNewsBin(Element newsBinElement, IFolder folder) {
    String name = newsBinElement.getAttributeValue(Attributes.NAME.get());

    /* RSSOwl Namespace Attributes */
    Long id = null;
    Attribute idAttribute = newsBinElement.getAttribute(Attributes.ID.get(), RSSOWL_NS);
    if (idAttribute != null)
      id = Long.valueOf(idAttribute.getValue());

    INewsBin newsbin = Owl.getModelFactory().createNewsBin(null, folder, name);

    /* Assign old ID value */
    if (id != null)
View Full Code Here

  private void processFeed(Element element, IFeed feed) {

    /* Interpret Attributes */
    List< ? > attributes = element.getAttributes();
    for (Iterator< ? > iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName();

      /* Check wether this Attribute is to be processed by a Contribution */
      if (processAttributeExtern(attribute, feed))
        continue;

      /* Version */
      else if ("version".equals(name)) //$NON-NLS-1$
        feed.setFormat(buildFormat("Bugzilla", attribute.getValue())); //$NON-NLS-1$

      /* Homepage */
      else if ("urlbase".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(attribute.getValue());
        if (uri != null)
          feed.setBase(uri);
      }
    }

View Full Code Here

  private void processFeed(Element element, IFeed feed) {

    /* Interpret Attributes */
    List< ? > attributes = element.getAttributes();
    for (Iterator< ? > iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName();

      /* Check wether this Attribute is to be processed by a Contribution */
      if (processAttributeExtern(attribute, feed))
        continue;

      /* Version */
      else if ("version".equals(name)) //$NON-NLS-1$
        feed.setFormat(buildFormat("Atom", attribute.getValue())); //$NON-NLS-1$

      /* Language */
      else if ("lang".equals(name)) //$NON-NLS-1$
        feed.setLanguage(attribute.getValue());
    }

    /* Interpret Children */
    List< ? > channelChildren = element.getChildren();
    for (Iterator< ? > iter = channelChildren.iterator(); iter.hasNext();) {
View Full Code Here

    ICategory category = Owl.getModelFactory().createCategory(null, type);

    /* Interpret Attributes */
    List< ? > categoryAttributes = element.getAttributes();
    for (Iterator< ? > iter = categoryAttributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName().toLowerCase();

      /* Check wether this Attribute is to be processed by a Contribution */
      if (processAttributeExtern(attribute, category))
        continue;

      /* Term */
      else if ("term".equals(name)) {//$NON-NLS-1$
        category.setDomain(attribute.getValue());

        /* Use as Name if not yet set */
        if (category.getName() == null)
          category.setName(attribute.getValue());
      }

      /* Label */
      else if ("label".equals(name)) //$NON-NLS-1$
        category.setName(attribute.getValue());
    }
  }
View Full Code Here

      return;

    /* Interpret Attributes */
    List< ? > attributes = element.getAttributes();
    for (Iterator< ? > iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();

      /* Check for contributed Namespace Handlers */
      processAttributeExtern(attribute, parent);
    }
  }
View Full Code Here

TOP

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