package gw.util uses gw.entity.ITypeList /** * Util to handle discrete function related to TypeKey */ class TypekeyUtil { private construct() { } /** * Get all available typekeys for a given typelist name * @param typelistName the name of the typelist eg. "State" * @return the list of available typekeys eg. {State.TC_AL, State.TC_CA...} * @throws RuntimeException if the specified name doesn't correspond to any type */ public static function getTypeKeys(typeListName : String) : Object[]{ var typelist = getTypeList(typeListName) return typelist.getTypeKeys(false).toArray() } /** * Get TypeList for a given typeListName * @param typeListName * @return the TypeList corresponding to the given typeListName * @throws RuntimeException if the specified name doesn't correspond to valid typelist */ public static function getTypeList(typeListName : String) : ITypeList { var typelist = gw.lang.reflect.TypeSystem.getByFullName("typekey.${typeListName}") as gw.entity.ITypeList return typelist } }