Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**
     * get XML text for name and value of attribute. The value's < and > gets escaped (ampersands do not, for compatibility reasons).
     *
     * @param name
     * @param value
     * @deprecated Thou shall not produce XML by hand.
     */
    public static String wrapatt(final String name, final String value) {
        final String escapedValue = value.replace(">", "&gt;").replace("<", "&lt;");
        return " " + name + "=" + "\"" + escapedValue + "\"";
    }
}