1 package com.atlassian.plugin.osgi.hostcomponents.impl;
2
3 import com.atlassian.plugin.osgi.hostcomponents.PropertyBuilder;
4 import com.atlassian.plugin.osgi.hostcomponents.ContextClassLoaderStrategy;
5
6
7
8
9 class DefaultPropertyBuilder implements PropertyBuilder
10 {
11 private Registration registration;
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 withContextClassLoaderStrategy(ContextClassLoaderStrategy strategy)
24 {
25 return withProperty(CONTEXT_CLASS_LOADER_STRATEGY, strategy.name());
26 }
27
28 public PropertyBuilder withProperty(String name, String value)
29 {
30 registration.getProperties().put(name, value);
31 return this;
32 }
33 }