ConnectionSetModelFactory.java 1.88 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.connectionset;

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.connectionset.ConnectionSetModel;
import com.adobe.xfa.connectionset.proxies.ConnectionSetProxy;
import com.adobe.xfa.ut.Storage;
import org.xml.sax.Attributes;

public final class ConnectionSetModelFactory
extends ModelFactory {
    final Storage<ConnectionSetProxy> mProxyArray = new Storage();

    public ConnectionSetModelFactory() {
        super(XFA.CONNECTIONSETTAG, "connectionSet", "$connectionSet");
    }

    @Override
    public Model createDOM(Element parent) {
        ConnectionSetModel model = new ConnectionSetModel(parent.getAppModel(), null);
        ModelPeer modelPeer = new ModelPeer(parent, null, ConnectionSetModel.connectionSetNS(), "connectionSet", "connectionSet", null, model);
        model.setXmlPeer(modelPeer);
        model.connectPeerToDocument();
        for (int i = 0; i < model.mProxyArray.size(); ++i) {
            model.registerProxy(model.mProxyArray.get(i));
        }
        return model;
    }

    @Override
    protected Model newModel(AppModel parent, Node prevSibling, String uri, String localName, String qName, Attributes attrs) {
        ConnectionSetModel oModel = new ConnectionSetModel(parent, prevSibling);
        oModel.setXmlPeer(new ModelPeer((Element)parent.getXmlPeer(), null, uri, localName, qName, attrs, oModel));
        for (int i = 0; i < oModel.mProxyArray.size(); ++i) {
            oModel.registerProxy(oModel.mProxyArray.get(i));
        }
        oModel.setDOMProperties(uri, localName, qName, attrs);
        return oModel;
    }

    public void registerProxy(ConnectionSetProxy oProxy) {
        this.mProxyArray.add(oProxy.clone());
    }
}