/jEdit/tags/jedit-4-2-pre14/bsh/commands/setStrictJava.bsh

# · Unknown · 27 lines · 22 code · 5 blank · 0 comment · 0 complexity · 457d99d4b02817cb1326fd90dbc8ef95 MD5 · raw file

  1. /**
  2. Enable or disable "Strict Java Mode".
  3. When strict Java mode is enabled BeanShell will:
  4. <p>
  5. <ol>
  6. <li>Require typed variable declarations, method arguments and return types.
  7. <li>Modify the scoping of variables to look for the variable
  8. declaration first in the parent namespace, as in a java method inside
  9. a java class. e.g. if you can write a method called incrementFoo() that
  10. will do the expected thing without referring to "super.foo".
  11. </ul>
  12. <p/>
  13. See "Strict Java Mode" for more details.
  14. <p/>
  15. <em>Note: Currently most standard BeanShell commands will not work in
  16. Strict Java mode simply because they have not been written with full
  17. types, etc.
  18. */
  19. void setStrictJava( boolean val )
  20. {
  21. this.interpreter.setStrictJava( val );
  22. }