Package org.megatome.frame2.event

Examples of org.megatome.frame2.event.Event


  }

  public ForwardProxy resolveForward(String token, String tokenType)
      throws ViewException {
    // global forward
    Forward fwd = resolveGlobalForward(token, tokenType);

    return new ForwardProxy(fwd);
  }
View Full Code Here


  }

  public Forward resolveGlobalForward(String token, String tokenType)
      throws ViewException {
    // global forward
    Forward fwd = null;

    if (tokenType.equals(HTML_TOKEN)) {
      fwd = getGlobalHTMLForward(token);
    } else if (tokenType.equals(XML_TOKEN)) {
      fwd = getGlobalXMLForward(token);
View Full Code Here

    for (ExceptionDef edef : this.exceptions) {
      String classtype = edef.getType();
      try {
        if (Class.forName(classtype).isInstance(ex)) {
          String view = edef.getView(vtype.toString());
          Forward fwd = resolveGlobalForward(view, tokenType);
          return new ExceptionProxy(fwd, edef);
        }
      } catch (ClassNotFoundException e) { // Not concerned with this
      }
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  static public RequestProcessor instance(Configuration config,
      ServletContext context, HttpServletRequest request,
      HttpServletResponse response) {

    RequestProcessorDef requestProcessorDef = config
        .getHttpRequestProcessor();
    if (requestProcessorDef != null) {

      Class<RequestProcessor> c = createClass(requestProcessorDef
          .getType());
      if (c == null) {
        return null;
      }
View Full Code Here

  @SuppressWarnings("unchecked")
  static public RequestProcessor instance(Configuration config,
      Element[] elements, String eventPkg) {

    RequestProcessorDef requestProcessorDef = config
        .getSoapRequestProcessor();
    if (requestProcessorDef != null) {

      Class c = createClass(requestProcessorDef.getType());
      if (c == null) {
        return null;
      }

      Object[] objects = { config, elements, eventPkg };
View Full Code Here

            }

            if (eventProxy.isParent()) {
              // put eventNames in arraylist for iteration
              // put events in list mapped by eventName
              JaxbEventBase evt = unmarshall(unmarshaller, DOMStreamConverter
                  .toInputStream(element));
              evt.setValidatingSchema(s);
              eventList.add(evt);
              /*
               * eventList.add((Event)unmarshaller
               * .unmarshal(DOMStreamConverter
               * .toInputStream(this.elements[i])));
               */
              event.setResolve(ResolveType.PARENT);
              event.setEvents(eventList);
              events.add(event);
            } else if (eventProxy.isChildren()) {
              NodeList nodeList = element.getChildNodes();

              for (int j = 0; j < nodeList.getLength(); j++) {
                if (nodeList.item(j).getNodeType() == Node.ELEMENT_NODE) {
                  JaxbEventBase evt = unmarshall(unmarshaller,
                      DOMStreamConverter
                          .toInputStream(nodeList
                              .item(j)));
                  evt.setValidatingSchema(s);
                  eventList.add(evt);
                  /*
                   * eventList.add((Event)unmarshaller
                   * .unmarshal(DOMStreamConverter
                   * .toInputStream(nodeList .item(j))));
View Full Code Here

        Marshaller marshaller = jcontext.createMarshaller();

        Document doc = getTargetDocument();
       
        if (obj instanceof JaxbEventBase) {
          JaxbEventBase jeb = (JaxbEventBase)obj;
          marshaller.marshal(jeb.getMarshallableType(), doc);
        } else {
          marshaller.marshal(obj, doc);
        }
        result = doc.getDocumentElement();
      } catch (JAXBException e) {
View Full Code Here

    USAddress address = po.getShipTo();

    assertNotNull(address);
    assertEquals("Alice Smith", address.getName()); //$NON-NLS-1$

    Items items = po.getItems();

    assertNotNull(items);
    assertEquals(2, items.getItem().size());
  }
View Full Code Here

    Items.Item item = po.getItems().getItem().get(0);

    item.setComment("This comment has been changed"); //$NON-NLS-1$

    ObjectFactory of = new ObjectFactory();
    OutputStream ostream = Helper.marshall(of.createPurchaseOrder(po),
        TARGET_PACKAGE, getClass().getClassLoader());

    assertTrue(ostream.toString().indexOf("This comment has been changed") > 0); //$NON-NLS-1$
  }
View Full Code Here

  private static final String TARGET_PACKAGE = "org.megatome.frame2.jaxbgen"; //$NON-NLS-1$

  @SuppressWarnings("boxing")
  @Test
  public void testUnmarshall_InputStream() throws Exception {
    PurchaseOrderType po = unmarshall();

    assertNotNull(po);

    assertEquals("1999-10-20", Helper.calendarToString(po.getOrderDate())); //$NON-NLS-1$

    USAddress address = po.getShipTo();

    assertNotNull(address);
    assertEquals("Alice Smith", address.getName()); //$NON-NLS-1$

    Items items = po.getItems();

    assertNotNull(items);
    assertEquals(2, items.getItem().size());
  }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.event.Event

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.