例: IsProtectReaders property (View - Java™)

次のエージェントは、[readers] フィールドの保護を切り替えます。

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View view = db.getView("By Category");
      if (view.isProtectReaders()) {
        view.setProtectReaders(false);
        System.out.println
        ("Protect readers is not set"); }
      else {
        view.setProtectReaders(true);
        System.out.println
        ("Protect readers is set"); }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}