diff options
author | Sai Gandham <gandham.saiprasad@gmail.com> | 2020-08-04 20:15:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-04 20:15:51 +0000 |
commit | 0c83dff4e657517f9a870068fee4096964227e0a (patch) | |
tree | 8cd9596e3044b897aed37463fe5d7644edf4fcf8 | |
parent | b5a0b056808af99652b80e42b9d56a9670cc88a1 (diff) | |
parent | 6450272ae2ba501967bbedd275158aa014cbe238 (diff) |
Merge "Minor HTML Gen improvments"
-rw-r--r-- | misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java | 12 | ||||
-rw-r--r-- | misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java index b68ad6e5..258715e1 100644 --- a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java +++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java @@ -151,7 +151,9 @@ public class XGen<RT extends XGen<RT>> { @SuppressWarnings("unchecked")
public RT text(String txt) {
- forward.append(txt);
+ if(txt!=null) {
+ forward.append(txt);
+ }
return (RT)this;
}
@@ -182,8 +184,12 @@ public class XGen<RT extends XGen<RT>> { for (int i=0;i<tabs;++i) {
forward.append(" ");
}
- forward.append(txt);
- if (pretty)forward.println();
+ if(txt!=null) {
+ forward.append(txt);
+ }
+ if (pretty) {
+ forward.println();
+ }
return (RT)this;
}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java index 89a39b3a..7cf3929a 100644 --- a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java +++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java @@ -32,7 +32,7 @@ public class HTML5Gen extends HTMLGen { @Override
public HTMLGen html(String ... attrib) {
- //forward.println("<!DOCTYPE html>");
+ forward.println("<!DOCTYPE html>");
incr("html",attrib);
return this;
}
|