PacketScript.java 2 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa;

import com.adobe.xfa.*;

public class PacketScript
extends ElementScript {
    protected static final ScriptTable moScriptTable = new ScriptTable(ElementScript.moScriptTable, "packet", new ScriptPropObj[]{new ScriptPropObj(PacketScript.class, "content", "getContent", "setContent", 6, 21, 9, 0)}, new ScriptFuncObj[]{new ScriptFuncObj(PacketScript.class, "setAttribute", "setAttribute", 1, new int[]{6, 6}, 2, 21, 9, "setAttributePermsCheck", 0), new ScriptFuncObj(PacketScript.class, "getAttribute", "getAttribute", 6, new int[]{6}, 1, 21, 9, 0), new ScriptFuncObj(PacketScript.class, "removeAttribute", "removeAttribute", 1, new int[]{6}, 1, 21, 9, "removeAttributePermsCheck", 0)});

    public static ScriptTable getScriptTable() {
        return moScriptTable;
    }

    public static void getAttribute(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        oRetVal.setString(((Packet)pObj).getAttribute(pArgs[0].getString()));
    }

    public static void getContent(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((Packet)pObj).getContent());
    }

    public static void removeAttribute(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ((Packet)pObj).removeAttribute(pArgs[0].getString());
    }

    public static void setAttribute(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ((Packet)pObj).setAttribute(pArgs[0].getString(), pArgs[1].getString());
    }

    public static void setContent(Obj pObj, Arg oArg) {
        ((Packet)pObj).setContent(oArg.getString());
    }

    public static boolean removeAttributePermsCheck(Obj obj, Arg[] args) {
        Element element;
        if (obj instanceof Element && !(element = (Element)obj).checkAncestorPerms()) {
            return false;
        }
        return true;
    }

    public static boolean setAttributePermsCheck(Obj pObj, Arg[] pArgs) {
        Element poTree;
        if (pObj instanceof Element && !(poTree = (Element)pObj).checkAncestorPerms()) {
            return false;
        }
        return true;
    }
}