ConfigurationKey.java 1.23 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.configuration;

import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.XFA;
import com.adobe.xfa.configuration.ConfigurationElement;
import org.xml.sax.Attributes;

public class ConfigurationKey
extends ConfigurationElement {
    public ConfigurationKey(Element parent, Node prevSibling) {
        super(parent, prevSibling, null, "configurationKey", "configurationKey", null, XFA.CONFIGURATIONKEYTAG, "configurationKey");
    }

    public boolean isValidAttr(int eTag) {
        if (eTag == XFA.CONFIGURATIONKEYTAG) {
            return true;
        }
        if (super.isValidAttr(eTag, false, null)) {
            return true;
        }
        return false;
    }

    @Override
    public boolean isValidChild(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly) {
        if (eTag == XFA.TEXTNODETAG) {
            for (Node child = this.getFirstXFAChild(); child != null; child = child.getNextXFASibling()) {
                if (!(child instanceof Element)) continue;
                return false;
            }
            return true;
        }
        return super.isValidChild(eTag, nError, bBeforeInsert, bOccurrenceErrorOnly);
    }
}