當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueExpression.isLiteralText方法代碼示例

本文整理匯總了Java中javax.el.ValueExpression.isLiteralText方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueExpression.isLiteralText方法的具體用法?Java ValueExpression.isLiteralText怎麽用?Java ValueExpression.isLiteralText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.el.ValueExpression的用法示例。


在下文中一共展示了ValueExpression.isLiteralText方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
protected void setProperty(
  FacesBean   bean,
  PropertyKey key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    bean.setProperty(key, expression.getValue(FacesContext.getCurrentInstance().getELContext()));
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:18,代碼來源:UIXComponentELTag.java

示例2: setStringArrayProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.lang.String[].  If the value
 * is an EL expression, it will be stored as a ValueExpression.
 * Otherwise, it will parsed as a whitespace-separated series
 * of strings.
 * Null values are ignored.
 */
protected void setStringArrayProperty(
  FacesBean       bean,
  PropertyKey     key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    bean.setProperty(key, TagUtils.parseNameTokens(
      expression.getValue(FacesContext.getCurrentInstance().getELContext())));
  }
  else
  {
    // Support coercion from a string to a string array
    expression = new StringArrayValueExpression(expression);
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:28,代碼來源:UIXComponentELTag.java

示例3: setStringListProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.util.List<java.lang.String>.  If the value
 * is an EL expression, it will be stored as a ValueExpression.
 * Otherwise, it will parsed as a whitespace-separated series
 * of strings.
 * Null values are ignored.
 */
protected void setStringListProperty(
  FacesBean       bean,
  PropertyKey     key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    bean.setProperty(key, TagUtils.parseNameTokensAsList(
      expression.getValue(FacesContext.getCurrentInstance().getELContext())));
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:26,代碼來源:UIXComponentELTag.java

示例4: setStringSetProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.util.Set<java.lang.String>.  If the value
 * is an EL expression, it will be stored as a ValueExpression.
 * Otherwise, it will parsed as a whitespace-separated series
 * of strings.
 * Null values are ignored.
 */
protected void setStringSetProperty(
  FacesBean       bean,
  PropertyKey     key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    bean.setProperty(key, TagUtils.parseNameTokensAsSet(
      expression.getValue(FacesContext.getCurrentInstance().getELContext())));
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:26,代碼來源:UIXComponentELTag.java

示例5: setDateProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.util.Date.  If the value
 * is an EL expression, it will be stored as a ValueExpression.
 * Otherwise, it will parsed as an ISO 8601 date (yyyy-MM-dd).
 * Null values are ignored.
 */
protected void setDateProperty(
  FacesBean   bean,
  PropertyKey key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    bean.setProperty(key, _parseISODate(
      expression.getValue(FacesContext.getCurrentInstance().getELContext())));
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:25,代碼來源:UIXComponentELTag.java

示例6: setValueExpression

import javax.el.ValueExpression; //導入方法依賴的package包/類
@Override
public void setValueExpression(String name,
                               ValueExpression expression)
{
  if (name == null)
    throw new NullPointerException();

  if ((expression != null) && expression.isLiteralText())
  {
    ELContext context =
        FacesContext.getCurrentInstance().getELContext();
    getAttributes().put(name, expression.getValue(context));
  }
  else
  {
    PropertyKey key = getPropertyKey(name);
    getFacesBean().setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:20,代碼來源:UIXComponentBase.java

示例7: setValue

import javax.el.ValueExpression; //導入方法依賴的package包/類
public void setValue(ValueExpression value)
{
  if (value.isLiteralText())
    setProperty(VALUE_KEY, value.getValue(FacesContext.getCurrentInstance().getELContext()));
  else
    setValueExpression(VALUE_KEY, value);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:8,代碼來源:ReturnActionListener.java

示例8: setItems

import javax.el.ValueExpression; //導入方法依賴的package包/類
public void setItems(ValueExpression items)
{
  if (items.isLiteralText())
    throw new IllegalArgumentException(_LOG.getMessage(
      "MUST_BE_SIMPLE_JSF_EL_EXPRESSION"));
  _items = items;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:8,代碼來源:ForEachTag.java

示例9: setNumberProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.lang.Number.  If the value
 * is an EL expression, it will be stored as a ValueBinding.
 * Otherwise, it will parsed with Integer.valueOf() or Double.valueOf() .
 * Null values are ignored.
 */
protected void setNumberProperty(
  FacesBean   bean,
  PropertyKey key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    Object value = expression.getValue(FacesContext.getCurrentInstance().getELContext());
    if (value != null)
    {
      if (value instanceof Number)
      {
        bean.setProperty(key, value);
      }
      else
      {
        String valueStr = value.toString();
        if(valueStr.indexOf('.') == -1)
          bean.setProperty(key, Integer.valueOf(valueStr));
        else
          bean.setProperty(key, Double.valueOf(valueStr));
      }
    }
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:39,代碼來源:UIXComponentELTag.java

示例10: setMaxDateProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type java.util.Date.  If the value
 * is an EL expression, it will be stored as a ValueBinding.
 * Otherwise, it will parsed as an ISO 8601 date (yyyy-MM-dd)
 * and the time components (hour, min, second, millisecond) maximized.
 * Null values are ignored.
 */
  protected void setMaxDateProperty(
  FacesBean   bean,
  PropertyKey key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    Date d = _parseISODate(expression.getValue(FacesContext.getCurrentInstance().getELContext()));
    Calendar c = Calendar.getInstance();
    TimeZone tz = RequestContext.getCurrentInstance().getTimeZone();
    if (tz != null)
      c.setTimeZone(tz);
    c.setTime(d);
    // Original value had 00:00:00 for hours,mins, seconds now maximize those
    // to get the latest time value for the date supplied.
    c.set (Calendar.HOUR_OF_DAY, 23);
    c.set (Calendar.MINUTE, 59);
    c.set (Calendar.SECOND, 59);
    c.set (Calendar.MILLISECOND, 999);
    bean.setProperty(key, c.getTime());
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:37,代碼來源:UIXComponentELTag.java

示例11: setIntArrayProperty

import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
 * Set a property of type int[].  If the value
 * is an EL expression, it will be stored as a ValueExpression.
 * Otherwise, it will parsed as a whitespace-separated series
 * of ints.
 * Null values are ignored.
 */
protected void setIntArrayProperty(
  FacesBean   bean,
  PropertyKey key,
  ValueExpression expression)
{
  if (expression == null)
    return;

  if (expression.isLiteralText())
  {
    Object value = expression.getValue(FacesContext.getCurrentInstance().getELContext());
    if (value != null)
    {
      String[] strings = TagUtils.parseNameTokens(value);
      final int[] ints;
      if (strings != null)
      {
        try
        {
          ints = new int[strings.length];
          for(int i=0; i<strings.length; i++)
          {
            int j = Integer.parseInt(strings[i]);
            ints[i] = j;
          }
        }
        catch (NumberFormatException e)
        {
          _LOG.severe("CANNOT_CONVERT_INTO_INT_ARRAY",value);
          _LOG.severe(e);
          return;
        }
      }
    }
  }
  else
  {
    bean.setValueExpression(key, expression);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:48,代碼來源:UIXComponentELTag.java


注:本文中的javax.el.ValueExpression.isLiteralText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。