예제 #1
0
  @Override
  public Object clone() {

    final Outline o = new Outline();
    o.setBreakpoint(isBreakpoint());
    o.setCategories(new ArrayList<String>(getCategories()));
    o.setComment(isComment());
    o.setCreated(created != null ? (Date) created.clone() : null);
    o.setModules(new ArrayList<Module>(getModules()));
    o.setText(getText());
    o.setTitle(getTitle());
    o.setType(getType());

    final ArrayList<Outline> children = new ArrayList<Outline>();
    for (int i = 0; i < getChildren().size(); i++) {
      children.add((Outline) this.children.get(i).clone());
    }
    o.setChildren(children);

    final ArrayList<Attribute> attributes = new ArrayList<Attribute>();
    for (int i = 0; i < getAttributes().size(); i++) {
      attributes.add((Attribute) this.attributes.get(i).clone());
    }
    o.setAttributes(attributes);

    return o;
  }
예제 #2
0
 private Outline buildSubscriptionOutline(FeedSubscription sub) {
   Outline outline = new Outline();
   outline.setText(sub.getTitle());
   outline.setTitle(sub.getTitle());
   outline.setType("rss");
   outline.getAttributes().add(new Attribute("xmlUrl", sub.getFeed().getUrl()));
   if (sub.getFeed().getLink() != null) {
     outline.getAttributes().add(new Attribute("htmlUrl", sub.getFeed().getLink()));
   }
   return outline;
 }
예제 #3
0
  /**
   * Creates an outline with the given title, xmlUrl and htmlUrl. This is traditionally used for
   * aggregator feed lists and will get a type of "rss".
   *
   * @param title Title of the entry.
   * @param xmlUrl link to XML file.
   * @param htmlUrl link to html page.
   */
  public Outline(final String title, final URL xmlUrl, final URL htmlUrl) {
    super();
    setType("rss");
    setTitle(title);
    setAttributes(new ArrayList<Attribute>());

    if (xmlUrl != null) {
      getAttributes().add(new Attribute("xmlUrl", xmlUrl.toString()));
    }

    if (htmlUrl != null) {
      getAttributes().add(new Attribute("htmlUrl", htmlUrl.toString()));
    }
  }
예제 #4
0
 /**
  * Creates a new outline with the specified type and text values.
  *
  * @param type type attribute value/
  * @param text text attribute value
  */
 public Outline(final String type, final String text) {
   setType(type);
   setText(text);
 }