Index index;
if ( createIndex.type() == Index.class )
{
// The annotation does not specify a specific index type.
// We use the generic index implementation.
index = new GenericIndex( createIndex.attribute(), createIndex.cacheSize() );
}
else
{
// The annotation contains a specific index type, we use that type.
index = createIndex.type().newInstance();