获取类别中的子类别

使用 RAMCategory.getSubCategories()RAMCategory.getSubCategory(String subCategoryName) 方法来访存类别中的所有子类别。如果此模式是通过 RAMAsset.getCategorySchemas()RAMAsset.getCategorySchema(String schemaName) 访存的,那么它仅包含已设置的子类别或包含对资产设置的子类别。

                //Get all sub categories for a category
                RAMSubCategory[] subCategories = (RAMSubCategory[])modelCategory.getSubCategories();
                
                //Get a sub category by name
                RAMSubCategory foreignSubCategory = (RAMSubCategory)modelCategory.getSubCategory("Foreign");
                
                //Get a sub category given a path to from the category
                RAMSubCategory camrySubCategory = (RAMSubCategory)modelCategory.getSubCategory("Foreign/Toyota/Camry");
                
                //Get a sub category given a path from a sub category
                RAMSubCategory accordSubCategory = (RAMSubCategory)foreignSubCategory.getSubCategory("Honda/Accord");

反馈