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 booleanisAccessible(Class<?> type) Indicates whether the type is made accessible toJavaScriptusing this class.static voidmakeAccessible(Class<?>... publicTypes) Adds thepublicTypesto the types that are accessible fromJavaScript.static voidmakeInaccessible(Class<?>... publicTypes) Removes thepublicTypesfrom the types that are accessible fromJavaScript.
-
Method Details
-
makeAccessible
Adds thepublicTypesto 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 thepublicTypesarray is an enum or an annotationTypeNotPublicException- if thepublicTypesarray contains a type without thepublicmodifier
-
makeInaccessible
Removes thepublicTypesfrom the types that are accessible fromJavaScript.Does nothing if the
publicTypesarray 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 toJavaScriptusing this class.- Parameters:
type- the type to check for accessibility- Returns:
trueif the type is accessible
-