Package org.apache.oodt.cas.pushpull.expressions

Examples of org.apache.oodt.cas.pushpull.expressions.Method


                        else
                            break;
                    }

                    if (input.substring(j, j + 1).charAt(0) == '(') {
                        Method m = methodRepo.get(method.toString());
                        StringTokenizer st = new StringTokenizer(input
                                .substring(j, input.substring(j).indexOf(")")
                                        + j), "#\", ()");
                        while (st.hasMoreTokens()) {
                            String arg = st.nextToken();
                            m.addArg(null, arg);
                        }
                        String returnValue = m.execute().toString();
                        input = input.substring(0, i)
                                + returnValue
                                + input.substring(input.substring(i).indexOf(
                                        ")")
                                        + 1 + i);
View Full Code Here


            if (node.getNodeName().equals("method")) {
                NodeList children = node.getChildNodes();

                // create Method Object
                String methodName = ((Element) node).getAttribute("name");
                Method method = new Method(methodName);

                // loop through to fill Method Object
                for (int j = 0; j < children.getLength(); j++) {
                    Node child = children.item(j);

                    // get the Method's behavoir
                    if (child.getNodeName().equals("action")) {
                        method.setBehavoir(child.getTextContent());

                        // get the Method's arguments
                    } else if (child.getNodeName().equals("args")) {
                        String name, argType = null;
                        NodeList grandChildren = child.getChildNodes();

                        // loop for every arg element
                        for (int k = 0; k < grandChildren.getLength(); k++) {
                            Node grandChild = grandChildren.item(k);

                            // parse arg element
                            if (grandChild.getNodeName().equals("arg")) {
                                name = ((Element) grandChild)
                                        .getAttribute("name");

                                // get arg element properties
                                NodeList greatGrandChildren = grandChild
                                        .getChildNodes();
                                for (int l = 0; l < greatGrandChildren
                                        .getLength(); l++) {
                                    Node greatGrandChild = greatGrandChildren
                                            .item(l);
                                    if (greatGrandChild.getNodeName().equals(
                                            "type")) {
                                        argType = greatGrandChild
                                                .getTextContent();
                                    }
                                }

                                // create argument signature in Method
                                method
                                        .addArgSignature(
                                                name,
                                                ((argType.toLowerCase()
                                                        .equals("int")) ? method.INT
                                                        : method.STRING));
                            }
                        }
                    }
                }

                // store Method in list of Methods
                methodRepo.put(method.getName(), method);
            }
        }
    }
View Full Code Here

                        else
                            break;
                    }

                    if (input.substring(j, j + 1).charAt(0) == '(') {
                        Method m = methodRepo.get(method.toString());
                        StringTokenizer st = new StringTokenizer(input
                                .substring(j, input.substring(j).indexOf(")")
                                        + j), "#\", ()");
                        while (st.hasMoreTokens()) {
                            String arg = st.nextToken();
                            m.addArg(null, arg);
                        }
                        String returnValue = m.execute().toString();
                        input = input.substring(0, i)
                                + returnValue
                                + input.substring(input.substring(i).indexOf(
                                        ")")
                                        + 1 + i);
View Full Code Here

            if (node.getNodeName().equals("method")) {
                NodeList children = node.getChildNodes();

                // create Method Object
                String methodName = ((Element) node).getAttribute("name");
                Method method = new Method(methodName);

                // loop through to fill Method Object
                for (int j = 0; j < children.getLength(); j++) {
                    Node child = children.item(j);

                    // get the Method's behavoir
                    if (child.getNodeName().equals("action")) {
                        method.setBehavoir(XMLUtils.getSimpleElementText(
                                (Element) child, false));

                        // get the Method's arguments
                    } else if (child.getNodeName().equals("args")) {
                        String name, argType = null;
                        NodeList grandChildren = child.getChildNodes();

                        // loop for every arg element
                        for (int k = 0; k < grandChildren.getLength(); k++) {
                            Node grandChild = grandChildren.item(k);

                            // parse arg element
                            if (grandChild.getNodeName().equals("arg")) {
                                name = ((Element) grandChild)
                                        .getAttribute("name");

                                // get arg element properties
                                NodeList greatGrandChildren = grandChild
                                        .getChildNodes();
                                for (int l = 0; l < greatGrandChildren
                                        .getLength(); l++) {
                                    Node greatGrandChild = greatGrandChildren
                                            .item(l);
                                    if (greatGrandChild.getNodeName().equals(
                                            "type")) {
                                        argType = XMLUtils.getSimpleElementText(
                                                (Element) greatGrandChild,
                                                true);
                                    }
                                }

                                // create argument signature in Method
                                method
                                        .addArgSignature(
                                                name,
                                                ((argType.toLowerCase()
                                                        .equals("int")) ? method.INT
                                                        : method.STRING));
                            }
                        }
                    }
                }

                // store Method in list of Methods
                methodRepo.put(method.getName(), method);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.pushpull.expressions.Method

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.