Exemplo n.º 1
0
 /**
  * @param template A capsule template class annotated with `@Capsule`.
  * @return The template's `init()` declaration, if it has one. Otherwise `null`.
  */
 public static IMethod getInitDecl(IClass template) {
   assert isCapsuleTemplate(template);
   return JavaModel.getApplicationMethodsList(template)
       .stream()
       .filter(m -> isNamed(m, "init"))
       .findFirst()
       .orElse(null);
 }
Exemplo n.º 2
0
 /** @param template A capsule template class annotated with `@Capsule`. */
 public static Stream<IMethod> getProcedures(IClass template) {
   assert isCapsuleTemplate(template);
   return JavaModel.getApplicationMethodsList(template).stream().filter(m -> isProcedure(m));
 }