Examples of FormalParameter


Examples of com.google.gxp.compiler.base.FormalParameter

      TemplateName.FullyQualified name = createRootName(node);
      ContentType contentType = createContentType(node, DEFAULT_CONTENT_TYPE);

      // add a "this" parameter to the list of Parameters
      List<Parameter> parameters = Lists.newArrayList(nodeParts.getParameters());
      FormalParameter formal = new FormalParameter(node.getSourcePosition(),
                                                   Implementable.INSTANCE_PARAM_NAME,
                                                   Implementable.INSTANCE_PARAM_NAME,
                                                   new TemplateType(node.getSourcePosition(),
                                                                    name.toString(), name));
      parameters.add(new Parameter(formal));
View Full Code Here

Examples of com.google.gxp.compiler.base.FormalParameter

      if (!comment.hasStaticString()) {
        alertSink.add(new RequiresStaticContentError(node));
        comment = new StringConstant(node, null, "");
      }
      if (name != null) {
        FormalParameter formal = new FormalParameter(node, name, consumesContent, type,
                                                     defaultValue, hasDefaultFlag, regex,
                                                     constructor, hasConstructorFlag,
                                                     spaceOperators);
        output.accumulate(new Parameter(formal, javaAnnotations, defaultValue, hasDefaultFlag,
                                        constructor, hasConstructorFlag, comment));
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

     * @throws Exception
     *         Test failed.
     */
    public void testInvokeString() throws Exception {
        FormalParameter[] fps = new FormalParameter[5];
        fps[0] = new FormalParameter("JndiName", "0", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[1] = new FormalParameter("HomeClass", "1", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[2] = new FormalParameter("Method", "2", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[3] = new FormalParameter("Name", "3", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[4] = new FormalParameter("Result", "3", FormalParameter.Mode.OUT,
                FP_TYPE_STRING);
       
        Map act = new java.util.HashMap();
        act.put(fps[0].id(), "java:ejb/WfMOpenTestEJB");
        act.put(fps[1].id(), TestHome.class.getName());
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

     * @throws Exception
     *         Test failed.
     */
    public void testInvokeLong() throws Exception {
        FormalParameter[] fps = new FormalParameter[6];
        fps[0] = new FormalParameter("JndiName", "0", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[1] = new FormalParameter("HomeClass", "1", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[2] = new FormalParameter("Method", "2", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[3] = new FormalParameter("Num1", "3", FormalParameter.Mode.IN,
                FP_TYPE_INT);
        fps[4] = new FormalParameter("Num2", "4", FormalParameter.Mode.IN,
                FP_TYPE_INT);
        fps[5] = new FormalParameter("Result", "5", FormalParameter.Mode.OUT,
                FP_TYPE_INT);
       
        Map act = new java.util.HashMap();
        act.put(fps[0].id(), "java:ejb/WfMOpenTestEJB");
        act.put(fps[1].id(), TestHome.class.getName());
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

     * @throws Exception
     *         Test failed.
     */
    public void testInvokeDouble() throws Exception {
        FormalParameter[] fps = new FormalParameter[5];
        fps[0] = new FormalParameter("JndiName", "0", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[1] = new FormalParameter("HomeClass", "1", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[2] = new FormalParameter("Method", "2", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[3] = new FormalParameter("Value", "3", FormalParameter.Mode.IN,
                FP_TYPE_FLOAT);
        fps[4] = new FormalParameter("Result", "4", FormalParameter.Mode.OUT,
                FP_TYPE_INT);
       
        Map act = new java.util.HashMap();
        act.put(fps[0].id(), "java:ejb/WfMOpenTestEJB");
        act.put(fps[1].id(), TestHome.class.getName());
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

     * @throws Exception
     *         Test failed.
     */
    public void testInvokeXml() throws Exception {
        FormalParameter[] fps = new FormalParameter[5];
        fps[0] = new FormalParameter("JndiName", "0", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[1] = new FormalParameter("HomeClass", "1", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[2] = new FormalParameter("Method", "2", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[3] = new FormalParameter("Value", "3", FormalParameter.Mode.IN,
                FP_TYPE_SCHEMA_SAX);
        fps[4] = new FormalParameter("Result", "4", FormalParameter.Mode.OUT,
                FP_TYPE_INT);
       
        SAXEventBufferImpl sax = new SAXEventBufferImpl();
        sax.startDocument();
        AttributesImpl attrs = new AttributesImpl();
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

     * @throws Exception
     *         Test failed.
     */
    public void testInvokeBoolean() throws Exception {
        FormalParameter[] fps = new FormalParameter[5];
        fps[0] = new FormalParameter("JndiName", "0", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[1] = new FormalParameter("HomeClass", "1", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[2] = new FormalParameter("Method", "2", FormalParameter.Mode.IN,
                FP_TYPE_STRING);
        fps[3] = new FormalParameter("Value", "3", FormalParameter.Mode.IN,
                FP_TYPE_BOOL);
        fps[4] = new FormalParameter("Result", "4", FormalParameter.Mode.OUT,
                FP_TYPE_STRING);
       
        Map act = new java.util.HashMap();
        act.put(fps[0].id(), "java:ejb/WfMOpenTestEJB");
        act.put(fps[1].id(), TestHome.class.getName());
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

                Document doc = DocumentBuilderFactory.newInstance()
                    .newDocumentBuilder().newDocument();
                instance = doc.createElementNS("", "ActualParameters");
                instance.setAttributeNS(XMLUtil.XMLNS_NS, "xmlns", "");
                for (int i = 0; i < formalParameters.length; i++) {
                    FormalParameter fp = formalParameters[i];
                    Element param = doc.createElementNS("", "ActualParameter");
                    param.setAttribute("name", fp.id());
                    Object value = actualParameters.get(fp.id());
                    if (value == null) {
                        // do nothing
                    } else if (value instanceof SAXEventBuffer) {
                        appendActualParameter(param, (SAXEventBuffer)value);
                    } else {
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

            try {
                Document doc = DocumentBuilderFactory.newInstance()
                    .newDocumentBuilder().newDocument();
                binds = doc.createDocumentFragment();
                for (int i = 0; i < formalParameters.length; i++) {
                    FormalParameter fp = formalParameters[i];
                    Element binding
                        = doc.createElementNS(XMLUtil.XMLNS_XFORMS, "bind");
                    binding.setAttribute("id", applicationId + ":" + fp.id());
                    binding.setAttribute
                        ("nodeset", "ActualParameter[@name='" + fp.id() + "']");
                    if (fp.mode() == FormalParameter.Mode.IN) {
                        binding.setAttribute ("readonly", "true()");
                    }
                    if (fp.type().equals(Date.class)) {
                        binding.setAttribute ("type", "date");
                    }
                    binds.appendChild(binding);
                }
            } catch (ParserConfigurationException e) {
View Full Code Here

Examples of de.danet.an.workflow.api.FormalParameter

                || !((Element)child).getNodeName().equals("ActualParameter")) {
                continue;
            }
            Element param = (Element)child;
            String name = param.getAttribute("name");
            FormalParameter fp = null;
            for (int i = 0; i < formalParameters.length; i++) {
                if (formalParameters[i].id().equals(name)) {
                    fp = formalParameters[i];
                    break;
                }
            }
            if (fp == null || fp.mode().equals(FormalParameter.Mode.IN)) {
                continue;
            }
            if (XPDLUtil.isXMLType(fp.type())) {
                SAXEventBufferImpl saxVal = new SAXEventBufferImpl();
                try {
                    Transformer t
                        = SAXTransformerFactory.newInstance().newTransformer();
                    t.transform(new DOMSource(param),
                                new SAXResult(new ChildrenOnlyFiler(saxVal)));
                } catch (TransformerConfigurationException e) {
                    logger.error(e.getMessage(), e);
                } catch (TransformerFactoryConfigurationError e) {
                    logger.error(e.getMessage(), e);
                } catch (TransformerException e) {
                    logger.error(e.getMessage(), e);
                }
                res.put(fp.id(), saxVal);
            } else {
                StringBuffer content = new StringBuffer();
                for (Node pChild = param.getFirstChild(); pChild != null;
                     pChild = pChild.getNextSibling()) {
                    if (pChild.getNodeType() == Node.TEXT_NODE
                        || pChild.getNodeType() == Node.CDATA_SECTION_NODE) {
                        content.append(pChild.getNodeValue());
                    }
                }
                if (fp.type().equals(String.class)) {
                    res.put(fp.id(), content.toString());
                } else if (fp.type().equals(Boolean.class)) {
                    res.put(fp.id(), (new Boolean(content.toString())));
                } else if (fp.type().equals(Long.class)) {
                    res.put(fp.id(), Long.valueOf(content.toString()));
                } else if (fp.type().equals(Double.class)) {
                    res.put(fp.id(), Double.valueOf(content.toString()));
                } else if (fp.type().equals(Date.class)) {
                    // Convert date to datetime
                    if (content.indexOf("T") < 0) {
                        content.append("T00:00:00");
                    }
                    try {
                        res.put (fp.id(),
                                 XMLUtil.parseXsdDateTime(content.toString()));
                    } catch (ParseException e) {
                        logger.error ("Cannot parse XSD datetime: "
                                      + content.toString());
                    }
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.