Hi,
I've started adding:
/**
* Return default values for specified Entity Reference types. Useful when an Entity
Reference value has not been
* specified and we need to find a default value for it (the default value returned will
depend on the implementations,
* some will return default values defined in the XWiki configuration, others will return
values taken from the
* current document reference, etc).
*
* @version $Id$
* @since 2.3M1
*/
@ComponentRole
public interface EntityReferenceValueProvider
{
/**
* @param type the entity reference type for which to get the default value
* @return the default value for the passed type
*/
String getDefaultValue(EntityType type);
}
The idea is to use it in our resolvers but also to allow using it by any code that needs
to get default values.
My initial itch was to remove all the code duplication we currently have in the resolver
implementations.
Just yell if you don't agree. I'm about to commit it in about 1 hour.
Thanks
-Vincent