try { ClassUtil.newObject(COMPILER); return null; } catch (ClassLoadingException e1) {
/** * Returns a generic type to simplify code generation. * * @param binding a bound element * @return a generic type */ public String getGenericType(final ICobolBinding binding) { if (binding instanceof ICobolComplexBinding) { return "complex"; } if (binding instanceof ICobolChoiceBinding) { return "choice"; } if (binding instanceof ICobolArrayComplexBinding) { return "complexArray"; } if (ClassUtil.isEnum(BindingUtil.getJaxbTypeName(binding))) { return "enum"; } else { return "simple"; } }
mPojoClass = ClassUtil.loadClass(mPojoClassName); boolean methodFound = false; for (Method method : mPojoClass.getMethods()) {
/** * Builds a get method name for a field name. The get method must be a valid * Jaxb method. * <p/> * Boolean types (unless they are arrays) have getter methods starting with * "is" rather than "get". * * @param binding a bound element * @return a getter method */ public String getterMethodName(final ICobolBinding binding) { /* Jaxb objects export lists rather than wrappers */ if (binding instanceof ICobolArrayComplexBinding) { return getterSetterMethodName("get", ((ICobolArrayComplexBinding) binding) .getComplexItemBinding()); } String getterPrefix = ClassUtil.getGetterPrefix(binding.getJaxbType(), binding.getMaxOccurs()); return getterSetterMethodName(getterPrefix, binding); }
compiler = compilerClass.newInstance(); } else { compiler = ClassUtil.newObject(COMPILER);
operationProxyClassName = DEFAULT_OPERATION_PROXY_CLASS_NAME; Class < ? > clazz = ClassUtil.loadClass(operationProxyClassName); Constructor < ? > constructor = clazz.getConstructor(Map.class); return (IOperationProxy) constructor
return (ConnectionFactory) ClassUtil.newObject(factoryClass); } catch (SecurityException e) { throw new LegStarConfigurationException(e);
Class < ? > proxyInvokerClass = ClassUtil.loadClass(className); Constructor < ? > constructor = proxyInvokerClass .getConstructor(Map.class);
/** * Load host transformers identified by class name. * * @param className the transformers class name * @return an instance of the host transformers * @throws ProxyConfigurationException if unable to instantiate the host * transformers */ private IHostTransformers getHostTransformers( final String className) throws ProxyConfigurationException { try { Class < ? > clazz = ClassUtil.loadClass(className); Constructor < ? > constructor = clazz.getConstructor(); return (IHostTransformers) constructor.newInstance(new Object[] {}); } catch (SecurityException e) { throw new ProxyConfigurationException(e); } catch (IllegalArgumentException e) { throw new ProxyConfigurationException(e); } catch (ClassNotFoundException e) { throw new ProxyConfigurationException(e); } catch (NoSuchMethodException e) { throw new ProxyConfigurationException(e); } catch (InstantiationException e) { throw new ProxyConfigurationException(e); } catch (IllegalAccessException e) { throw new ProxyConfigurationException(e); } catch (InvocationTargetException e) { throw new ProxyConfigurationException(e.getTargetException()); } }