Here you can find the source of getStaticProperty(Scriptable mixin, String name)
Replies the static property with name name
or Scriptable#NOT_FOUND , if no such property exists.
Parameter | Description |
---|---|
mixin | the parsed JavaScript mixin |
name | the property name |
static public Object getStaticProperty(Scriptable mixin, String name)
//package com.java2s; //License from project: Open Source License import org.mozilla.javascript.Scriptable; public class Main { /**/* w w w . j a v a 2s .c om*/ * <p>Replies the static property with name <code>name</code> or * {@link Scriptable#NOT_FOUND}, if no such property exists.</p> * * @param mixin the parsed JavaScript mixin * @param name the property name * @return the property or {@link Scriptable#NOT_FOUND} */ static public Object getStaticProperty(Scriptable mixin, String name) { Object property = mixin.get(name, mixin); if (property != Scriptable.NOT_FOUND && property instanceof Scriptable) { if (isStaticProperty((Scriptable) property)) { return (Scriptable) property; } } return Scriptable.NOT_FOUND; } /** * <p>Replies true if the mixin property <code>propert</code> is a "static" property.</p> * * @param property the property as defined in the mixin definition * @return true, if this is a static property */ static public boolean isStaticProperty(Scriptable property) { Object isStatic = ((Scriptable) property).get("static", (Scriptable) property); return isStatic != Scriptable.NOT_FOUND && isStatic instanceof Boolean && ((Boolean) isStatic); } }