diff options
Diffstat (limited to 'doc/org.eclipse.eef.documentation.export/src/org/eclipse/eef/documentation/export/internal/Topic.java')
-rw-r--r-- | doc/org.eclipse.eef.documentation.export/src/org/eclipse/eef/documentation/export/internal/Topic.java | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/doc/org.eclipse.eef.documentation.export/src/org/eclipse/eef/documentation/export/internal/Topic.java b/doc/org.eclipse.eef.documentation.export/src/org/eclipse/eef/documentation/export/internal/Topic.java new file mode 100644 index 000000000..35d69610c --- /dev/null +++ b/doc/org.eclipse.eef.documentation.export/src/org/eclipse/eef/documentation/export/internal/Topic.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2016 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.eef.documentation.export.internal; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * A POJO used to parse the toc.xml to create the breadcrumb of the website. + * + * @author sbegaudeau + */ +public class Topic { + + /** + * The URL of the topic. + */ + private String href; + + /** + * The label of the topic. + */ + private String label; + + /** + * The parent topic. + */ + private Topic parent; + + /** + * The child topics. + */ + private List<Topic> topics = new ArrayList<>(); + + /** + * Return the href. + * + * @return the href + */ + public String getHref() { + return this.href; + } + + /** + * Sets the href. + * + * @param href + * the href to set + */ + public void setHref(String href) { + this.href = href; + } + + /** + * Return the label. + * + * @return the label + */ + public String getLabel() { + return this.label; + } + + /** + * Sets the label. + * + * @param label + * the label to set + */ + public void setLabel(String label) { + this.label = label; + } + + /** + * Return the topics. + * + * @return the topics + */ + public List<Topic> getTopics() { + return this.topics; + } + + /** + * Sets the parent. + * + * @param parent + * the parent to set + */ + public void setParent(Topic parent) { + this.parent = parent; + } + + /** + * Return the parent. + * + * @return the parent + */ + public Topic getParent() { + return this.parent; + } + + /** + * {@inheritDoc} + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Topic [href=" + this.href + ", label=" + this.label + ", children=" + this.topics.stream().map(Object::toString).collect(Collectors.toList()) + "]"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ + } +} |