if(resourceSchema.hasCollection())
{
CollectionSchema collection = resourceSchema.getCollection();
_type = ResourceType.COLLECTION;
_supports = collection.getSupports();
_methods = collection.hasMethods() ? collection.getMethods() : new RestMethodSchemaArray(0);
_finders = collection.hasFinders() ? collection.getFinders() : new FinderSchemaArray(0);
_actions = collection.hasActions() ? collection.getActions() : new ActionSchemaArray(0);
_entity = collection.getEntity();
}
else if(resourceSchema.hasAssociation())
{
_type = ResourceType.ASSOCIATION;
AssociationSchema association = resourceSchema.getAssociation();
_supports = association.getSupports();
_methods = association.hasMethods() ? association.getMethods() : new RestMethodSchemaArray(0);
_finders = association.hasFinders() ? association.getFinders() : new FinderSchemaArray(0);
_actions = association.hasActions() ? association.getActions() : new ActionSchemaArray(0);
_entity = association.getEntity();
}
else if(resourceSchema.hasSimple())
{
_type = ResourceType.SIMPLE;
SimpleSchema simple = resourceSchema.getSimple();
_supports = simple.getSupports();
_methods = simple.hasMethods() ? simple.getMethods() : new RestMethodSchemaArray(0);
_finders = new FinderSchemaArray(0);
_actions = new ActionSchemaArray(0);
_entity = simple.getEntity();
}
else if(resourceSchema.hasActionsSet())
{
_type = ResourceType.ACTION_SET;
ActionsSetSchema actionSet = resourceSchema.getActionsSet();
_supports = new StringArray(0);
_methods = new RestMethodSchemaArray(0);
_finders = new FinderSchemaArray(0);;
_actions = actionSet.hasActions() ? actionSet.getActions() : new ActionSchemaArray(0);
_entity = null;
}
else