AppModelScript.java 2.04 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa;

import com.adobe.xfa.*;

public class AppModelScript
extends ElementScript {
    static final ScriptTable moScriptTable = new ScriptTable(ModelScript.moScriptTable, "xfa", new ScriptPropObj[]{new ScriptPropObj(AppModelScript.class, "this", "getThis", null, 7, 10, 9, 0), new ScriptPropObj(AppModelScript.class, "timeStamp", "getTimeStamp", "setTimeStamp", 6, 10, 9, 0), new ScriptPropObj(AppModelScript.class, "uuid", "getUUID", "setUUID", 6, 10, 9, 0)}, null);

    public static ScriptTable getScriptTable() {
        return moScriptTable;
    }

    public static void getThis(Obj pObj, Arg oRetVal) {
        oRetVal.setObject(((AppModel)pObj).getContext());
    }

    public static void getTimeStamp(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((AppModel)pObj).getAttribute(XFA.TIMESTAMPTAG).toString());
    }

    public static void getUUID(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((AppModel)pObj).getAttribute(XFA.UUIDTAG).toString());
    }

    public static void setTimeStamp(Obj pObj, Arg oArg) {
        ((AppModel)pObj).setAttribute(new StringAttr("timeStamp", oArg.getString()), XFA.TIMESTAMPTAG);
    }

    public static void setUUID(Obj pObj, Arg oArg) {
        ((AppModel)pObj).setAttribute(new StringAttr("uuid", oArg.getString()), XFA.UUIDTAG);
    }

    public static boolean getPseudoModelFunc(Obj pObj, Arg oRetVal, String sProp) {
        if (sProp == null || sProp.equals("xfa")) {
            return false;
        }
        String pseudoRootName = "$" + sProp;
        Obj oPseudoModel = ((AppModel)pObj).lookupPseudoModel(pseudoRootName);
        if (oPseudoModel != null) {
            if (oRetVal != null) {
                oRetVal.setObject(oPseudoModel);
            }
            return true;
        }
        Node pseudoRoot = Model.lookupShortCut((Model)pObj, pseudoRootName);
        if (pseudoRoot != null) {
            if (oRetVal != null) {
                oRetVal.setObject(pseudoRoot);
            }
            return true;
        }
        return false;
    }
}