@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface LibraryOverride
LibraryOverrideContextas the first parameter. The
override method may throw any checked exception declared on the original
interface method. It may additionally throw any RuntimeException,
including LibraryOverrideException.Only public library interface methods may be overridden. Methods which exist only on a library implementation class that are not declared in a public interface cannot be overridden.
For example, library classpaths may be overridden as follows:
@LibraryOverride(declaredBy=oracle.jdeveloper.library.JPaths.class)
public URLPath getClassPath(LibraryOverrideContext context)
{
if ( ... ) // determine whether path should be overridden
{
// override the original library path
return overridenPath;
}
// return the path from the original library
return context.getOverriddenLibrary().getClassPath();
}
In this example, the overridden method has no parameters, so the overriding
method has only one parameter, which is the override context.LibraryOverrideContext,
LibraryOverrideException| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<?> |
declaredBy
Specify the interface declaring the overridden method.
|