public final class JsAccessibleTypes
extends java.lang.Object
JavaScript
.
It can be used to grant access to the types that cannot be made accessible for JavaScript
via the JsAccessible
annotation, such as core Java classes.
The rules for making a type accessible from JavaScript are just the same as for
the JsAccessible
annotation.
This class does not include the types that are made accessible from JavaScript via the
JsAccessible
annotation. The methods of this class cannot be used to add, remove,
or check accessibility for a type annotated with the JsAccessible
annotation.
Modifier and Type | Method and Description |
---|---|
static boolean |
isAccessible(java.lang.Class<?> type)
Indicates whether the type is made accessible to
JavaScript using this class. |
static void |
makeAccessible(java.lang.Class<?>... publicTypes)
Adds the
publicTypes to the types that are accessible from JavaScript . |
static void |
makeInaccessible(java.lang.Class<?>... publicTypes)
Removes the
publicTypes from the types that are accessible from JavaScript . |
public static void makeAccessible(java.lang.Class<?>... publicTypes)
publicTypes
to the types that are accessible from JavaScript
.
Only public classes and interfaces are allowed as an argument. Passing an enum or
an annotation type results in NotSupportedTypeException
.
publicTypes
- the types to be made accessibleNotSupportedTypeException
- if a type in the publicTypes
array is an enum or an annotationTypeNotPublicException
- if the publicTypes
array contains a type without the public
modifierpublic static void makeInaccessible(java.lang.Class<?>... publicTypes)
publicTypes
from the types that are accessible from JavaScript
.
Does nothing if the publicTypes
array contains a type that is not accessible.
publicTypes
- the types to be removed from the accessible onespublic static boolean isAccessible(java.lang.Class<?> type)
JavaScript
using this class.type
- the type to check for accessibilitytrue
if the type is accessible