Chromium Code Reviews| Index: java/org/chromium/distiller/webdocument/WebTag.java |
| diff --git a/java/org/chromium/distiller/webdocument/WebTag.java b/java/org/chromium/distiller/webdocument/WebTag.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5fd7689e8b000b6a01894e710e6ddaf15041ac4b |
| --- /dev/null |
| +++ b/java/org/chromium/distiller/webdocument/WebTag.java |
| @@ -0,0 +1,32 @@ |
| +package org.chromium.distiller.webdocument; |
| + |
| +public class WebTag extends WebElement { |
|
mdjones
2015/08/05 15:44:35
Briefly describe what this is and how it is used.
|
| + |
| + private String tagName; |
| + private TagType tagType; |
| + |
| + public enum TagType { |
| + START, END |
| + } |
| + |
| + public WebTag(String tagName, TagType tagType) { |
| + this.tagName = tagName; |
| + this.tagType = tagType; |
| + } |
| + |
| + public boolean isStartTag() { |
| + return tagType == TagType.START; |
| + } |
| + |
| + public String getTagName() { |
| + return tagName; |
| + } |
| + |
| + @Override |
| + public String generateOutput(boolean textOnly) { |
| + if (textOnly) { |
| + return ""; |
| + } |
| + return "<" + (isStartTag() ? "" : "/") + tagName + ">"; |
| + } |
| +} |