Package org.xdams.utility.reflection

Examples of org.xdams.utility.reflection.ReflectionUtil


    }
    return list;
  }

  public boolean controlla(Element element, Map<String, String> filters) {
    ReflectionUtil reflectionUtil = new ReflectionUtil();
    boolean ritorno = true;
    for (Entry<String, String> entrySet : filters.entrySet()) {
      // System.out.println("MappingAdv.controlla() " + entrySet.getKey());
      // System.out.println("MappingAdv.controlla() " + entrySet.getValue());
      try {
        Object object = reflectionUtil.invokeMethod(element, "get" + StringUtils.capitalize(entrySet.getKey()));
        if (!entrySet.getValue().equals(object)) {
          // System.out.println("MappingAdv.controlla() VALUEEEE " + object);
          ritorno = false;
        }
      } catch (Exception e) {
View Full Code Here


          }

        }

        if (isVisible.equals("true")) {
          ReflectionUtil reflectionUtil = new ReflectionUtil();
          if (contaAnchor == 1) {

            for (int j = 0; j < contaAnchor; j++) {
              String anchor = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/@value");
              int contaParamAnchor = builderManaging.contaNodi("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/paramAnchor");
              String interrogativo = "?";
              if (anchor.indexOf("#") != -1 || contaParamAnchor == 0) {
                interrogativo = "";
              }
              if (ExpressionEvaluationUtils.isExpressionLanguage(anchor)) {
                anchor = ExpressionEvaluationUtils.evaluateString(anchor, anchor, pageContext);
              }
              anchorTxt += "href=\"" + anchor + interrogativo;
              for (int k = 0; k < contaParamAnchor; k++) {
                String paramNameAnchor = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/paramAnchor[" + (k + 1) + "]/@name");
                String javaBean = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/paramAnchor[" + (k + 1) + "]/@javaBean");
                String paramValue = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/paramAnchor[" + (k + 1) + "]/@paramValue");
                String methodBean = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/paramAnchor[" + (k + 1) + "]/text()");
                int paramValueNum = paramValue.split(",").length;
                Object[] methodParam = null;
                Object methodValue = null;
                if (!paramValue.equals("") && paramValueNum > 0) {
                  // System.out.println("MenuGestioneJstl.doStartTag() MAGGIORE DI ZEROOOOOOOOOO paramValueNum " + paramValueNum);
                  // System.out.println("MenuGestioneJstl.doStartTag() MAGGIORE DI ZEROOOOOOOOOO paramValue " + paramValue);
                  methodParam = new Object[paramValueNum];
                  for (int index = 0; index < paramValueNum; index++) {
                    // System.out.println("MenuGestioneJstl.doStartTag() paramValue.split(\",\")[index] " + paramValue.split(",")[index]);
                    methodParam[index] = paramValue.split(",")[index];// getObjectFromString("java.lang.String", paramValue.split(",")[index]);
                    // System.out.println("MenuGestioneJstl.doStartTag() methodParam " + methodParam);
                  }
                }
                // methodParam = null;

                if (!javaBean.equals("")) {
                  Class c = null;
                  if (javaBean.toUpperCase().equals("VIEWBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(viewBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("CONFBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(confBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("USERBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(userBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("EDITINGBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(editingBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("WORKFLOWBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(workFlowBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("REQUEST")) {
                    methodValue = request.getParameter(methodBean);
                  }
                } else {
                  methodValue = methodBean;
                }
                String endCom = "&amp;";
                if (k == contaParamAnchor - 1) {
                  endCom = "";
                }
                anchorTxt += paramNameAnchor + "=" + methodValue + endCom;
                System.out.println("MenuGestioneJstl.doStartTag()anchorTxt anchorTxt " + anchorTxt);
                if (anchorTxt.endsWith("?")) {
                  System.out.println("MenuGestioneJstl.doStartTag()AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
                  anchorTxt = anchorTxt.substring(0, anchorTxt.length() - 1);

                }

              }
              anchorTxt += "\"";
              String target = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/anchor[" + (j + 1) + "]/@target");
              if (!target.equals("")) {
                targetTxt = "target=\"" + ExpressionEvaluationUtils.evaluateString(target, target, pageContext) + "\"";
              }

            }
          } else if (contaAnchor == 0 && contaEventJavaScript > 0) {
            anchorTxt = "href=\"javascript:void(0)\"";
          } else {
            throw new Error("Qualcosa e andato storto. Anchor maggiore di uno");
          }

          // out.println("contaEventJavaScript " + contaEventJavaScript);
          for (int j = 0; j < contaEventJavaScript; j++) {
            String eventJavaScript = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/@value");
            // out.println("eventJavaScripty " + eventJavaScript);
            eventJavaScript += "=\"";
            int contaFunctionName = builderManaging.contaNodi("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName");
            for (int k = 0; k < contaFunctionName; k++) {
              String functionName = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/@value");
              // out.println("functionName " + functionName);
              eventJavaScript += functionName + "(";
              int contaParamFunction = builderManaging.contaNodi("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/paramFunction");
              for (int index = 0; index < contaParamFunction; index++) {
                String javaBean = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/paramFunction[" + (index + 1) + "]/@javaBean");
                String methodBean = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/paramFunction[" + (index + 1) + "]/text()");
                String paramValue = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/paramFunction[" + (index + 1) + "]/@paramValue");
                String escapeSingleApex = builderManaging.valoreNodo("/root/managing/user/element[" + (i + 1) + "]/eventJavaScript[" + (j + 1) + "]/functionName[" + (k + 1) + "]/paramFunction[" + (index + 1) + "]/@escapeSingleApex");
                // System.out.println("MenuGestioneJstl.doStartTag() MAGGIORE DI ZEROOOOOOOOOO paramValue " + paramValue);
                int paramValueNum = paramValue.split(",").length;
                Object[] methodParam = null;
                Object methodValue = null;
                if (!paramValue.equals("") && paramValueNum > 0) {
                  // System.out.println("MenuGestioneJstl.doStartTag() MAGGIORE DI ZEROOOOOOOOOO paramValueNum " + paramValueNum);

                  methodParam = new Object[paramValueNum];
                  for (int indexHref = 0; indexHref < paramValueNum; indexHref++) {
                    // System.out.println("MenuGestioneJstl.doStartTag() paramValue.split(\",\")[indexHref] " + paramValue.split(",")[indexHref]);
                    methodParam[indexHref] = paramValue.split(",")[indexHref];// getObjectFromString("java.lang.String", paramValue.split(",")[indexHref]);
                    // System.out.println("MenuGestioneJstl.doStartTag() methodParam " + methodParam);
                  }
                }
                Class c = null;

                if (!javaBean.equals("")) {
                  if (javaBean.toUpperCase().equals("VIEWBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(viewBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("CONFBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(confBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("USERBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(userBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("EDITINGBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(editingBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("WORKFLOWBEAN")) {
                    methodValue = reflectionUtil.invokeMethod(workFlowBean, methodBean, methodParam);
                  } else if (javaBean.toUpperCase().equals("REQUEST")) {
                    methodValue = request.getParameter(methodBean);
                  }
                  if (escapeSingleApex.equals("true")) {
                    methodValue = "" + methodValue + "";
View Full Code Here

TOP

Related Classes of org.xdams.utility.reflection.ReflectionUtil

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.