Package ch.tatool.element

Examples of ch.tatool.element.Element


        if (iterator == null || ! canExecuteNext()) {
            return false;
        }
       
        // get the next element and push it onto the stack
        Element next = iterator.next();
        ElementUtils.initialize(next);
        context.getExecutor().getExecutionTree().pushElement(next);
        return true;
  }
View Full Code Here


   */
  public static Object findHandlerInStackByType(ExecutionContext context, Class<?> type) {
    List<Element> elements = context.getElementStack();
    ListIterator<Element> iterator = elements.listIterator(elements.size());
    while (iterator.hasPrevious()) {
      Element element = iterator.previous();
      for (Object handler : element.getHandlers()) {
        if (type.isAssignableFrom(handler.getClass())) {
          return handler;
        }
      }
    }
View Full Code Here

  public TemporaryElementSupport findTemporaryElementSupport(ExecutionContext context) {
    // find a handler that provides the support
    List<Element> elements = context.getElementStack();
    ListIterator<Element> iterator = elements.listIterator(elements.size());
    while (iterator.hasPrevious()) {
      Element e = iterator.previous();
      for (Object handler : e.getHandlers()) {
        if (handler instanceof TemporaryElementSupport) return (TemporaryElementSupport) handler;
      }
    }
   
    // check the strategy
View Full Code Here

    public static final String SPRING_ELEMENT_CONFIGURATION_XML_PROPERTY = "SpringXmlElementConfig";

    /** Configures the executor with the given module. */
  public void initialize(Executor executor, Module module) {
    // load the root execution element
    Element element = fetchRootElement(module);
    executor.getExecutionTree().setRootElement(element);
   
    // instantiate the execution strategy
    setupExecutionStrategy(executor, module);
  }
View Full Code Here

          throw new CreationException("Unable to load Tatool file. Root element missing!");      
        }
       
        // fetch the rootElement
        try {
          Element root = (Element) beanFactory.getBean(ROOT_ELEMENT);
          return root;
        } catch (RuntimeException e) {
          String[] errors = e.getMessage().split(";");
          throw new CreationException(errors[errors.length-1]);
        }
View Full Code Here

    if (iterator == null || !canExecuteNext()) {
      return false;
    }

    // get the next element and push it onto the stack
    Element next = iterator.next();
    ElementUtils.initialize(next);
    context.getExecutor().getExecutionTree().pushElement(next);
    return true;
  }
View Full Code Here

        if (iterator == null || ! canExecuteNext()) {
            return false;
        }
       
        // get the next element and push it onto the stack
        Element next = iterator.next();
        ElementUtils.initialize(next);
        context.getExecutor().getExecutionTree().pushElement(next);
        return true;
  }
View Full Code Here

   
    // remove the Execution outcome property if set
    Misc.getOutcomeProperty().clearValue(executionContext);
   
    // ensure that the top element contains an executable element
    Element top = tree.getTop();
    return top != null && top.getExecutable() != null;
  }
View Full Code Here

    return top != null && top.getExecutable() != null;
  }
 
  /** Returns true if the top element contains an element that is yet to be executed. */
  private boolean isTopExecutable(ElementTree tree) {
    Element top = tree.getTop();
    // check whether there is an executable
    if (top != null && top.getExecutable() != null) {
      // check whether it is already executed
      Object executed = top.getProperty(Element.EXECUTED);
      if (executed == null || executed.equals(Boolean.FALSE)) {
        return true;
      }
    }
    return false;
View Full Code Here

    return false;
  }
 
  /** Handles the temporary elements. */
  private boolean hasTemporaryElement(ElementTree tree) {
    Element first = temporaryElements.poll();
    if (first != null) {
      tree.pushElement(first);
      return true;
    } else {
      return false;
View Full Code Here

TOP

Related Classes of ch.tatool.element.Element

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.