Hello everybody!
I use the actiWATE library for one project. This is a code
file Main.java
file bro.javaimport bro.bro; import java.io.IOException; import java.io.UnsupportedEncodingException; public class Main { public static void main(String[] args) throws UnsupportedEncodingException, IOException { bro doBro= new bro(); } }
And now I want to get all headers. In this library is a method getAllHeaders()package bro; import com.actimind.actiwate.http.HttpResponse; import com.actimind.actiwate.testing.ActiwateTestCase; import java.io.IOException; import java.io.UnsupportedEncodingException; public class bro extends ActiwateTestCase { public bro() throws UnsupportedEncodingException, IOException{ disableJavaScript(true); goTo( "http://google.com" ); } }
file bro.java
but NetBeans IDE 6.8 required implementing all abstract methods. It's great but the next step is the overriding all these methods but I don't want it. I want use method getAllHeaders() without any overriding because it returns all header in one string.package bro; import com.actimind.actiwate.http.HttpResponse; import com.actimind.actiwate.testing.ActiwateTestCase; import java.io.IOException; import java.io.UnsupportedEncodingException; public class bro extends ActiwateTestCase { public bro() throws UnsupportedEncodingException, IOException{ disableJavaScript(true); goTo( "http://google.com" ); } public class WOW implements HttpResponse { } }
Ok. In order to don't overriding method I do it like an abstract class WOW with implements HttpResponse
The creation of objects from abstract classes is impossible and we need to create a class that extends abstract class WOW like thispackage bro; import com.actimind.actiwate.http.HttpResponse; import com.actimind.actiwate.testing.ActiwateTestCase; import java.io.IOException; import java.io.UnsupportedEncodingException; public class bro extends ActiwateTestCase { public bro() throws UnsupportedEncodingException, IOException{ disableJavaScript(true); goTo( "http://google.com" ); } public abstract class WOW implements HttpResponse { } }
But in this case IDE requires the implementation of all abstract methods with them overriding again! How can I avoid it and use this method? Thanks for all answers!package bro; import com.actimind.actiwate.http.HttpResponse; import com.actimind.actiwate.testing.ActiwateTestCase; import java.io.IOException; import java.io.UnsupportedEncodingException; public class bro extends ActiwateTestCase { public bro() throws UnsupportedEncodingException, IOException{ disableJavaScript(true); goTo( "http://google.com" ); } public abstract class WOW implements HttpResponse { } public class WOW2 extends WOW { } }