Package org.jbpm.pvm.type

Examples of org.jbpm.pvm.type.Converter


      }
    }

    typeMapping.setMatcher(matcher);

    Converter converter = null;
    if (element.hasAttribute("converter")) {
      String converterClassName = element.getAttribute("converter");
      ClassLoader classLoader = parser.getClassLoader();
      try {
        Class<?> converterClass = classLoader.loadClass(converterClassName);
        converter = (Converter) converterClass.newInstance();
      } catch (Exception e) {
        parse.addProblem("couldn't instantiate converter "+converterClassName);
      }
    } else {
      // look for the matcher element
      Element converterElement = XmlUtil.element(element, "converter");
      Element converterObjectElement = XmlUtil.element(converterElement);
      if (converterObjectElement!=null) {
        try {
          converter = (Converter) parser.parseElement(converterObjectElement, parse);
        } catch (ClassCastException e) {
          parse.addProblem("converter is not a "+Converter.class.getName()+": "+(converter!=null ? converter.getClass().getName() : "null"));
        }
      }
    }

    typeMapping.setConverter(converter);
View Full Code Here


        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Class<?> converterClass = ReflectUtil.loadClass(classLoader, converterClassName);
       
        String converterName = properties.getProperty(converterClassName);
        converterNames.put(converterClass, converterName);
        Converter converter = (Converter) converterClass.newInstance();
        converters.put(converterName, converter);
      } catch (Exception e) {
        throw new PvmException("couldn't initialize converter type "+converterClassName, e);
      }
    }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.type.Converter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.