* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.aai.schemagen;
+package org.onap.aai.schemagen;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
private static ApplicationContext context = null;
public static ApplicationContext getApplicationContext() {
- return context;
+ return context;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- context = applicationContext;
+ context = applicationContext;
}
-
- public static <T> T getBean(String beanName, Class<T> requiredType) {
- if(context != null){
- return context.getBean(beanName, requiredType);
- }
+ public static <T> T getBean(String beanName, Class<T> requiredType) {
+ if (context != null) {
+ return context.getBean(beanName, requiredType);
+ }
return null;
- }
+ }
- public static <T> T getBean(Class<T> clazz){
- if(context != null){
+ public static <T> T getBean(Class<T> clazz) {
+ if (context != null) {
return context.getBean(clazz);
}
return null;
}
- public static Object getBean(String bean){
- if(context != null){
+ public static Object getBean(String bean) {
+ if (context != null) {
return context.getBean(bean);
}
return null;