public class Escape extends Object
Constructor and Description |
---|
Escape() |
Modifier and Type | Method and Description |
---|---|
static String |
htmlElementContent(String content)
Escape content for use in HTML.
|
static String |
htmlElementContext(Object obj)
Convert the object to a string via
Object.toString() and HTML
escape the resulting string for use in HTML content. |
static String |
xml(String content)
Escape content for use in XML.
|
static String |
xml(String ifNull,
boolean escapeCRLF,
String content)
Escape content for use in XML.
|
static String |
xml(String ifNull,
String content)
Escape content for use in XML.
|
public static String htmlElementContent(String content)
content
- The content to escapenull
if the content was
null
public static String htmlElementContext(Object obj)
Object.toString()
and HTML
escape the resulting string for use in HTML content.obj
- The object to convert to String and then escape"?"
if obj is
null
public static String xml(String content)
content
- The content to escapenull
if the content was
null
public static String xml(String ifNull, String content)
ifNull
- The value to return if content is null
content
- The content to escapeifNull
if the
content was null
public static String xml(String ifNull, boolean escapeCRLF, String content)
ifNull
- The value to return if content is null
escapeCRLF
- Should CR and LF also be escaped?content
- The content to escapenull
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.