Package gri.tasks.java

Examples of gri.tasks.java.PropertyBindingDef


    Method method = methodDef == null ?
        null : getMethod(klass, methodName, methodDef);

    // parse properties here because we need the class object:
    Element propertyElem = elem.getChild("properties");
    PropertyBindingDef propertyDef = propertyElem == null ?
        null : parseProperties(propertyElem, klass);

    ObjectInvocationConfig config = new ObjectInvocationConfig(
        klass,
        constructor, method,
View Full Code Here


   *
   * The input and output elements are parameter definitions and are parsed
   * as such by parseParameter()
   */
  protected PropertyBindingDef parseProperties(Element elem, Class klass) throws InvalidXMLException {
    PropertyBindingDef propDef = new PropertyBindingDef();

    List children = elem.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("input") || name.equals("output")) {
        ParameterDef param = parseParameter(child);

        String propName = child.getAttributeValue("property");
        if (propName == null)
          propName = param.getName();

        if (name.equals("input")) {
          Method method = getSetter(klass, propName, param);
          propDef.setInput(param, method);
        }
        else {
          Method method = getGetter(klass, propName, param);
          propDef.setOutput(param, method);
        }
      }
    }

    return propDef;
View Full Code Here

        constructorDef.setParameterDefs(new ParameterDef [] {prefixDef});
       
        //define property bindings:
        //    void   setSuffix(String suffix)
        //    String getValue()
        PropertyBindingDef propertyDef = new PropertyBindingDef();
        propertyDef.setInput(new ParameterDef("suffix", Types.STRING),
                ParameterUtil.getSetter(targetClass, "suffix", String.class));
        propertyDef.setOutput(new ParameterDef("value", Types.STRING),
                ParameterUtil.getGetter(targetClass, "value", String.class));
       
        //execute:
        ObjectInvocationConfig config = new ObjectInvocationConfig(
                targetClass, constructor, targetMethod,
View Full Code Here

TOP

Related Classes of gri.tasks.java.PropertyBindingDef

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.