package com.ryantenney.zookeeper.spring;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import com.ryantenney.zookeeper.spring.ZooKeeper;

public class ZooKeeperAnnotationTarget implements InitializingBean, DisposableBean {

  @ZooKeeper("/field")
  private String field = "initial";

  private String method = "initial";

  @ZooKeeper("/method")
  public void setMethod(final String method) {
    this.method = method;
    print("setter");
  }
  
  public ZooKeeperAnnotationTarget() {
    print("ctor");
  }

  @Override
  public void afterPropertiesSet() throws Exception {
    print("init");
  }
  
  @Override
  public void destroy() throws Exception {
    print("destroy");
  }
  
  private void print(String phase) {
    System.out.printf("phase '%s': field=%s, method=%s\n", phase, field, method);
  }

}

@@ -387,16 +387,47 @@
 tial%22;%0A%0A
+  private String nonexistent;%0A%0A
   @ZooKe
@@ -535,24 +535,177 @@
 etter%22);%0A  %7D
+%0A%0A  @ZooKeeper(%22/nonexistent%22)%0A  public void setNonexistent(final String Nonexistent) %7B%0A    this.nonexistent = Nonexistent;%0A    print(%22nonexistent%22);%0A  %7D
 %0A  %0A  public

Remove unused