1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.api; |
17 | |
|
18 | |
import org.kuali.rice.core.api.component.ComponentService; |
19 | |
import org.kuali.rice.core.api.datetime.DateTimeService; |
20 | |
import org.kuali.rice.core.api.encryption.EncryptionService; |
21 | |
import org.kuali.rice.core.api.impex.xml.XmlExporterService; |
22 | |
import org.kuali.rice.core.api.impex.xml.XmlIngesterService; |
23 | |
import org.kuali.rice.core.api.namespace.NamespaceService; |
24 | |
import org.kuali.rice.core.api.parameter.ParameterRepositoryService; |
25 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
26 | |
import org.kuali.rice.core.api.style.StyleService; |
27 | |
|
28 | |
import javax.xml.namespace.QName; |
29 | |
|
30 | 0 | public class CoreApiServiceLocator { |
31 | |
|
32 | |
public static final String NAMESPACE_SERVICE = "namespaceService"; |
33 | |
public static final String XML_EXPORTER_SERVICE = "xmlExporterService"; |
34 | |
public static final String XML_INGESTER_SERVICE = "xmlIngesterService"; |
35 | |
public static final String STYLE_SERVICE = "styleService"; |
36 | |
|
37 | 0 | public static final QName PARAMETER_REPOSITORY_SERVICE = new QName(CoreConstants.Namespaces.CORE_NAMESPACE_2_0, "parameterRepositoryService"); |
38 | 0 | public static final QName COMPONENT_SERVICE = new QName(CoreConstants.Namespaces.CORE_NAMESPACE_2_0, "componentService"); |
39 | |
|
40 | |
static <T> T getService(String serviceName) { |
41 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
42 | |
} |
43 | |
|
44 | |
static <T> T getService(QName serviceName) { |
45 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
46 | |
} |
47 | |
|
48 | |
public static NamespaceService getNamespaceService() { |
49 | 0 | return getService(NAMESPACE_SERVICE); |
50 | |
} |
51 | |
|
52 | |
public static XmlExporterService getXmlExporterService() { |
53 | 0 | return getService(XML_EXPORTER_SERVICE); |
54 | |
} |
55 | |
|
56 | |
public static XmlIngesterService getXmlIngesterService() { |
57 | 0 | return getService(XML_INGESTER_SERVICE); |
58 | |
} |
59 | |
|
60 | |
public static final EncryptionService getEncryptionService() { |
61 | 0 | return getService(CoreConstants.Services.ENCRYPTION_SERVICE); |
62 | |
} |
63 | |
|
64 | |
public static StyleService getStyleService() { |
65 | 0 | return getService(STYLE_SERVICE); |
66 | |
} |
67 | |
|
68 | |
public static DateTimeService getDateTimeService() { |
69 | 0 | return getService(CoreConstants.Services.DATETIME_SERVICE); |
70 | |
} |
71 | |
|
72 | |
public static ParameterRepositoryService getParameterRepositoryService() { |
73 | 0 | return getService(PARAMETER_REPOSITORY_SERVICE); |
74 | |
} |
75 | |
|
76 | |
public static ComponentService getComponentService() { |
77 | 0 | return getService(COMPONENT_SERVICE); |
78 | |
} |
79 | |
|
80 | |
} |