Package org.apache.agila.model

Examples of org.apache.agila.model.Binding


        TaskService tskServ = new TaskServiceImpl();
        NotificationService notifyService = new NotificationServiceImpl();

        node = new HelloWorldActivity();

        node.addBinding(new Binding("cheese", "edam", Binding.STATIC, true, true));

        node.addBinding(new Binding("drink", "drink", Binding.EL, true, true));

        context = new NodeContextImpl(node, new InstanceImpl(), ts, tskServ, notifyService );
    }
View Full Code Here


            String input = getValueOfAttribute("input", bindingNode);
            String output = getValueOfAttribute("output", bindingNode);

            String value = bindingNode.getTextTrim();

            Binding binding = new Binding(name, value,
                    ("EL".equals(type.toUpperCase()) ? Binding.EL : Binding.STATIC),
                    ("TRUE".equals(input.toUpperCase())),
                    ("TRUE".equals(output.toUpperCase())));

            n.addBinding(binding);
View Full Code Here

     */
    public Object getBoundValue(String name) {

        Map bm = node.getBindings();

        Binding binding = (Binding) bm.get(name);

        if (binding == null) {
            return null;
        }

        switch(binding.getType()) {

            case Binding.STATIC :
                return binding.getValue();

            case Binding.EL :
                try {
                    return jexlResolver(binding.getValue(), this.getInstanceData());
                }
                catch(Exception e) {
                    // TODO somethig useful
                    e.printStackTrace();
                    return "";
                }
            default :
                return binding.getValue();
        }
    }
View Full Code Here

    public void setBoundValue(String name, Object value) {

        Map bm = node.getBindings();

        Binding binding = (Binding) bm.get(name);

        if (binding == null) {
            // TODO tell someone
            return;
        }

        switch(binding.getType()) {

            case Binding.EL :
                try {
                    /*
                     * Awful hack - need to fix so exprs can be used
                     * for now, assume a scalar reference and just set it
                     */

                    this.getInstanceData().put(binding.getName(), value);
                }
                catch(Exception e) {
                    // TODO somethig useful
                    e.printStackTrace();
                }
View Full Code Here

TOP

Related Classes of org.apache.agila.model.Binding

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.