Examples of PropertiesDescriptor


Examples of org.jbpm.pvm.internal.wire.descriptor.PropertiesDescriptor

  public PropertiesBinding() {
    super("properties");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    PropertiesDescriptor descriptor = new PropertiesDescriptor();
   
    if (element.hasAttribute("file")) {
      descriptor.setFile(element.getAttribute("file"));
    }
   
    if (element.hasAttribute("resource")) {
      descriptor.setResource(element.getAttribute("resource"));
    }
   
    if (element.hasAttribute("url")) {
      descriptor.setUrl(element.getAttribute("url"));
    }
   
    Boolean isXml = XmlUtil.attributeBoolean(element, "is-xml", false, parse);
    if (isXml!=null) {
      descriptor.setXml(isXml.booleanValue());
    }

    List<Descriptor> keyDescriptors = new ArrayList<Descriptor>();
    List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();

    List<Element> elements = XmlUtil.elements(element);
    for (Element propertyElement: elements) {
      if ("property".equals(XmlUtil.getTagLocalName(propertyElement))) {
        // key
        String name = XmlUtil.attribute(propertyElement, "name");
        // value
        String value = XmlUtil.attribute(propertyElement, "value");

        if ( (name!=null)
             && (value!=null)
           ) {
          keyDescriptors.add(new StringDescriptor(name));
          valueDescriptors.add(new StringDescriptor(value));
        } else {
          parse.addProblem("property must have name and value attributes: "+XmlUtil.toString(propertyElement), element);
        }
      } else {
        parse.addProblem("properties can only contain property elements: "+XmlUtil.toString(propertyElement), element);
      }
    }

    descriptor.setKeyDescriptors(keyDescriptors);
    descriptor.setValueDescriptors(valueDescriptors);

    return descriptor;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.PropertiesDescriptor

        } else {
          parse.addProblem("exactly 1 attribute in {resource, file, class, url} was expected in mapping: "+XmlUtil.toString(element));
        }

      } else if ("properties".equals(XmlUtil.getTagLocalName(configElement))) {
        PropertiesDescriptor propertiesDescriptor = (PropertiesDescriptor) propertiesBinding.parse(configElement, parse, parser);
        descriptor.setPropertiesDescriptor(propertiesDescriptor);

      } else if ("cache-configuration".equals(XmlUtil.getTagLocalName(configElement))) {
        StreamInput streamSource = null;
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.PropertiesDescriptor

        } else {
          parse.addProblem("exactly 1 attribute in {resource, file, class, url} was expected in mapping: "+XmlUtil.toString(element));
        }

      } else if ("properties".equals(XmlUtil.getTagLocalName(configElement))) {
        PropertiesDescriptor propertiesDescriptor = (PropertiesDescriptor) propertiesBinding.parse(configElement, parse, parser);
        descriptor.setPropertiesDescriptor(propertiesDescriptor);

      } else if ("cache-configuration".equals(XmlUtil.getTagLocalName(configElement))) {
        StreamInput streamSource = null;
View Full Code Here

Examples of org.jbpm.wire.descriptor.PropertiesDescriptor

* @author Tom Baeyens
*/
public class PropertiesBinding implements Binding {
 
  public Object parse(Element element, Parse parse, Parser parser) {
    PropertiesDescriptor descriptor = new PropertiesDescriptor();
   
    if (element.hasAttribute("file")) {
      descriptor.setFile(element.getAttribute("file"));
    }
   
    if (element.hasAttribute("resource")) {
      descriptor.setResource(element.getAttribute("resource"));
    }
   
    if (element.hasAttribute("url")) {
      descriptor.setUrl(element.getAttribute("url"));
    }
   
    if (element.hasAttribute("is-xml")) {
      String isXmlText = element.getAttribute("is-xml");
      Boolean isXml = XmlUtil.booleanEquals(isXmlText, null);
      if (isXml!=null) {
        descriptor.setXml(isXml);
      }
    }
   
    List<Descriptor> keyDescriptors = new ArrayList<Descriptor>();
    List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();

    List<Element> elements = XmlUtil.elements(element);
    if (elements!=null) {
      for (Element propertyElement: elements) {
        if ("property".equals(XmlUtil.getTagName(propertyElement))) {
          // key
          String name = XmlUtil.attribute(propertyElement, "name");
          // value
          String value = XmlUtil.attribute(propertyElement, "value");

          if ( (name!=null)
               && (value!=null)
             ) {
            StringDescriptor nameDescriptor = new StringDescriptor();
            nameDescriptor.setValue(name);
            keyDescriptors.add(nameDescriptor);
            StringDescriptor valueDescriptor = new StringDescriptor();
            valueDescriptor.setValue(value);
            valueDescriptors.add(valueDescriptor);
          } else {
            parse.addProblem("property must have name and value attributes: "+XmlUtil.toString(propertyElement));
          }
        } else {
          parse.addProblem("properties can only contain property elements: "+XmlUtil.toString(propertyElement));
        }

      }
    }
    descriptor.setKeyDescriptors(keyDescriptors);
    descriptor.setValueDescriptors(valueDescriptors);

    return descriptor;
  }
View Full Code Here

Examples of org.jbpm.wire.descriptor.PropertiesDescriptor

        } else if ("mapping".equals(XmlUtil.getTagName(configElement))) {
         
          parseMapping(configElement, descriptor, parse);
         
        } else if ("properties".equals(XmlUtil.getTagName(configElement))) {
          PropertiesDescriptor propertiesDescriptor = (PropertiesDescriptor) propertiesBinding.parse(configElement, parse, parser);
          descriptor.setPropertiesDescriptor(propertiesDescriptor);
         
        } else if ("cache-configuration".equals(XmlUtil.getTagName(configElement))) {
          InputStream stream = null;
         
View Full Code Here

Examples of org.jitterbit.integration.jms.PropertiesDescriptor

    @Override
    public void applyTo(JmsMessage m) throws IntegrationDataPanelException {
        try {
            MessagePropertiesDescriptor descriptor = new MessagePropertiesDescriptor();
            PropertiesDescriptor tableData = table.getCurrentData();
            for (MessageProperty p : tableData.properties()) {
                String defVal = tableData.getDefaultValue(p);
                descriptor.addProperty(p, defVal);
            }
            m.setUserDefinedProperties(descriptor);
        } catch (IllegalArgumentException ex) {
            throw new IntegrationDataPanelException(ex.getMessage(), ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.