Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 package org.chromium.distiller.webdocument; | |
| 2 | |
| 3 public class WebTag extends WebElement { | |
|
mdjones
2015/08/05 15:44:35
Briefly describe what this is and how it is used.
| |
| 4 | |
| 5 private String tagName; | |
| 6 private TagType tagType; | |
| 7 | |
| 8 public enum TagType { | |
| 9 START, END | |
| 10 } | |
| 11 | |
| 12 public WebTag(String tagName, TagType tagType) { | |
| 13 this.tagName = tagName; | |
| 14 this.tagType = tagType; | |
| 15 } | |
| 16 | |
| 17 public boolean isStartTag() { | |
| 18 return tagType == TagType.START; | |
| 19 } | |
| 20 | |
| 21 public String getTagName() { | |
| 22 return tagName; | |
| 23 } | |
| 24 | |
| 25 @Override | |
| 26 public String generateOutput(boolean textOnly) { | |
| 27 if (textOnly) { | |
| 28 return ""; | |
| 29 } | |
| 30 return "<" + (isStartTag() ? "" : "/") + tagName + ">"; | |
| 31 } | |
| 32 } | |
| OLD | NEW |