Package org.eclipse.jst.javaee.core

Examples of org.eclipse.jst.javaee.core.ParamValue


     * @param paramName
     */
    public static void removeContextParam(final WebApp webApp, String paramName) {
        Iterator it = webApp.getContextParams().iterator();
        while (it.hasNext()) {
            ParamValue cp = (ParamValue) it.next();
            if (cp.getParamName().equals(paramName)) {
                webApp.getContextParams().remove(cp);
                break;
            }
        }
    }
View Full Code Here


   * @param paramName
   * @param paramValue
   */
  public static void setupContextParam(final WebApp webApp, String paramName, String paramValue) {
    // if not default name and location, then add context param
    ParamValue foundCP = null;
    ParamValue cp = null;
    boolean found = false;
    // check to see if present
    Iterator it = webApp.getContextParams().iterator();
    while (it.hasNext()) {
      cp = (org.eclipse.jst.javaee.core.ParamValue) it.next();
      if (cp != null &&
          cp.getParamName()!= null &&
          cp.getParamName().trim().equals(paramName)) {
        foundCP = cp;
        found = true;
      }
    }
    if (!found) {
      ParamValue pv = JavaeeFactory.eINSTANCE.createParamValue();
      pv.setParamName(paramName);
      pv.setParamValue(paramValue);
      webApp.getContextParams().add(pv);
    } else {
      cp = foundCP;
      if (cp.getParamValue().indexOf(paramValue) < 0) {
        String curVal = cp.getParamValue();
View Full Code Here

     */
    public static String getContextParam(final WebApp webApp, String paramName)
    {
        for (Iterator it = webApp.getContextParams().iterator(); it.hasNext();)
        {
            ParamValue cp = (ParamValue) it.next();
      if (cp != null &&
          cp.getParamName()!= null &&
          cp.getParamName().trim().equals(paramName)) {
        return cp.getParamValue();
            }
        }
        return null;
    }
View Full Code Here

     * @param paramName
     */
    public static void removeContextParam(final WebApp webApp, String paramName) {
        Iterator it = webApp.getContextParams().iterator();
        while (it.hasNext()) {
            ParamValue cp = (ParamValue) it.next();
            if (cp.getParamName().equals(paramName)) {
                webApp.getContextParams().remove(cp);
                break;
            }
        }
    }
View Full Code Here

   * @param paramName
   * @param paramValue
   */
  public static void setupContextParam(final WebApp webApp, String paramName, String paramValue) {
    // if not default name and location, then add context param
    ParamValue foundCP = null;
    ParamValue cp = null;
    boolean found = false;
    // check to see if present
    Iterator it = webApp.getContextParams().iterator();
    while (it.hasNext()) {
      cp = (org.eclipse.jst.javaee.core.ParamValue) it.next();
      if (cp != null &&
          cp.getParamName()!= null &&
          cp.getParamName().trim().equals(paramName)) {
        foundCP = cp;
        found = true;
      }
    }
    if (!found) {
      ParamValue pv = JavaeeFactory.eINSTANCE.createParamValue();
      pv.setParamName(paramName);
      pv.setParamValue(paramValue);
      webApp.getContextParams().add(pv);
    } else {
      cp = foundCP;
      if (cp.getParamValue().indexOf(paramValue) < 0) {
        String curVal = cp.getParamValue();
View Full Code Here

     */
    public static String getContextParam(final WebApp webApp, String paramName)
    {
        for (Iterator it = webApp.getContextParams().iterator(); it.hasNext();)
        {
            ParamValue cp = (ParamValue) it.next();
      if (cp != null &&
          cp.getParamName()!= null &&
          cp.getParamName().trim().equals(paramName)) {
        return cp.getParamValue();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.javaee.core.ParamValue

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.