Java UIComponent.getValueExpression方法代码示例(javauicomponent.getvalueexpression方法的典型用法代码示例)

本文整理汇总了Java中javax.faces.component.UIComponent.getValueExpression方法的典型用法代码示例。如果您正苦于以下问题:Java UIComponent.getValueExpression方法的具体用法?Java UIComponent.getValueExpression怎么用?Java UIComponent.getValueExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.component.UIComponent的用法示例。


Java UIComponent.getValueExpression方法代码示例(javauicomponent.getvalueexpression方法的典型用法代码示例)

在下文中一共展示了UIComponent.getValueExpression方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAsObject

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
public Object getAsObject(FacesContext context, UIComponent component,
        String value) {

    if (value == null || component.getValueExpression("value") == null) {
        return null;
    }
    @SuppressWarnings("unchecked")
    Class<? extends Enum<?>> enumType = (Class<? extends Enum<?>>) component
            .getValueExpression("value").getType(context.getELContext());
    for (Enum<?> e : enumType.getEnumConstants()) {
        if (e.toString().equals(value)) {
            return e;
        }
    }
    return null;
} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:EnumConverter.java

示例2: _getMessage

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
private LabeledFacesMessage _getMessage(
 UIComponent component,
 String text)
{
  // Using the LabeledFacesMessage allows the <tr:messages> component to
  // properly prepend the label as a link.
  LabeledFacesMessage lfm =
    new LabeledFacesMessage(FacesMessage.SEVERITY_ERROR,
                            "Conversion Error", text);
  if (component != null)
  {
    Object label = null;
    label = component.getAttributes().get("label");
    if (label == null)
      label = component.getValueExpression("label");
    if (label != null)
      lfm.setLabel(label);
  }
  return lfm;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:21,代码来源:SSNConverter.java

示例3: _executeBindings

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
/**
 * Execute any "binding" attributes so that a popped view
 * is properly set up
 */
@SuppressWarnings("unchecked")
private void _executeBindings(FacesContext context, UIComponent component)
{
  ValueExpression expression = component.getValueExpression("binding");
  if (expression != null)
    expression.setValue(context.getELContext(), component);

  Iterator<UIComponent> kids = component.getFacetsAndChildren();
  while (kids.hasNext())
    _executeBindings(context, kids.next());
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:16,代码来源:DialogServiceImpl.java

示例4: _getLabel

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
private static Object _getLabel(UIComponent component)
{
  Object o = null;
  if (component != null)
  {
    o = component.getAttributes().get("label");
    if (o == null)
      o = component.getValueExpression("label");
  }
  return o;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:12,代码来源:PasswordValidator.java

示例5: _getLabel

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
private static Object _getLabel(UIComponent component)
{
  Object o = null;
  if (component != null)
  {
    o = component.getAttributes().get("label");
    if (o == null)
      o = component.getValueExpression ("label");
  }
  return o;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:12,代码来源:MessageFactory.java

示例6: _updateRowKeySetInPlace

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
private void _updateRowKeySetInPlace(UIComponent component, String attrName, RowKeySet newValue)
{
  ValueExpression oldExpression = component.getValueExpression(attrName);
  
  // due to bug in how the trinidad table and tree handle their RowKeySets, always use
  // invoke on component and get the old value in context all of the time for now rather
  // than trying to get the value directly if we don't have an expression
  //use EL to get the oldValue and then determine whether we need to update in place
  final FacesContext context = FacesContext.getCurrentInstance();
              
  context.getViewRoot().invokeOnComponent(
    context,
    _clientId,
    new GetOldValueAndUpdate(oldExpression, attrName, newValue));
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:16,代码来源:RowKeySetAttributeChange.java

示例7: getConverter

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
private Converter getConverter(FacesContext context, UIComponent component) {
	Converter converter = ((UIInput) component).getConverter();
	if (converter != null) {
		return converter;
	}
	ValueExpression exp = component.getValueExpression("value");
	if (exp == null) {
		return null;
	}
	Class valueType = exp.getType(context.getELContext());
	if (valueType == null) {
		return null;
	}
	return context.getApplication().createConverter(valueType);
} 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:16,代码来源:SketchPadRenderer.java

示例8: getConverter

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
static public Converter getConverter(
  UIComponent component)
{  
  FacesContext fContext = FacesContext.getCurrentInstance();

  Converter converter = null;
  Class<?> modelClass = null;
  
  ValueExpression expression = component.getValueExpression("value");
  if (expression != null)
  {
    modelClass = expression.getType(fContext.getELContext());
    if (modelClass == null)
    {
      Object o = expression.getValue(fContext.getELContext());
      if (o != null)
      {
        modelClass = o.getClass();
      }
    }
  }

  if ((modelClass != null) && 
      ( modelClass.isArray() ||  modelClass.isAssignableFrom(List.class)))
  {
      // get the itemClass in the case where modelClass is an array or List
      // for instance, in the case of selectManyListbox
      Class<?> itemClass = modelClass.getComponentType();
      if (itemClass != null)
      {
         converter = ConverterUtils.createConverter(fContext, itemClass);           
      }      
  }
  else
  {
    converter = ConverterUtils.createConverter(fContext, modelClass);
  }


  return converter;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:42,代码来源:SelectItemSupport.java

示例9: _typeConvertAndDefaultAttrs

import javax.faces.component.UIComponent; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private boolean _typeConvertAndDefaultAttrs(
  String regionType,
  ComponentMetaData cmd)
{
  boolean hasErrors = false;
  UIComponent region = getComponentInstance();
  Map<String, Object> compAttrs = region.getAttributes();
  List<AttributeMetaData> attrs = cmd.getAttributes();
  int sz = attrs.size();
  for(int i=0; i<sz; i++)
  {
    AttributeMetaData attr = attrs.get(i);
    String name = attr.getAttrName();
    Class<?> klass = attr.getAttrClass();
    if (region.getValueExpression(name) != null)
      continue;

    Object compValue = compAttrs.get(name);
    if (compValue == null)
    {
      // if attribute value was not specified then try to default it:
      String defaultValue = attr.getDefaultValue();
      if (defaultValue != null)
      {
        hasErrors |= _typeConvert(compAttrs, name, defaultValue, klass);
      }
      // if no default value was found then make sure the attribute was not
      // required:
      else if (attr.isRequired())
      {
        _LOG.severe("COMPONENTTYPE_MISSING_ATTRIBUTE", new Object[] {name, regionType});
        hasErrors = true;
      }
    }
    // if a value was specified see if it needs to be type converted:
    else if (compValue instanceof String)
    {
      hasErrors |= _typeConvert(compAttrs, name, (String) compValue, klass);
    }
  }
  return hasErrors;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:44,代码来源:ComponentRefTag.java

本文标签属性:

示例:示例英文

代码:代码编程

java:java自行车

UIComponent:UIComponent

getValueExpression:getValueExpression

上一篇:Java IllegalArgument类代码示例
下一篇:李娜传2022能上映吗上映了吗(李娜传讲什么的)

为您推荐