Examples of FlightType


Examples of com.sun.jersey.samples.jsonfromjaxb.jaxb.FlightType

     * The flight lists will be constructed just once
     * when the first request to the flight list resource occurs.
     */
    public FlightList() {
        myFlights = new Flights();
        FlightType flight123 = new FlightType();
        flight123.setCompany("Czech Airlines");
        flight123.setNumber(123);
        flight123.setFlightId("OK123");
        flight123.setAircraft("B737");
        FlightType flight124 = new FlightType();
        flight124.setCompany("Czech Airlines");
        flight124.setNumber(124);
        flight124.setFlightId("OK124");
        flight124.setAircraft("AB115");
        myFlights.getFlight().add(flight123);
        myFlights.getFlight().add(flight124);
    }
View Full Code Here

Examples of com.sun.jersey.samples.jsonfromjaxb.jaxb.FlightType

     * The flight lists will be constructed just once
     * when the first request to the flight list resource occurs.
     */
    public FlightList() {
        myFlights = new Flights();
        FlightType flight123 = new FlightType();
        flight123.setCompany("Czech Airlines");
        flight123.setNumber(123);
        flight123.setFlightId("OK123");
        flight123.setAircraft("B737");
        FlightType flight124 = new FlightType();
        flight124.setCompany("Czech Airlines");
        flight124.setNumber(124);
        flight124.setFlightId("OK124");
        flight124.setAircraft("AB115");
        myFlights.getFlight().add(flight123);
        myFlights.getFlight().add(flight124);
        myBean = new MessageBean();
    }
View Full Code Here

Examples of org.springframework.oxm.jaxb.test.FlightType

    return marshaller;
  }

  @Override
  protected Object createFlights() {
    FlightType flight = new FlightType();
    flight.setNumber(42L);
    flights = new Flights();
    flights.getFlight().add(flight);
    return flights;
  }
View Full Code Here

Examples of org.springframework.oxm.jaxb.test.FlightType

    assertTrue("Jaxb2Marshaller does not support JAXBElement<FlightsType>",
        marshaller.supports(method.getGenericReturnType()));

    marshaller.setSupportJaxbElementClass(true);
    JAXBElement<FlightType> flightTypeJAXBElement = new JAXBElement<FlightType>(new QName("http://springframework.org", "flight"), FlightType.class,
        new FlightType());
    assertTrue("Jaxb2Marshaller does not support JAXBElement<FlightsType>", marshaller.supports(flightTypeJAXBElement.getClass()));

    assertFalse("Jaxb2Marshaller supports class not in context path", marshaller.supports(DummyRootElement.class));
    assertFalse("Jaxb2Marshaller supports type not in context path", marshaller.supports((Type)DummyRootElement.class));
    method = getClass().getDeclaredMethod("createDummyRootElement");
View Full Code Here

Examples of org.springframework.oxm.jaxb.test.FlightType

    testFlight(flights.getFlight().get(0));
  }

  @Override
  protected void testFlight(Object o) {
    FlightType flight = (FlightType) o;
    assertNotNull("Flight is null", flight);
    assertEquals("Number is invalid", 42L, flight.getNumber());
  }
View Full Code Here

Examples of org.springframework.oxm.jaxb.test.FlightType

    XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(INPUT_STRING));
    streamReader.nextTag(); // skip to flights
    streamReader.nextTag(); // skip to flight
    Source source = StaxUtils.createStaxSource(streamReader);
    JAXBElement<FlightType> element = (JAXBElement<FlightType>) unmarshaller.unmarshal(source);
    FlightType flight = element.getValue();
    testFlight(flight);
  }
View Full Code Here

Examples of org.springframework.samples.flight.FlightType

  @Override
  protected Object createFlights() {
    FlightsDocument flightsDocument = FlightsDocument.Factory.newInstance();
    FlightsDocument.Flights flights = flightsDocument.addNewFlights();
    FlightType flightType = flights.addNewFlight();
    flightType.setNumber(42L);
    return flightsDocument;
  }
View Full Code Here

Examples of org.springframework.samples.flight.FlightType

    testFlight(flights.getFlightArray(0));
  }

  @Override
  protected void testFlight(Object o) {
    FlightType flight = null;
    if (o instanceof FlightType) {
      flight = (FlightType) o;
    }
    else if (o instanceof FlightDocument) {
      FlightDocument flightDocument = (FlightDocument) o;
      flight = flightDocument.getFlight();
    }
    assertNotNull("Flight is null", flight);
    assertEquals("Number is invalid", 42L, flight.getNumber());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.