if(collection.getEntity().hasActions())
{
entityActions = collection.getEntity().getActions();
}
String schema = resourceSchema.getSchema();
IdentifierSchema identifier = collection.getIdentifier();
if(identifier.getParams() == null) // in this case we have a "simple" collection resource
{
DataSchema key = RestSpecCodec.textToSchema(identifier.getType(), _schemaResolver);
return buildResourceSpec(supports,
toTypeSpec(key),
null,
Collections.<String, Object>emptyMap(),
schema,
actions,
entityActions);
}
else // we have a complex collection resource
{
DataSchema keyKeyType = RestSpecCodec.textToSchema(identifier.getType(), _schemaResolver);
DataSchema keyParamsType = RestSpecCodec.textToSchema(identifier.getParams(), _schemaResolver);
ComplexKeySpec<?, ?> complexKeyType = toComplexKey(keyKeyType, keyParamsType);
return buildResourceSpec(supports,
new TypeSpec<ComplexResourceKey>(ComplexResourceKey.class, null),
complexKeyType,
Collections.<String, Object>emptyMap(),