FormSchema.java 2.61 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.form;

import com.adobe.xfa.Attribute;
import com.adobe.xfa.ChildReln;
import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.StringAttr;
import com.adobe.xfa.XFA;
import com.adobe.xfa.form.FormExclGroup;
import com.adobe.xfa.form.FormField;
import com.adobe.xfa.form.FormInstanceManager;
import com.adobe.xfa.form.FormManifest;
import com.adobe.xfa.form.FormSubform;
import com.adobe.xfa.form.FormSubformSet;
import com.adobe.xfa.template.TemplateSchema;

public class FormSchema
extends TemplateSchema {
    public FormSchema() {
        this.initSchema();
    }

    @Override
    protected void initSchema() {
        super.initSchema();
        this.putElement(XFA.FORMTAG, XFA.SUBFORMTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putElement(XFA.FORMTAG, XFA.PROTOTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putElement(XFA.FORMTAG, XFA.DESCTAG, ChildReln.getZeroOrOne(), 0, 63, 0);
        this.putElement(XFA.FORMTAG, XFA.EXTRASTAG, ChildReln.getZeroOrOne(), 0, 63, 0);
        this.putElement(XFA.FORMTAG, XFA.DSIGDATATAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putAttribute(XFA.FORMTAG, XFA.CHECKSUMTAG, null, 0, 63, 0);
        this.putElement(XFA.SUBFORMTAG, XFA.INSTANCEMANAGERTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putElement(XFA.SUBFORMSETTAG, XFA.INSTANCEMANAGERTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putElement(XFA.PAGEAREATAG, XFA.INSTANCEMANAGERTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putElement(XFA.SUBFORMTAG, XFA.PAGESETTAG, ChildReln.getZeroOrMore(), 0, 63, 0);
        this.putAttribute(XFA.INSTANCEMANAGERTAG, XFA.NAMETAG, new StringAttr("name", ""), 0, 63, 0);
        this.putElement(XFA.INSTANCEMANAGERTAG, XFA.OCCURTAG, ChildReln.getZeroOrOne(), 0, 63, 0);
    }

    @Override
    protected Element newElement(int eTag, Element parent, Node prevSibling) {
        if (eTag == XFA.FIELDTAG) {
            return new FormField(parent, prevSibling);
        }
        if (eTag == XFA.SUBFORMTAG) {
            return new FormSubform(parent, prevSibling);
        }
        if (eTag == XFA.EXCLGROUPTAG) {
            return new FormExclGroup(parent, prevSibling);
        }
        if (eTag == XFA.SUBFORMSETTAG) {
            return new FormSubformSet(parent, prevSibling);
        }
        if (eTag == XFA.INSTANCEMANAGERTAG) {
            return new FormInstanceManager(parent, prevSibling);
        }
        if (eTag == XFA.MANIFESTTAG) {
            return new FormManifest(parent, prevSibling);
        }
        return super.newElement(eTag, parent, prevSibling);
    }
}