| | | | Browse by category |
Question
How can I set an IlpGeographicPositionConverter via CSS?
Answer
This sample shows how to specify an IlpGeographicPositionConverter via CSS.
If you try to specify the distribution's IlpGeographicPositionConverter in CSS as follows:
Positioning {
positionClass: "ilog.cpl.network.IlpGeographicPosition";
positionConverterClass: "ilog.cpl.network.IlpGeographicPositionConverter";
converterClass: "ilog.cpl.network.IlpGeographicPositionConverter";
}
you will get a java.lang.InstantiationException. This is because the IlpGeographicPositionConverter does not provide a
no-argument constructor.
To specify an IlpGeographicPositionConverter via CSS, you need to make it a JavaBeans by adding the no-argument constructor, so that the CSS engine can properly instantiate it at runtime.
The attached sample shows how to define such JavaBean implementation so that the IlpGeographicPositionConverter subtype can be used in the CSS and is properly configured.