summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInstrumental <jgonap@stl.gathman.org>2020-07-31 07:31:41 -0500
committerInstrumental <jgonap@stl.gathman.org>2020-07-31 07:31:47 -0500
commit6450272ae2ba501967bbedd275158aa014cbe238 (patch)
treed1d94f42b0fb59907536c913b86741063c37e79c
parentbdb54b7c8a5df0e686490658067c9013ee43dd7a (diff)
Minor HTML Gen improvments
Handle Null Text, Add DOCTYPE Issue-ID: AAF-1190 Signed-off-by: Instrumental <jgonap@stl.gathman.org> Change-Id: I4c9177cc402b4c0af58a5236610d178b28f2a5e4
-rw-r--r--misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java12
-rw-r--r--misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java2
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;
}