Example #1
0
  /**
   * Returns an property source for the given object.
   *
   * @param object an object for which to obtain a property source or <code>null</code> if a
   *     property source is not available
   * @return an property source for the given object
   * @since 3.1 (was previously private)
   */
  protected IPropertySource getPropertySource(Object object) {
    if (sources.containsKey(object)) return (IPropertySource) sources.get(object);

    IPropertySource result = null;
    IPropertySourceProvider provider = propertySourceProvider;

    if (provider != null) result = provider.getPropertySource(object);

    sources.put(object, result);
    return result;
  }
Example #2
0
 /**
  * Returns an property source for the given object.
  *
  * @object an object for which to obtain a property source or <code>null</code> if a property
  *     source is not available
  * @return an property source for the given object
  */
 private IPropertySource getPropertySource(Object object) {
   if (sources.containsKey(object)) return (IPropertySource) sources.get(object);
   IPropertySource result = null;
   if (propertySourceProvider != null) result = propertySourceProvider.getPropertySource(object);
   else if (object instanceof IPropertySource) result = (IPropertySource) object;
   else if (object instanceof IAdaptable)
     result = (IPropertySource) ((IAdaptable) object).getAdapter(IPropertySource.class);
   sources.put(object, result);
   return result;
 } /* (non-Javadoc)