1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.impl.namespace; |
17 | |
|
18 | |
import org.apache.commons.lang.StringUtils; |
19 | |
import org.kuali.rice.core.api.namespace.Namespace; |
20 | |
import org.kuali.rice.core.api.namespace.NamespaceService; |
21 | |
import org.kuali.rice.krad.service.BusinessObjectService; |
22 | |
|
23 | |
import static java.util.Collections.singletonMap; |
24 | |
|
25 | 0 | public class NamespaceServiceImpl implements NamespaceService { |
26 | |
|
27 | |
private BusinessObjectService boService; |
28 | |
|
29 | |
@Override |
30 | |
public Namespace getNamespace(String code) { |
31 | 0 | if (StringUtils.isBlank(code)) { |
32 | 0 | throw new IllegalArgumentException("the code is blank"); |
33 | |
} |
34 | |
|
35 | 0 | return NamespaceBo.to(boService.findByPrimaryKey(NamespaceBo.class, singletonMap("code", code))); |
36 | |
} |
37 | |
|
38 | |
public void setBusinessObjectService(BusinessObjectService boService) { |
39 | 0 | this.boService = boService; |
40 | 0 | } |
41 | |
} |