Package org.jdom

Examples of org.jdom.Attribute


    processNamespaceAttributes(element, guid);

    /* Interpret Attributes */
    List< ? > attributes = element.getAttributes();
    for (Iterator< ? > iter = attributes.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, guid))
        continue;

      /* Is Permalink */
      else if ("ispermalink".equals(name)) //$NON-NLS-1$
        guid.setPermaLink(Boolean.parseBoolean(attribute.getValue()));
    }
  }
View Full Code Here


    IModelFactory factory = Owl.getModelFactory();

    ICategory category = factory.createCategory(null, (IEntity) type);
    List< ? > attributes = element.getAttributes();
    for (Iterator< ? > iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName();

      if ("text".equals(name)) {
        category.setName(attribute.getValue());
        break;
      }
    }
  }
View Full Code Here

  private void processChannel(Element element, IFeed feed) {

    /* Interpret Attributes */
    List< ? > channelAttributes = element.getAttributes();
    for (Iterator< ? > iter = channelAttributes.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, feed))
        continue;

      /* Last Modificated */
      else if ("lastmod".equals(name)) //$NON-NLS-1$
        feed.setLastModifiedDate(DateUtils.parseDate(attribute.getValue()));

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

View Full Code Here

    String baseUrl = feed.getHomepage() != null ? feed.getHomepage().toString() : ""; //$NON-NLS-1$

    /* Interpret Attributes */
    List< ? > itemAttributes = element.getAttributes();
    for (Iterator< ? > iter = itemAttributes.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, news))
        continue;

      /* Last Modificated */
      else if ("lastmod".equals(name)) //$NON-NLS-1$
        news.setPublishDate(DateUtils.parseDate(attribute.getValue()));

      /* Href - Append with Feed-Base */
      else if ("href".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(baseUrl + attribute.getValue());
        if (uri != null)
          news.setLink(uri);
      }
    }

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 = Owl.getModelFactory().createFolder(null, (IFolder) parent, title);
View Full Code Here

    Element title = child.getChild("titel"); //$NON-NLS-1$
    feed.setTitle(title.getText());
  }

  private void processMyChannel(Element child, IFeed feed) {
    Attribute lang = child.getAttribute("sprache"); //$NON-NLS-1$
    feed.setLanguage(lang.getValue());

    Element newsElement = child.getChild("news"); //$NON-NLS-1$
    INews news = Owl.getModelFactory().createNews(null, feed, new Date());
    news.setTitle(newsElement.getChildText("titel")); //$NON-NLS-1$
    try {
View Full Code Here

    Element title = child.getChild("titel"); //$NON-NLS-1$
    feed.setTitle(title.getText());
  }

  private void processMyChannel(Element child, IFeed feed) {
    Attribute lang = child.getAttribute("sprache"); //$NON-NLS-1$
    feed.setLanguage(lang.getValue());

    Element newsElement = child.getChild("news"); //$NON-NLS-1$
    INews news = Interpreter.getDefault().getTypesFactory().createNews(feed);
    news.setTitle(newsElement.getChildText("titel")); //$NON-NLS-1$
    try {
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("RSS", attribute.getValue())); //$NON-NLS-1$
    }

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

  private void processChannel(Element element, IFeed feed) {

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

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

View Full Code Here

    ICloud cloud = Owl.getModelFactory().createCloud(feed);

    /* Interpret Attributes */
    List< ? > cloudAttributes = element.getAttributes();
    for (Iterator< ? > iter = cloudAttributes.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, cloud))
        continue;

      /* Domain */
      else if ("domain".equals(name)) //$NON-NLS-1$
        cloud.setDomain(attribute.getValue());

      /* Path */
      else if ("path".equals(name)) //$NON-NLS-1$
        cloud.setPath(attribute.getValue());

      /* Port */
      else if ("port".equals(name)) {//$NON-NLS-1$
        int port = StringUtils.stringToInt(attribute.getValue());
        if (port >= 0)
          cloud.setPort(port);
      }

      /* Procedure Call */
      else if ("registerprocedure".equals(name)) //$NON-NLS-1$
        cloud.setRegisterProcedure(attribute.getValue());

      /* Path */
      else if ("protocol".equals(name)) //$NON-NLS-1$
        cloud.setProtocol(attribute.getValue());
    }
  }
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.