JavaInterface

Indicates that your interface represents an interface in Java.

Use this on the declaration, then your other classes can implement it fairly normally (just with the @Import and @Export annotations added in the appropriate places). D will require something be filled in on the child classes so be sure to copy the @Import declarations there.

interface IFoo : JavaInterface!("com.example", IFoo) {
	string whatever();
}

final class Foo : JavaClass!("com.example", Foo), IFoo {
	// need to tell D that the implementation exists, just in Java.
	// (This actually generates the D implementation that just forwards to the existing java method)
	@Import string whatever();
}
interface JavaInterface : IJavaObject (
string javaPackage
CRTP
) {}

Inherited Members

From IJavaObject

getJavaHandle
jobject getJavaHandle()

Remember the returned object is a TEMPORARY local reference!

Meta