private static Key buildKey(String resourceName,
String keyName, Class<?> keyType, Class<? extends TyperefInfo> typerefInfoClass)
{
try
{
return new Key(keyName, keyType, getDataSchema(keyType, getSchemaFromTyperefInfo(typerefInfoClass)));
}
catch (TemplateRuntimeException e)
{
throw new ResourceConfigException("DataSchema for key '" + keyName + "' of type " + keyType + " on resource "
+ resourceName + "cannot be found; type is invalid or requires typeref", e);