MCPcopy Index your code
hub / github.com/beanshell/beanshell / classForName

Method classForName

src/bsh/BshClassManager.java:172–189  ·  view source on GitHub ↗

Load the specified class by name, taking into account added classpath and reloaded classes, etc. Note: Again, this is just a trivial implementation. See bsh.classpath.ClassManagerImpl for the fully functional class management package. @return the class or null

( String name )

Source from the content-addressed store, hash-verified

170 @return the class or null
171 */
172 public Class classForName( String name )
173 {
174 if ( isClassBeingDefined( name ) )
175 throw new InterpreterError(
176 "Attempting to load class in the process of being defined: "
177 +name );
178
179 Class clas = null;
180 try {
181 clas = plainClassForName( name );
182 } catch ( ClassNotFoundException e ) { /*ignore*/ }
183
184 // try scripted class
185 if ( clas == null && declaringInterpreter.getCompatibility() )
186 clas = loadSourceClass( name );
187
188 return clas;
189 }
190
191 // Move me to classpath/ClassManagerImpl???
192 protected Class<?> loadSourceClass( final String name ) {

Callers 3

getCommandMethod · 0.95
classExistsMethod · 0.95
getConstructorArgsMethod · 0.45

Calls 4

isClassBeingDefinedMethod · 0.95
plainClassForNameMethod · 0.95
loadSourceClassMethod · 0.95
getCompatibilityMethod · 0.80

Tested by

no test coverage detected