Details

      Description

      package test.propertyaccess;

      import org.apache.tapestry5.ioc.Registry;
      import org.apache.tapestry5.ioc.RegistryBuilder;
      import org.apache.tapestry5.ioc.services.ClassPropertyAdapter;
      import org.apache.tapestry5.ioc.services.PropertyAccess;
      import org.apache.tapestry5.ioc.services.PropertyAdapter;

      public class App {

      public interface MyBeanInterface

      { int getValue(); }

      public interface MyEditableBeanInterface extends MyBeanInterface

      { void setValue(int value); }

      public static void main(String[] args)

      { // init RegistryBuilder builder = new RegistryBuilder(); Registry registry = builder.build(); registry.performRegistryStartup(); // get property adapter PropertyAccess propertyAccess = registry.getService(PropertyAccess.class); ClassPropertyAdapter classAdapter = propertyAccess.getAdapter(MyEditableBeanInterface.class); PropertyAdapter propertyAdapter = classAdapter.getPropertyAdapter("value"); // print System.out.println(propertyAdapter.isRead() ? "value is readable" : "value is not readable"); System.out.println(propertyAdapter.isUpdate() ? "value is updateable" : "value is not updateable"); }

      }

      Output:
      value is readable
      value is not updateable
      Why?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thiagohp Thiago H. de Paula Figueiredo
                Reporter:
                 alexlumpov Alex Lumpov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: