Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: java/org/chromium/distiller/webdocument/PlaceHolder.java

Issue 1230583006: Fix for keeping lists structure (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Small code refactor for more appropriate names. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 package org.chromium.distiller.webdocument;
2
3 public class PlaceHolder extends WebElement {
wychen 2015/08/01 01:00:20 Might need a more specific name, but not too speci
4
5 private String tagName;
6 private TagType tagType;
7
8 public enum TagType {
9 START, END
10 }
11
12 public PlaceHolder(String tagName, TagType tagType) {
13 this.tagName = tagName;
14 this.tagType = tagType;
15 }
16
17 public boolean isStart() {
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 StringBuilder sb = new StringBuilder("<");
31 if (!isStart()) {
32 sb.append("/");
33 }
34 sb.append(tagName.toLowerCase()).append(">");
35 return sb.toString();
mdjones 2015/08/03 16:57:54 I think the following is more clear: return "<" +
36 }
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698