<div dir="ltr"><div dir="ltr">I got that, I'm just wondering if there is a more efficient way to go about it, as that would involve several levels of nested iteration depending on the project. (since you need to examine the requires directives of every module and each of their modules and so on)<input name="virtru-metadata" type="hidden" value="{"email-policy":{"disableCopyPaste":false,"disablePrint":false,"disableForwarding":false,"enableNoauth":false,"expandedWatermarking":false,"expires":false,"sms":false,"expirationNum":1,"expirationUnit":"days","isManaged":false,"persistentProtection":false},"attachments":{},"compose-id":"1","compose-window":{"secure":false}}"></div><br><div class="gmail_quote" style=""><div dir="ltr" class="gmail_attr">On Tue, Sep 12, 2023 at 2:24 PM Jonathan Gibbons <<a href="mailto:jonathan.gibbons@oracle.com">jonathan.gibbons@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    <p>To find whether a project's ModuleElement contains a certain
      dependency, you can (recursively) examine the directives (in
      particular, the RequiresDirective) for the module(s).</p>
    <p><a href="https://docs.oracle.com/en/java/javase/20/docs/api/java.compiler/javax/lang/model/element/ModuleElement.html#getDirectives()" target="_blank">https://docs.oracle.com/en/java/javase/20/docs/api/java.compiler/javax/lang/model/element/ModuleElement.html#getDirectives()</a></p>
    <p>-- Jon<br>
    </p>
    <p><br>
    </p>
    <div>On 9/11/23 9:51 PM, Josiah Noel wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr"> Hello there,
        <div><br>
        </div>
        <div>I think it would be nice if a sort of query method was
          added to ModuleElement such that one can see if a certain
          module is on its graph. <br>
        </div>
        <div><br>
        </div>
        <div>I want to add functionality to my annotation processor that
          should check whether a project's ModuleElement contains a
          certain dependency. Currently, I'm thinking I'll need to
          recursively iterate over the directives to search the module
          path. (which naturally gets much slower the more modules are
          involved) </div>
        <div>
          <div><br>
          </div>
          <span class="gmail_signature_prefix">-- </span><br>
          <div dir="ltr" class="gmail_signature">
            <div dir="ltr">Cheers, Josiah.</div>
          </div>
          </div>
      </div>
    </blockquote>
  </div>

</blockquote></div></div>