public ResourceKey deriveKey( final ResourceKey parent,
final String path,
final Map<? extends ParameterKey, ? extends Object> parameters )
throws ResourceKeyCreationException {
if ( parent == null ) {
if ( path == null ) {
throw new NullPointerException();
}
return createKey( path, parameters );
}
if ( loader.isSupportedKey( parent ) ) {
try {
return loader.deriveKey( parent, path, parameters );
} catch ( ResourceKeyCreationException rkce ) {
ResourceKey context = computeContextKey( parent );
while ( context != null ) {
try {
return backend.deriveKey( context, path, parameters );
} catch ( ResourceKeyCreationException rkce2 ) {
rkce = rkce2;
}
context = computeContextKey( context );
}
throw rkce;
}
}
return backend.deriveKey( parent, path, parameters );
}