Gets a Class object by a name of a class. If no such class exists and exception is thrown.

## Static method (use this):
## Class$forName(name, ...)

## Don't use the below:
# S3 method for class 'Class'
forName(static, name, ...)

Arguments

...

Optional arguments passed to internal lookup function.

Value

Returns a Class.

Author

Henrik Bengtsson

See also

class(). setConstructorS3(). For more information see Class.

Examples

  print(Class$forName("Exception"))
#> Exception extends simpleError, error, condition, try-error, Object {
#>   public as.character(...)
#>   public getCall(which=1, ...)
#>   public getCalls(...)
#>   public static getLastException(...)
#>   public getMessage(...)
#>   public getStackTrace(cleanup=getOption("R.oo::Exception/getStackTrace/args/cleanup", TRUE), ...)
#>   public getWhen(...)
#>   public printStackTrace(...)
#>   public throw(...)
#>   public abort(..., call.=TRUE, domain=NULL)
#>   public attach(private=FALSE, pos=2, ...)
#>   public attachLocally(private=FALSE, fields=NULL, excludeFields=NULL, overwrite=TRUE, envir=parent.frame(), ...)
#>   public clearCache(recursive=TRUE, gc=FALSE, ...)
#>   public detach(...)
#>   public equals(other, ...)
#>   public finalize(...)
#>   public getFields(private=FALSE, ...)
#>   public getInstantiationTime(...)
#>   public hasField(field, ...)
#>   public hashCode(...)
#>   public static load(file, path=NULL, ...)
#>   public save(file=NULL, path=NULL, compress=TRUE, ..., safe=TRUE)
#> }