/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.io.IOException
 *  java.io.Writer
 *  java.lang.String
 *  java.lang.StringBuffer
 */
package org.dom4j.tree;

import java.io.IOException;
import java.io.Writer;
import org.dom4j.Element;
import org.dom4j.Entity;
import org.dom4j.Visitor;
import org.dom4j.tree.AbstractNode;

public abstract class AbstractEntity
extends AbstractNode
implements Entity {
    @Override
    public void accept(Visitor visitor) {
        visitor.visit((Entity)this);
    }

    @Override
    public String asXML() {
        return new StringBuffer().append("&").append(this.getName()).append(";").toString();
    }

    @Override
    public short getNodeType() {
        return 5;
    }

    @Override
    public String getPath(Element element) {
        Element element2 = this.getParent();
        if (element2 != null && element2 != element) {
            return new StringBuffer().append(element2.getPath(element)).append("/text()").toString();
        }
        return "text()";
    }

    @Override
    public String getStringValue() {
        return new StringBuffer().append("&").append(this.getName()).append(";").toString();
    }

    @Override
    public String getUniquePath(Element element) {
        Element element2 = this.getParent();
        if (element2 != null && element2 != element) {
            return new StringBuffer().append(element2.getUniquePath(element)).append("/text()").toString();
        }
        return "text()";
    }

    public String toString() {
        return new StringBuffer().append(super.toString()).append(" [Entity: &").append(this.getName()).append(";]").toString();
    }

    @Override
    public void write(Writer writer) throws IOException {
        writer.write("&");
        writer.write(this.getName());
        writer.write(";");
    }
}

