ProcessingInstructionImpl.java 1.69 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.dom;

import com.adobe.xfa.Node;
import com.adobe.xfa.ProcessingInstruction;
import com.adobe.xfa.dom.ParentNode;
import com.adobe.xfa.dom.XFANodeHolder;
import com.adobe.xfa.ut.StringUtils;
import org.w3c.dom.DOMException;

class ProcessingInstructionImpl
extends XFANodeHolder
implements org.w3c.dom.ProcessingInstruction {
    private final ProcessingInstruction mPI;

    ProcessingInstructionImpl(ParentNode parent, ProcessingInstruction newPI) {
        super(parent, newPI);
        this.mPI = newPI;
    }

    @Override
    public String getData() {
        return this.mPI.getData();
    }

    @Override
    public String getTarget() {
        return this.mPI.getName();
    }

    @Override
    public void setData(String data) throws DOMException {
        throw new DOMException(7, "");
    }

    @Override
    public String getNodeName() {
        return this.mPI.getName();
    }

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

    @Override
    public String getNodeValue() throws DOMException {
        return this.mPI.getData();
    }

    @Override
    public String getTextContent() throws DOMException {
        return this.mPI.getData();
    }

    @Override
    public boolean isEqualNode(org.w3c.dom.Node other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof ProcessingInstructionImpl)) {
            return false;
        }
        ProcessingInstructionImpl otherPI = (ProcessingInstructionImpl)other;
        return StringUtils.equalsWithNull(this.mPI.getName(), otherPI.mPI.getName()) && StringUtils.equalsWithNull(this.mPI.getData(), otherPI.mPI.getData());
    }
}