View Javadoc

1   package com.atlassian.plugin.osgi.hostcomponents.impl;
2   
3   import com.atlassian.plugin.osgi.hostcomponents.PropertyBuilder;
4   
5   /**
6    * Default property builder for host components
7    */
8   class DefaultPropertyBuilder implements PropertyBuilder
9   {
10      private Registration registration;
11      static final String BEAN_NAME = "bean-name";
12  
13      public DefaultPropertyBuilder(Registration registration)
14      {
15          this.registration = registration;
16      }
17  
18      public PropertyBuilder withName(String name)
19      {
20          return withProperty(BEAN_NAME, name);
21      }
22  
23      public PropertyBuilder withProperty(String name, String value)
24      {
25          registration.getProperties().put(name, value);
26          return this;
27      }
28  }