- Notifications
You must be signed in to change notification settings - Fork 1
Mapping Contents
By default, all the public constructors, public methods and public inner classes are exported. You can select which of theses items you wants in your resulting C++ proxies. You have two ways for selecting items :
- export all items, and manually lists items you don't want to generate
- export no items, and manually lists items you want to generate
You can select which of the public constructors of a Java class will be present in the resulting C++ proxy.
Annotation case:
packagedemo;
@Java4CpppublicclassSample {
publicSample() {}
@Java4CppNoWrappepublicSample(doublea) {}
}or
packagedemo;
@Java4Cpp(all = false)
publicclassSample {
@Java4CppWrappepublicSample() {}
publicSample(doublea) {}
}XML case:
You locate the constructor by specifying his parameters JNI signature's. Default constructor with no parameter is simply an empty string.
<mappings>
<classes>
<classclass="demo.Sample">
<constructors>
<noWrappes>
<noWrappe>D</noWrappe>
</noWrappes>
</constructors>
</class>
</classes>
</mappings>or
<mappings>
<classes>
<classclass="demo.Sample"exportAll="false">
<constructors>
<wrappes>
<wrappe></wrappe>
</wrappes>
</constructors>
</class>
</classes>
</mappings>will produce
namespacedemo {
classSample {
public:Sample();
};
}You can select which of the public methods (static or not) of a Java class will be present in the resulting C++ proxy.
Annotation case:
packagedemo;
@Java4CpppublicclassSample {
publicStringmethod(doublea) {}
@Java4CppNoWrappepublicvoidmethod(Stringa) {}
}or
packagedemo;
@Java4Cpp(all = false)
publicclassSample {
@Java4CppWrappepublicStringmethod(doublea) {}
publicvoidmethod(Stringa) {}
}XML case:
You locate the method by specifying is name following by his parameters JNI signature's in parenthesis.
<mappings>
<classes>
<classclass="demo.Sample">
<methods>
<noWrappes>
<noWrappe>method(Ljava.lang.String;)</noWrappe>
</noWrappes>
</methods>
</class>
</classes>
</mappings>or
<mappings>
<classes>
<classclass="demo.Sample"exportAll="false">
<methods>
<wrappes>
<wrappe>method(D)</wrappe>
</wrappes>
</methods>
</class>
</classes>
</mappings>will produce
namespacedemo {
classSample {
public:
java::lang::String method(double arg1);
};
}You can select which of the public static fields of a Java class will be present in the resulting C++ proxy.
Annotation case:
packagedemo;
@Java4CpppublicclassSample {
publicstaticDoublefield1;
@Java4CppNoWrappepublicstaticStringfield2;
}or
packagedemo;
@Java4Cpp(staticFields = false)
publicclassSample {
@Java4CppWrappepublicstaticDoublefield1;
publicstaticStringfield2;
}XML case:
You locate the static field by specifying is name.
<mappings>
<classes>
<classclass="demo.Sample">
<staticFields>
<noWrappes>
<noWrappe>field2</noWrappe>
</noWrappes>
</staticFields>
</class>
</classes>
</mappings>or
<mappings>
<classes>
<classclass="demo.Sample"staticFields="false">
<staticFields>
<wrappes>
<wrappe>field1</wrappe>
</wrappes>
</staticFields>
</class>
</classes>
</mappings>will produce
namespacedemo {
classSample {
public:static java::lang::Double getField1();
};
}You can select which of the public inner (static or not) classes (or enums) of a Java class will be present in the resulting C++ proxy.
Annotation case:
For inner classes, you have the choice of using Java4CppWrappe like for other items, or using Java4Cpp for a more precise control of the mapping for this inner class.
packagedemo;
@Java4CpppublicclassSample {
publicclassInner1 {
}
@Java4CppNoWrappepublicstaticclassInner2 {
}
}or
packagedemo;
@Java4Cpp(all = false)
publicclassSample {
@Java4CppWrappepublicclassInner1 {
}
publicstaticclassInner2 {
}
}XML case:
You locate the static inner class by specifying is name.
<mappings>
<classes>
<classclass="demo.Sample">
<innerClasses>
<noWrappes>
<noWrappe>Inner2</noWrappe>
</noWrappes>
</innerClasses>
</class>
</classes>
</mappings>or
<mappings>
<classes>
<classclass="demo.Sample"exportAll="false">
<innerClasses>
<wrappes>
<wrappe>Inner1</wrappe>
</wrappes>
</innerClasses>
</class>
</classes>
</mappings>will produce
namespacedemo {
classSample {
public:classInner1 {
};
};
}