Package java.util

Examples of java.util.Stack.peek()


  // Get the stack that contains URIs for the specified prefix
  if ((stack = (Stack)_namespaces.get(prefix)) == null) {
      _namespaces.put(prefix, stack = new Stack());
  }

  if (!stack.empty() && uri.equals(stack.peek())) {
      return false;
  }

  stack.push(uri);
  _prefixStack.push(prefix);
View Full Code Here


    /**
     * Use a namespace prefix to lookup a namespace URI
     */
    protected String lookupNamespace(String prefix) {
        final Stack stack = (Stack)_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ? (String)stack.peek() : null;
    }

    /**
     * Returns the local name of a qualified name. If the name has
     * no prefix, then it works as the identity (SAX2).
View Full Code Here

      if (uriStack.isEmpty()) {
    _sax.startPrefixMapping(prefix, uri);
    uriStack.push(uri);
      }
      else {
    final String lastUri = (String) uriStack.peek();
    if (!lastUri.equals(uri)) {
        _sax.startPrefixMapping(prefix, uri);
        uriStack.push(uri);
    }
    else {
View Full Code Here

  if (existing instanceof VariableBase) {
      return((VariableBase)existing);
  }
  else if (existing instanceof Stack) {
      Stack stack = (Stack)existing;
      return((VariableBase)stack.peek());
  }
  return(null);
    }

    public void setXSLTC(XSLTC xsltc) {
View Full Code Here

        if (environmentStack.get() == null) {
            environmentStack.set(new Stack());
        }
        final Stack stack = (Stack)environmentStack.get();
        if ( !stack.empty() ) {
            final Object[] objects = (Object[])stack.peek();
            if ( objects[1] == objectModel ) {
                stack.push(new Object[] {env, objectModel, objects[2], TWO});
                return;
            }
        }
View Full Code Here

            return this;
        }
        */
        final Stack stack = (Stack)environmentStack.get();
        if ( null != stack && !stack.empty()) {
            final Object[] objects = (Object[])stack.peek();
            final Map components = (Map)objects[2];
            final Object[] o = (Object[])components.get(role);
            if ( null != o  ) {
                final Component component = (Component) o[0];
                if (null != component) {
View Full Code Here

        final Component component = super.lookup( role );
        if (null != component && component instanceof RequestLifecycleComponent) {
            if (stack == null || stack.empty()) {
                throw new ComponentException("ComponentManager has no Environment Stack.");
            }
            final Object[] objects = (Object[]) stack.peek();
            final Map components = (Map)objects[2];
            try {
                if (component instanceof Recomposable) {
                    ((Recomposable) component).recompose(this);
                }
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

                    throw new RuntimeException("Mismatch - popped element = "
                            + poppedStack.element + " finished target element = "
                            + targetElement.element);
                }
                if (!threadStack.empty()) {
                    parentElement = (TimedElement) threadStack.peek();
                }
            }
            if (parentElement == null) {
                buildElement.element.appendChild(targetElement.element);
            } else {
View Full Code Here

        if (parentElement == null) {
            Stack threadStack
                    = (Stack) threadStacks.get(Thread.currentThread());
            if (threadStack != null) {
                if (!threadStack.empty()) {
                    parentElement = (TimedElement) threadStack.peek();
                }
            }
        }

        if (parentElement != null) {
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.