Package org.apache.myfaces.trinidad.bean

Examples of org.apache.myfaces.trinidad.bean.PropertyKey


    Object[] values = new Object[2 * size];
    int i = 0;
    for(Map.Entry<PropertyKey, Object> entry : map.entrySet())
    {
      PropertyKey key = entry.getKey();
      if (key.isTransient())
      {
        // TRINIDAD-1956: due to the view root caching functionality, the transient properties
        // may be retained too long. By removing the value here we can ensure that the next
        // request will not have the transient values.
        entry.setValue(null);
        continue;
      }

      Object value = entry.getValue();

      values[i] = saveKey(key);
      if (_LOG.isFinest())
      {
        _LOG.finest("SAVE {" + key + "=" + value + "}");
      }

      Object saveValue;

      if (useStateHolder)
        saveValue = saveStateHolder(context, value);
      else
        saveValue = key.saveValue(context, value);

      // aggressively check the serializability of the value
      if (_checkPropertyStateSerialization())
      {
        try
View Full Code Here


      Object savedKey = values[i * 2];
      if (savedKey == null)
        continue;

      Object savedValue = values[i * 2 + 1];
      PropertyKey key = restoreKey(type, savedKey);
      Object value;

      if (useStateHolder)
        value = restoreStateHolder(context, savedValue);
      else
        value = key.restoreValue(context, savedValue);

      if (_LOG.isFinest())
      {
        _LOG.finest("RESTORE {" + key + "=" + value + "}");
      }
View Full Code Here

  public Object get(Object key)
  {
    if (key == null)
      throw new NullPointerException();

    PropertyKey propertyKey = _getPropertyKey(key);
    // Support attribute transparency for list-based
    // properties
    if (propertyKey.isList())
    {
      Class<?> type = propertyKey.getType();
      if (type.isArray())
        type = type.getComponentType();

      return _bean.getEntries(propertyKey, type);
    }
    else
    {
      Object val = _bean.getProperty(propertyKey);
      return (val != null) ? val : propertyKey.getDefault();
    }
  }
View Full Code Here

 
  // TODO Should remove just remove values, or also remove bindings?
  @Override
  public Object remove(Object key)
  {
    PropertyKey propertyKey = _getPropertyKey(key);
    Object oldValue = _bean.getProperty(propertyKey);
    _bean.setProperty(propertyKey, null);

    return oldValue;
  }
View Full Code Here

  public boolean containsKey(Object key)
  {
    if (key == null)
      throw new NullPointerException();

    PropertyKey propertyKey = _getPropertyKey(key);
   
    if (_bean.keySet().contains(propertyKey))
      return true;
    else
      return _bean.bindingKeySet().contains(propertyKey);   
View Full Code Here

  private PropertyKey _getPropertyKey(Object key)
  {
    if (key instanceof String)
    {
      String keyString = (String) key;
      PropertyKey propertyKey = _bean.getType().findKey(keyString);
      if (propertyKey == null)
        propertyKey = PropertyKey.getDefaultPropertyKey(keyString);
     
      return propertyKey;
    }
View Full Code Here

      _deltas.put((PropertyKey) key, null);
    }
   
    if (key instanceof PropertyKey)
    {
      PropertyKey propKey  = (PropertyKey)key;
      if (propKey.isPartialStateHolder())
      {
        _getPartialStateHolderTracker(true).removeProperty(propKey);
      }
    }
View Full Code Here

      _deltas.put((PropertyKey) key, null);
    }
   
    if (key instanceof PropertyKey)
    {
      PropertyKey propKey  = (PropertyKey)key;
      if (propKey.isPartialStateHolder())
      {
        _getPartialStateHolderTracker(true).removeProperty(propKey);
      }
    }
View Full Code Here

{
  @Override
  public boolean containsKey(
    Object key)
  {
    PropertyKey pKey = (PropertyKey) key;
    int index = pKey.getIndex();

    if (index >= 0 && index < 64)
    {
      // if we don't have the property, don't search the map
      return ((_flags & (1L << index)) == 0);
View Full Code Here

  @Override
  public Object get(
    Object key)
  {
    PropertyKey pKey = (PropertyKey) key;
    int index = pKey.getIndex();

    if (index >= 0 && index < 64)
    {
      // if we don't have the property, don't search the map
      if ((_flags & (1L << index)) == 0)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.bean.PropertyKey

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.