Package java.util

Examples of java.util.Stack.peek()


    if (txs != null)
    {
      try
      {
        return (BasicAction) txs.peek();
      }
      catch (EmptyStackException e)
      {
      }
    }
View Full Code Here


     */
    public String lookupNamespace(String prefix)
    {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
            ((MappingRecord) stack.peek()).m_uri : null;
    }
   
    MappingRecord getMappingFromPrefix(String prefix) {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
View Full Code Here

    }
   
    MappingRecord getMappingFromPrefix(String prefix) {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
            ((MappingRecord) stack.peek()) : null;
    }

    /**
     * Given a namespace uri, and the namespaces mappings for the
     * current element, return the current prefix for that uri.
View Full Code Here

        if ((stack = (Stack) m_namespaces.get(prefix)) == null)
        {
            m_namespaces.put(prefix, stack = new Stack());
        }

        if (!stack.empty() && uri.equals(((MappingRecord)stack.peek()).m_uri))
        {
            return false;
        }
        MappingRecord map = new MappingRecord(prefix,uri,elemDepth);
        stack.push(map);
View Full Code Here

   */
  public static JbpmContext getCurrentJbpmContext() {
    JbpmContext currentJbpmContext = null;
    Stack stack = getStack();
    if (! stack.isEmpty()) {
      currentJbpmContext = (JbpmContext) stack.peek();
    }
    return currentJbpmContext;
  }

  // convenience methods //////////////////////////////////////////////////////
View Full Code Here

  }
  public static ExecutionContext currentExecutionContext() {
    ExecutionContext executionContext = null;
    Stack stack = getContextStack();
    if (! stack.isEmpty()) {
      executionContext = (ExecutionContext) stack.peek();
    }
    return executionContext;
  }
}
View Full Code Here

                // if we pushed an error handler, pop it from the fault stack
                // before we exit normally without an exception
                if (errorHandlerMediator != null) {
                    Stack faultStack = synCtx.getFaultStack();
                    if (faultStack != null && !faultStack.isEmpty()) {
                        Object o = faultStack.peek();

                        if (o instanceof MediatorFaultHandler &&
                                errorHandlerMediator.equals(
                                        ((MediatorFaultHandler) o).getFaultMediator())) {
                            faultStack.pop();
View Full Code Here

     * @return a call frame
     */
    public static CallFrame getCurrentFrame() {
        final Stack stack = (Stack) callStack.get();
        if (stack != null && !stack.isEmpty()) {
            return (CallFrame) stack.peek();
        }

        return null;
    }

View Full Code Here

        }

        // -------------------------
        // Make the menu path string
        // -------------------------
        SimpleParser.Record menu = (SimpleParser.Record) menus.peek();
        String pathString = "";
        String helpId = null;

        // The title of the main menu
        String label = ((SimpleParser.Record) menus.get(0)).getString(TITLE, false);
View Full Code Here

            namespaces.push(namespace);
            contentHandler.startPrefixMapping(prefix, namespace);
            mapped = true;
        } else {
            if (namespaces.isEmpty() ||
                    !namespace.equals(namespaces.peek().toString())) {
                // The prefix is mapped to a different namespace or nothing is
                // mapped to it - start the mapping
                namespaces.push(namespace);
                contentHandler.startPrefixMapping(prefix, namespace);
                mapped = true;
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.