Package com.teamdev.jxbrowser.js
Class JsAccessibleTypes
java.lang.Object
com.teamdev.jxbrowser.js.JsAccessibleTypes
A registry of types that are accessible from
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.
- Since:
- 7.20
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAccessible
(Class<?> type) Indicates whether the type is made accessible toJavaScript
using this class.static void
makeAccessible
(Class<?>... publicTypes) Adds thepublicTypes
to the types that are accessible fromJavaScript
.static void
makeInaccessible
(Class<?>... publicTypes) Removes thepublicTypes
from the types that are accessible fromJavaScript
.
-
Method Details
-
makeAccessible
Adds thepublicTypes
to the types that are accessible fromJavaScript
.Only public classes and interfaces are allowed as an argument. Passing an enum or an annotation type results in
NotSupportedTypeException
.- Parameters:
publicTypes
- the types to be made accessible- Throws:
NotSupportedTypeException
- if a type in thepublicTypes
array is an enum or an annotationTypeNotPublicException
- if thepublicTypes
array contains a type without thepublic
modifier
-
makeInaccessible
Removes thepublicTypes
from the types that are accessible fromJavaScript
.Does nothing if the
publicTypes
array contains a type that is not accessible.- Parameters:
publicTypes
- the types to be removed from the accessible ones
-
isAccessible
Indicates whether the type is made accessible toJavaScript
using this class.- Parameters:
type
- the type to check for accessibility- Returns:
true
if the type is accessible
-