# Class Capabilities

java.lang.Object
bsh.Capabilities

public class Capabilities extends Object
The map of extended features supported by the runtime in which we live.

This class should be independent of all other bsh classes!

Note that tests for class existence here do *not* use the BshClassManager, as it may require other optional class files to be loaded.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`Capabilities.Unavailable`
An attempt was made to use an unavailable capability supported by an optional package.

## Constructor Summary

Constructors
Constructor
Description
`Capabilities()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`canGenerateInterfaces()`
`static boolean`
`classExists(String name)`
Use direct Class.forName() to test for the existence of a class.
`static boolean`
`haveAccessibility()`
If accessibility is enabled determine if the accessibility mechanism exists and if we have the optional bsh package to use it.
`static boolean`
`haveSwing()`
`static void`
`setAccessibility(boolean b)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Capabilities

public Capabilities()

## Method Details

### haveSwing

public static boolean haveSwing()

### canGenerateInterfaces

public static boolean canGenerateInterfaces()

### haveAccessibility

public static boolean haveAccessibility()
If accessibility is enabled determine if the accessibility mechanism exists and if we have the optional bsh package to use it. Note that even if both are true it does not necessarily mean that we have runtime permission to access the fields... Java security has a say in it.

See Also:
  - `ReflectManager`

### setAccessibility

public static void setAccessibility(boolean b) throws Capabilities.Unavailable

Throws:
  `Capabilities.Unavailable`

### classExists

public static boolean classExists(String name)
Use direct Class.forName() to test for the existence of a class. We should not use BshClassManager here because: a) the systems using these tests would probably not load the classes through it anyway. b) bshclassmanager is heavy and touches other class files. this capabilities code must be light enough to be used by any system **including the remote applet**.