/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.lang.Object
 *  java.lang.String
 *  java.lang.StringBuffer
 */
package org.dom4j.dtd;

public class InternalEntityDecl {
    private String name;
    private String value;

    public InternalEntityDecl() {
    }

    public InternalEntityDecl(String string2, String string3) {
        this.name = string2;
        this.value = string3;
    }

    /*
     * Unable to fully structure code
     * Enabled aggressive block sorting
     * Lifted jumps to return sites
     */
    private String escapeEntityValue(String var1) {
        var2_2 = new StringBuffer();
        var3_3 = 0;
        while (var3_3 < var1.length()) {
            var4_4 = var1.charAt(var3_3);
            switch (var4_4) {
                default: {
                    if (var4_4 >= ' ') break;
                    var2_2.append(new StringBuffer().append("&#").append((int)var4_4).append(";").toString());
                    ** GOTO lbl26
                }
                case '<': {
                    var2_2.append("&#38;#60;");
                    ** GOTO lbl26
                }
                case '>': {
                    var2_2.append("&#62;");
                    ** GOTO lbl26
                }
                case '&': {
                    var2_2.append("&#38;#38;");
                    ** GOTO lbl26
                }
                case '\'': {
                    var2_2.append("&#39;");
                    ** GOTO lbl26
                }
                case '\"': {
                    var2_2.append("&#34;");
                    ** GOTO lbl26
                }
            }
            var2_2.append(var4_4);
lbl26: // 7 sources:
            ++var3_3;
        }
        return var2_2.toString();
    }

    public String getName() {
        return this.name;
    }

    public String getValue() {
        return this.value;
    }

    public void setName(String string2) {
        this.name = string2;
    }

    public void setValue(String string2) {
        this.value = string2;
    }

    /*
     * Enabled aggressive block sorting
     */
    public String toString() {
        StringBuffer stringBuffer = new StringBuffer("<!ENTITY ");
        if (this.name.startsWith("%")) {
            stringBuffer.append("% ");
            stringBuffer.append(this.name.substring(1));
        } else {
            stringBuffer.append(this.name);
        }
        stringBuffer.append(" \"");
        stringBuffer.append(this.escapeEntityValue(this.value));
        stringBuffer.append("\">");
        return stringBuffer.toString();
    }
}

