Exemplo n.º 1
0
 public Packet fromHttpRequest(javax.servlet.http.HttpServletRequest argRequest, String argId) {
   org.apache.commons.lang3.Validate.notNull(argRequest);
   String lclIdString = argRequest.getParameter(argId);
   if (org.apache.commons.lang3.StringUtils.isBlank(lclIdString)) {
     return null;
   }
   java.lang.Integer lclId = java.lang.Integer.valueOf(lclIdString);
   return forId(lclId);
 }
Exemplo n.º 2
0
 public <T extends java.util.Collection<? super Packet>> T acquireFromHttpRequest(
     T argCollection, javax.servlet.http.HttpServletRequest argRequest, String argParameterName) {
   org.apache.commons.lang3.Validate.notNull(argCollection);
   org.apache.commons.lang3.Validate.notNull(argRequest);
   org.apache.commons.lang3.Validate.notEmpty(argParameterName);
   String[] lclValues = argRequest.getParameterValues(argParameterName);
   if (lclValues == null || lclValues.length == 0) {
     return argCollection;
   }
   for (String lclValueUntrimmed : lclValues) {
     String lclValue = org.apache.commons.lang3.StringUtils.trimToNull(lclValueUntrimmed);
     if (lclValue == null) {
       continue;
     }
     java.lang.Integer lclId = java.lang.Integer.valueOf(lclValue);
     Packet lclResult = forId(lclId);
     org.apache.commons.lang3.Validate.notNull(
         lclResult, "'" + lclValue + "' is not a valid Id for any Packet");
     argCollection.add(lclResult);
   }
   return argCollection;
 }
Exemplo n.º 3
0
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
    javax.faces.component.UIPanel panel = null;
    try {
      panel = (javax.faces.component.UIPanel) component;
    } catch (ClassCastException cce) {
      throw new IllegalStateException(
          "Component "
              + component.toString()
              + " not expected type.  Expected: javax.faces.component.UIPanel.  Perhaps you're missing a tag?");
    }

    if (bgcolor != null) {
      if (!bgcolor.isLiteralText()) {
        panel.setValueExpression("bgcolor", bgcolor);
      } else {
        panel.getAttributes().put("bgcolor", bgcolor.getExpressionString());
      }
    }
    if (border != null) {
      if (!border.isLiteralText()) {
        panel.setValueExpression("border", border);
      } else {
        panel
            .getAttributes()
            .put("border", java.lang.Integer.valueOf(border.getExpressionString()));
      }
    }
    if (columnClasses != null) {
      if (!columnClasses.isLiteralText()) {
        panel.setValueExpression("columnClasses", columnClasses);
      } else {
        panel.getAttributes().put("columnClasses", columnClasses.getExpressionString());
      }
    }
    if (columns != null) {
      if (!columns.isLiteralText()) {
        panel.setValueExpression("columns", columns);
      } else {
        panel
            .getAttributes()
            .put("columns", java.lang.Integer.valueOf(columns.getExpressionString()));
      }
    }
    if (onclick != null) {
      if (!onclick.isLiteralText()) {
        panel.setValueExpression("onclick", onclick);
      } else {
        panel.getAttributes().put("onclick", onclick.getExpressionString());
      }
    }
    if (ondblclick != null) {
      if (!ondblclick.isLiteralText()) {
        panel.setValueExpression("ondblclick", ondblclick);
      } else {
        panel.getAttributes().put("ondblclick", ondblclick.getExpressionString());
      }
    }
    if (onkeydown != null) {
      if (!onkeydown.isLiteralText()) {
        panel.setValueExpression("onkeydown", onkeydown);
      } else {
        panel.getAttributes().put("onkeydown", onkeydown.getExpressionString());
      }
    }
    if (onkeypress != null) {
      if (!onkeypress.isLiteralText()) {
        panel.setValueExpression("onkeypress", onkeypress);
      } else {
        panel.getAttributes().put("onkeypress", onkeypress.getExpressionString());
      }
    }
    if (onkeyup != null) {
      if (!onkeyup.isLiteralText()) {
        panel.setValueExpression("onkeyup", onkeyup);
      } else {
        panel.getAttributes().put("onkeyup", onkeyup.getExpressionString());
      }
    }
    if (onmousedown != null) {
      if (!onmousedown.isLiteralText()) {
        panel.setValueExpression("onmousedown", onmousedown);
      } else {
        panel.getAttributes().put("onmousedown", onmousedown.getExpressionString());
      }
    }
    if (onmousemove != null) {
      if (!onmousemove.isLiteralText()) {
        panel.setValueExpression("onmousemove", onmousemove);
      } else {
        panel.getAttributes().put("onmousemove", onmousemove.getExpressionString());
      }
    }
    if (onmouseout != null) {
      if (!onmouseout.isLiteralText()) {
        panel.setValueExpression("onmouseout", onmouseout);
      } else {
        panel.getAttributes().put("onmouseout", onmouseout.getExpressionString());
      }
    }
    if (onmouseover != null) {
      if (!onmouseover.isLiteralText()) {
        panel.setValueExpression("onmouseover", onmouseover);
      } else {
        panel.getAttributes().put("onmouseover", onmouseover.getExpressionString());
      }
    }
    if (onmouseup != null) {
      if (!onmouseup.isLiteralText()) {
        panel.setValueExpression("onmouseup", onmouseup);
      } else {
        panel.getAttributes().put("onmouseup", onmouseup.getExpressionString());
      }
    }
    if (rowClasses != null) {
      if (!rowClasses.isLiteralText()) {
        panel.setValueExpression("rowClasses", rowClasses);
      } else {
        panel.getAttributes().put("rowClasses", rowClasses.getExpressionString());
      }
    }
    if (style != null) {
      if (!style.isLiteralText()) {
        panel.setValueExpression("style", style);
      } else {
        panel.getAttributes().put("style", style.getExpressionString());
      }
    }
    if (styleClass != null) {
      if (!styleClass.isLiteralText()) {
        panel.setValueExpression("styleClass", styleClass);
      } else {
        panel.getAttributes().put("styleClass", styleClass.getExpressionString());
      }
    }
  }
Exemplo n.º 4
0
 @Override
 public Object getAsObject(FacesContext context, UIComponent ui, String value) {
   Address address = new Address();
   address.setAddressid(java.lang.Integer.valueOf(value));
   return address;
 }
 public TeamQuestionOpal setQuestionId(final int argQuestionId) {
   setQuestionId(java.lang.Integer.valueOf(argQuestionId));
   return this;
 }