コード例 #1
0
  protected Listener getListener(Container.Entry entry) {
    URI key = entry.getUri();

    if (cache.containsKey(key)) {
      return cache.get(key);
    } else {
      Listener listener;

      try (InputStream inputStream = entry.getInputStream()) {
        ANTLRJavaParser.parse(new ANTLRInputStream(inputStream), listener = new Listener(entry));
      } catch (IOException ignore) {
        listener = null;
      }

      cache.put(key, listener);
      return listener;
    }
  }
コード例 #2
0
 static {
   // Early class loading
   ANTLRJavaParser.parse(new ANTLRInputStream("class EarlyLoading{}"), new Listener(null));
 }