TestBuilderProxy.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import Geometry from '../geom/Geometry'
  2. import Exception from '../../../../java/lang/Exception'
  3. export default class TestBuilderProxy {
  4. static showIndicator(geom) {
  5. TestBuilderProxy.init()
  6. if (TestBuilderProxy.methodShowIndicator === null) return null
  7. try {
  8. TestBuilderProxy.methodShowIndicator.invoke(null, geom)
  9. } catch (e) {
  10. if (e instanceof Exception) {} else {
  11. throw e
  12. }
  13. } finally {}
  14. }
  15. static init() {
  16. if (TestBuilderProxy.tbClass !== null) return null
  17. try {
  18. TestBuilderProxy.tbClass = TestBuilderProxy.getClassLoader().loadClass(TestBuilderProxy.CLASS_FUNCTIONS_UTIL)
  19. TestBuilderProxy.methodShowIndicator = TestBuilderProxy.tbClass.getMethod('showIndicator', Geometry)
  20. } catch (ex) {
  21. if (ex instanceof Exception) {} else {
  22. throw ex
  23. }
  24. } finally {}
  25. }
  26. static isActive() {
  27. TestBuilderProxy.init()
  28. return TestBuilderProxy.tbClass !== null
  29. }
  30. }
  31. TestBuilderProxy.CLASS_FUNCTIONS_UTIL = 'org.locationtech.jtstest.function.FunctionsUtil'
  32. TestBuilderProxy.tbClass = null
  33. TestBuilderProxy.methodShowIndicator = null