Ejemplo n.º 1
0
 /**
  * Is this action input parameter required.
  *
  * @return true if required
  */
 public boolean isRequired() {
   boolean ret;
   if (isRequestBody()) {
     ret = requestBody.required();
   } else if (isRequestParam()) {
     ret = !(isDefined(requestParam.defaultValue()) || !requestParam.required());
   } else if (isRequestHeader()) {
     ret = !(isDefined(requestHeader.defaultValue()) || !requestHeader.required());
   } else {
     ret = true;
   }
   return ret;
 }
Ejemplo n.º 2
0
 /**
  * Determines default value of request param or request header, if available.
  *
  * @return value or null
  */
 public String getDefaultValue() {
   String ret;
   if (isRequestParam()) {
     ret = isDefined(requestParam.defaultValue()) ? requestParam.defaultValue() : null;
   } else if (isRequestHeader()) {
     ret =
         !(ValueConstants.DEFAULT_NONE.equals(requestHeader.defaultValue()))
             ? requestHeader.defaultValue()
             : null;
   } else {
     ret = null;
   }
   return ret;
 }
Ejemplo n.º 3
0
 @Override
 public String getRequestHeaderName() {
   return isRequestHeader() ? requestHeader.value() : null;
 }