on 09-07-2009 4:54 PM
Hi there,
Im trying to make a Java Mapping on PI 7.1 and i have the following problem:
from what i've read, you mapping class should look something like this
public class Mapping extends DefaultHandler implements StreamTransformation{
But StreamTransformation is deprecated and they sugest that instead you extend from AbstractTransformation,
wich brings the problem that i cannot extend from more than 1 Class in Java,
anybody has a workaround for this??,
Am i doing something wrong??,
Thanks for the help,
Roberto.
Edited by: Roberto Gomez on Sep 7, 2009 5:55 PM
Hi,
If you are not using any method from DefaultHandler, do not extended it, extend only from AbstractTransformation.
Can you give us the reference where You found the documentation?...It is strange.
Regards
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was following this blog :
http://www.riyaz.net/blog/xipi-java-mapping-demystified/
there, they extend from DefaultHandler and they implement StreamTransformation aswell,
they assign the current object to the handler as shown in the following code:
public void execute (InputStream in, OutputStream out)
throws com.sap.aii.mapping.api.StreamTransformationException {
DefaultHandler handler = this;
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser saxParser = factory.newSAXParser();
this.out = out;
saxParser.parse(in, handler);
}
catch (Throwable t){
t.printStackTrace();
}
}
im not sure if this is needed or if i could just make a new empty handler and use it
Hi
Can you give the exactly problem?.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
StreamTransformation is an Interface that you need to implement in order to do a Java Mapping,
DefaultHander is Class that you need to extend from in order to call a saxParser.parse method,
StreamTransformation is deprecated now and they provide you an Abstract Class named AbstractTransformation
In Java i can only Extend from 1 Class hence the problem when trying to make the Mapping class work.
Regards,
Roberto.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.