/** Load a class through this namespace taking into account imports. The * class search will proceed through the parent namespaces if necessary. * @param name the name * @return null if not found. * @throws UtilEvalError the util eval error */ public Class<?> getClass(final String name) throws UtilEvalError { final Class<?> c = this.getClassImpl(name); if (c != null) return c; if (this.parent != null) return this.parent.getClass(name); return null; }
Class clas = namespace.getClass( evalName );
/** Load a class through this namespace taking into account imports. The class search will proceed through the parent namespaces if necessary. @return null if not found. */ public Class getClass( String name ) throws UtilEvalError { Class c = getClassImpl(name); if ( c != null ) return c; else // implement the recursion for getClassImpl() if ( parent != null ) return parent.getClass( name ); else return null; }
Class clas = namespace.getClass( evalName );
String name = Name.suffix(ambigName.text, 1); try { // import static method from class clas = namespace.getClass(Name.prefix(ambigName.text)); obj = Reflect.staticMethodImport(clas, name); } catch (Exception e) { e.printStackTrace(); /* ignore try field instead */ }