public static short toType ( String strType ) throws RegistryException { if ( strType . equals ( REGDWORD_TOKEN ) ) return RegistryEntry . TYPE_DWORD ; else if ( strType . equals ( REGSTR_TOKEN ) ) return RegistryEntry . TYPE_STRING ; else if ( strType . equals ( REGKEY_TOKEN ) ) return RegistryEntry . TYPE_KEY ; throw new RegistryException ( strType + " is not a valid Registry Type" ) ; }
cast a String type to a short Type