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

import com.adobe.xfa.AppModel;
import com.adobe.xfa.Element;
import com.adobe.xfa.Model;
import com.adobe.xfa.ModelFactory;
import com.adobe.xfa.ModelPeer;
import com.adobe.xfa.Node;
import com.adobe.xfa.XFA;
import com.adobe.xfa.configuration.ConfigurationModel;
import org.xml.sax.Attributes;

public final class ConfigurationModelFactory
extends ModelFactory {
    public ConfigurationModelFactory() {
        super(XFA.CONFIGTAG, "config", "$config");
    }

    @Override
    protected Model newModel(AppModel parent, Node prevSibling, String uri, String localName, String qName, Attributes attrs) {
        ConfigurationModel cm = new ConfigurationModel(parent, prevSibling);
        cm.setXmlPeer(new ModelPeer((Element)parent.getXmlPeer(), null, uri, localName, qName, attrs, cm));
        cm.setDOMProperties(uri, localName, qName, attrs);
        return cm;
    }

    @Override
    public Model createDOM(Element parent) {
        ConfigurationModel cm = new ConfigurationModel(parent.getAppModel(), null);
        ModelPeer modelPeer = new ModelPeer(parent, null, ConfigurationModel.configurationNS(), "config", "config", null, cm);
        cm.setXmlPeer(modelPeer);
        cm.connectPeerToDocument();
        return cm;
    }

    @Override
    public boolean getAllowAdd() {
        return true;
    }
}