Example usage for com.google.gwt.dev.util Util escapeXml

List of usage examples for com.google.gwt.dev.util Util escapeXml

Introduction

In this page you can find the example usage for com.google.gwt.dev.util Util escapeXml.

Prototype

public static String escapeXml(String unescaped) 

Source Link

Document

Escapes '&', '<', '>', '"', and '\'' to their XML entity equivalents.

Usage

From source file:com.google.code.gwt.database.rebind.SqlProxyCreator.java

License:Apache License

/**
 * Generates the Javadoc for the specified service method. The usefulness of
 * this code is arguable low :-)// w w  w.j ava2s .  c o  m
 */
private void generateProxyServiceMethodJavadoc(JMethod service) throws UnableToCompleteException {
    Select select = service.getAnnotation(Select.class);
    Update update = service.getAnnotation(Update.class);
    sw.beginJavaDocComment();
    String stmt = null;
    sw.println("Executes the following SQL " + (update != null ? "Update" : "Select") + " statement:");
    stmt = update != null ? getSql(update) : getSql(select);
    sw.print("<pre>" + Util.escapeXml(stmt) + "</pre>");
    sw.endJavaDocComment();
}