Package org.milyn.delivery

Examples of org.milyn.delivery.Fragment


            fail("Expected SmooksException");
        } catch(SmooksException e) {
            assertEquals("An OutputStream to the 'Mock' resource is already open.  Cannot open a Writer to this resource now!", e.getMessage());
        }

        resource.executeVisitLifecycleCleanup(new Fragment((Element)null), executionContext);

        // Should be unbound "after" and the stream should be closed...
        assertNull(getResource(resource, executionContext));
        assertTrue(MockAbstractOutputStreamResource.isClosed);
  }
View Full Code Here


            fail("Expected SmooksException");
        } catch(SmooksException e) {
            assertEquals("An Writer to the 'Mock' resource is already open.  Cannot open an OutputStream to this resource now!", e.getMessage());
        }

        resource.executeVisitLifecycleCleanup(new Fragment((Element)null), executionContext);

        // Should be unbound "after" and the stream should be closed...
        assertNull(getResource(resource, executionContext));
        assertTrue(MockAbstractOutputStreamResource.isClosed);
    }
View Full Code Here

  public void visitBefore(SAXElement element,
      ExecutionContext executionContext) throws SmooksException,
      IOException {

    count(executionContext, new Fragment(element));
  }
View Full Code Here

  }

  public void visitAfter(SAXElement element, ExecutionContext executionContext)
    throws SmooksException, IOException {

    count(executionContext, new Fragment(element));
  }
View Full Code Here

  }

  public void visitBefore(Element element, ExecutionContext executionContext)
    throws SmooksException {

    count(executionContext, new Fragment(element));
  }
View Full Code Here

  }

  public void visitAfter(Element element, ExecutionContext executionContext)
    throws SmooksException {

    count(executionContext, new Fragment(element));
  }
View Full Code Here

    resource.visitBefore((Element)null, executionContext );
   
    OutputStream outputStream = AbstractOutputStreamResource.getOutputStream(resource.getResourceName(), executionContext );
    assertTrue(outputStream instanceof FileOutputStream );
   
    resource.executeVisitLifecycleCleanup(new Fragment((Element)null), executionContext);
   
    assertThatFilesWereGenerated(executionContext);
  }
View Full Code Here

    private void applyTemplate(Template template, SAXElement element, ExecutionContext executionContext) throws SmooksException {
        if (getAction() == Action.BIND_TO) {
            Writer writer = new StringWriter();
            applyTemplate(template, element, executionContext, writer);

            executionContext.getBeanContext().addBean(getBindBeanId(), writer.toString(), new Fragment(element));
        } else {
            Writer writer = element.getWriter(this);
            applyTemplate(template, element, executionContext, writer);
        }
    }
View Full Code Here

            logger.debug("Cannot bind data onto bean '" + beanId + "' as bean does not exist in BeanContext.");
            return;
        }

      if(isBeanWiring) {
          bindBeanValue(executionContext, new Fragment(element));
        } else if(isAttribute) {
            // Bind attribute (i.e. selectors with '@' prefix) values on the visitBefore...
            bindDomDataValue(element, executionContext);
        }
    }
View Full Code Here

            logger.debug("Cannot bind data onto bean '" + beanId + "' as bean does not exist in BeanContext.");
            return;
        }

        if(isBeanWiring) {
          bindBeanValue(executionContext, new Fragment(element));
        } else if(isAttribute) {
            // Bind attribute (i.e. selectors with '@' prefix) values on the visitBefore...
            bindSaxDataValue(element, executionContext);
        } else if(expressionEvaluator == null || expressionHasDataVariable) {
            // It's not a wiring, attribute or expression binding => it's the element's text.
View Full Code Here

TOP

Related Classes of org.milyn.delivery.Fragment

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.