Package slash.navigation.gpx.binding10

Examples of slash.navigation.gpx.binding10.ObjectFactory


    } else {
      modelSubscription.setBrief(new Boolean(false));
    }
     
    try {
      String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
      logger.debug("marshalled subscription filter:  " + rawFilter);
      modelSubscription.setSubscriptionFilter(rawFilter);

    } catch (JAXBException e) {
      logger.error("JAXBException while marshalling subscription filter", e);
View Full Code Here


    } else {
      modelSubscription.setBrief(new Boolean(false));
    }
     
   
    String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
    logger.debug("marshalled subscription filter:  " + rawFilter);
    modelSubscription.setSubscriptionFilter(rawFilter);
   
  }
View Full Code Here

    } else {
      modelSubscription.setBrief(new Boolean(false));
    }
     
    try {
      String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
      logger.debug("marshalled subscription filter:  " + rawFilter);
      modelSubscription.setSubscriptionFilter(rawFilter);

    } catch (JAXBException e) {
      logger.error("JAXBException while marshalling subscription filter", e);
View Full Code Here

                } else {
                        modelSubscription.setBrief(Boolean.FALSE);
                }


                String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
                logger.debug("marshalled subscription filter:  " + rawFilter);
                modelSubscription.setSubscriptionFilter(rawFilter);

        }
View Full Code Here

    } else {
      modelSubscription.setBrief(new Boolean(false));
    }
     
   
    String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
    logger.debug("marshalled subscription filter:  " + rawFilter);
    modelSubscription.setSubscriptionFilter(rawFilter);
   
  }
View Full Code Here

public class GpxFormatIT {

    @Test
    public void testReader() throws FileNotFoundException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from10.gpx");
        Gpx gpx = (Gpx) GpxUtil.newUnmarshaller10().unmarshal(reader);
        assertNotNull(gpx);
        assertNotNull(gpx.getWpt());
        assertEquals(3, gpx.getWpt().size());
        assertNotNull(gpx.getRte());
        assertEquals(3, gpx.getRte().size());
        assertNotNull(gpx.getTrk());
        assertEquals(3, gpx.getRte().size());
    }
View Full Code Here

        return gpx;
    }

    private Gpx createGpx(List<GpxRoute> routes) {
        ObjectFactory objectFactory = new ObjectFactory();
        Gpx gpx = null;
        for(GpxRoute route : routes) {
            gpx = recycleGpx(route);
            if(gpx != null)
                break;
        }
        if (gpx == null || !reuseReadObjectsForWriting)
            gpx = objectFactory.createGpx();
        gpx.setCreator(GENERATED_BY);
        gpx.setVersion(VERSION);

        for (GpxRoute route : routes) {
            switch (route.getCharacteristics()) {
                case Waypoints:
                    createMetaData(route, gpx);
                    gpx.getWpt().addAll(createWayPoints(route, 0, route.getPositionCount()));
                    break;
                case Route:
                    gpx.getRte().addAll(createRoute(route, 0, route.getPositionCount()));
                    break;
                case Track:
                    gpx.getTrk().addAll(createTrack(route, 0, route.getPositionCount()));
                    break;
                default:
                    throw new IllegalArgumentException("Unknown RouteCharacteristics " + route.getCharacteristics());
            }
        }
View Full Code Here

    }

    public void read(InputStream source, CompactCalendar startDate, ParserContext<GpxRoute> context) throws Exception {
        InputStreamReader reader = new InputStreamReader(source);
        try {
            Gpx gpx = unmarshal10(reader);
            process(gpx, context);
        }
        finally {
            reader.close();
        }
View Full Code Here

        context.appendRoutes(extractRoutes(gpx, hasSpeedInKiloMeterPerHourInsteadOfMeterPerSecond));
        context.appendRoutes(extractTracks(gpx, hasSpeedInKiloMeterPerHourInsteadOfMeterPerSecond));
    }

    public void read(InputStream source, CompactCalendar startDate, ParserContext<GpxRoute> context) throws Exception {
        Gpx gpx = unmarshal10(source);
        process(gpx, context);
    }
View Full Code Here

        trk.getTrkseg().add(trkseg);
        return trks;
    }

    private Gpx recycleGpx(GpxRoute route) {
        Gpx gpx = route.getOrigin(Gpx.class);
        if (gpx != null) {
            gpx.getRte().clear();
            gpx.getTrk().clear();
            gpx.getWpt().clear();
        }
        return gpx;
    }
View Full Code Here

TOP

Related Classes of slash.navigation.gpx.binding10.ObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.