int depth) {
TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
if (null == typeManager)
throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
TypeDefinitionContainer tc = typeManager.getTypeById(typeId);
List<TypeDefinitionContainer> result = null;
if (tc != null) {
if (depth == -1) {
result = tc.getChildren();
if (!includePropertyDefinitions)
cloneTypeList(depth - 1, false, result);
} else if (depth == 0 || depth < -1)
throw new CmisInvalidArgumentException("illegal depth value: " + depth);
else {
result = tc.getChildren();
cloneTypeList(depth - 1, includePropertyDefinitions, result);
}
}
return tc;
}