code: 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;
      }
docs: Defines JavaScript objects from a Java class, optionally
  allowing sealing and mapping of Java inheritance to JavaScript
  prototype-based inheritance.
  
  Similar to <code>defineClass(Scriptable scope, Class clazz)</code>
  except that sealing and inheritance mapping are allowed. An object
  that is sealed cannot have properties added or removed. Note that
  sealing is not allowed in the current ECMA/ISO language specification,
  but is likely for the next version.
  
  @param scope The scope in which to define the constructor.
  @param clazz The Java class to use to define the JavaScript objects
  and properties. The class must implement Scriptable.
  @param sealed Whether or not to create sealed standard objects that
  cannot be modified.
  @param mapInheritance Whether or not to map Java inheritance to
  JavaScript prototype-based inheritance.
  @return the class name for the prototype of the specified class
  @exception IllegalAccessException if access is not available
  to a reflected class member
  @exception InstantiationException if unable to instantiate
  the named class
  @exception InvocationTargetException if an exception is thrown
  during execution of methods of the named class
  @since 1.6R2