Package java.util

Examples of java.util.Stack.peek()


                            // doc
                            // tag
                            // or
                            // xml
                            if (!stack.isEmpty()) { // we found the closing tag before
                                String closedName = (String) stack.peek();
                                if (closedName.equalsIgnoreCase(_doc.substring(offset + 1, offset
                                        + 1 + closedName.length()))) {
                                    stack.pop();
                                    continue;
                                }
View Full Code Here


   * Returns the namespace URI that a prefix currently maps to
   */
  private String getNamespaceURI(String prefix) {
      // Get the stack associated with this namespace prefix
      final Stack stack = (Stack)_nsPrefixes.get(prefix);
      return (stack != null && !stack.empty()) ? (String) stack.peek()
    : EMPTYSTRING;
  }

  /**
   * Call this when an xml:space attribute is encountered to
View Full Code Here

                int colonIndex = stringValue.indexOf(':');
                String localPrefix = stringValue.substring(0, colonIndex);
                String localURI = null;
                Stack uriStack = (Stack)getNamespaceMap().get(localPrefix);
                if(uriStack != null && uriStack.size() > 0) {
                    localURI = (String)uriStack.peek();
                }

                if (localURI != null) {
                    String localName = stringValue.substring(colonIndex + 1, stringValue.length());
                    QName theQName = new QName(localURI, localName);
View Full Code Here

                if (prefix == null) {
                    typeUri = null;
                } else {
                    Stack uriStack = (Stack)getNamespaceMap().get(prefix);
                    if(uriStack != null && uriStack.size() > 0) {
                        typeUri = (String)uriStack.peek();
                    }
                }
            rootObjectType = typeHelper.getType(typeUri, typeName);
            }           
        }
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

      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

                            + 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

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.