1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Hints hints = new Hints();
hints.put(Hints.STYLE_FACTORY, MutableStyleFactory.class);
hints.put(Hints.FILTER_FACTORY, FilterFactory2.class);
STYLE_FACTORY = (MutableStyleFactory)FactoryFinder.getStyleFactory(hints);
FILTER_FACTORY = (FilterFactory2)FactoryFinder.getFilterFactory(hints);
try
{
POOL = new MarshallerPool(new Class[] {StyledLayerDescriptor.class});
}
catch(JAXBException ex)
{
ex.printStackTrace();
}
TRANSFORMER_GT = new SE100toGTTransformer(FILTER_FACTORY, STYLE_FACTORY);
Unmarshaller UNMARSHALLER = POOL.acquireUnmarshaller();
Object obj = UNMARSHALLER.unmarshal(FeatureSourceTest2.class.getResource("/org/style/StyleTest.xml"));
UserStyle jax = (UserStyle)obj;
MutableStyle style = TRANSFORMER_GT.visitUserStyle(jax); |
Partager