public S resolveScript ( String name ) throws E { if ( name . lastIndexOf ( ' ' ) <= name . lastIndexOf ( ' ' ) ) // no file extension provided name += getDefaultScriptExtension ( ) ; if ( ! hasAllowedExtension ( name ) ) // for multiple Facets to co-exist peacefully, we need to be able to determine // which Facet is responsible for a given view just from the file name return null ; URL res = getResource ( name ) ; if ( res == null ) { // look for 'defaults' file int dot = name . lastIndexOf ( ' ' ) ; // foo/bar.groovy -> foo/bar.default.groovy // but don't do foo.bar/test -> foo.default.bar/test // as of 2010/9, this behaviour is considered deprecated, but left here for backward compatibility. // we need a better way to refer to the resource of the same name in the base type. if ( name . lastIndexOf ( ' ' ) < dot ) res = getResource ( name . substring ( 0 , dot ) + ".default" + name . substring ( dot ) ) ; } if ( res != null ) return parseScript ( res ) ; return null ; }
Loads the script just from the target class without considering inherited scripts from its base types .