Package org.jbpm.wire.operation

Examples of org.jbpm.wire.operation.PropertyOperation


* @see WireParser
*/
public class PropertyBinding implements Binding {

  public Object parse(Element element, Parse parse, Parser parser) {
    PropertyOperation propertyOperation = new PropertyOperation();
    if (element.hasAttribute("setter")) {
      propertyOperation.setSetterName(element.getAttribute("setter"));
    } else if (element.hasAttribute("name")) {
      propertyOperation.setPropertyName(element.getAttribute("name"));
    } else {
      parse.addProblem("property must have name or setter attribute: "+XmlUtil.toString(element));
    }
    Element descriptorElement = XmlUtil.element(element);
    if (descriptorElement!=null) {
      Descriptor descriptor = (Descriptor) parser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      if (descriptor!=null) {
        propertyOperation.setDescriptor(descriptor);
      } else {
        parse.addProblem("couldn't parse property content element as a value descriptor: "+XmlUtil.toString(element));
      }
    } else {
      parse.addProblem("property must have 1 descriptor element out of "+parser.getBindings().getTagNames(WireParser.CATEGORY_DESCRIPTOR)+" as content: "+XmlUtil.toString(element));
View Full Code Here

TOP

Related Classes of org.jbpm.wire.operation.PropertyOperation

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.