public static < T extends Scriptable > String defineClass ( Scriptable scope , Class < T > clazz , boolean sealed , boolean mapInheritance ) throws IllegalAccessException , InstantiationException , InvocationTargetException { BaseFunction ctor = buildClassCtor ( scope , clazz , sealed , mapInheritance ) ; if ( ctor == null ) return null ; String name = ctor . getClassPrototype ( ) . getClassName ( ) ; defineProperty ( scope , name , ctor , ScriptableObject . DONTENUM ) ; return name ; }
Defines JavaScript objects from a Java class optionally allowing sealing and mapping of Java inheritance to JavaScript prototype - based inheritance .