DefaultHandler startElement - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DefaultHandler startElement method.

This code example shows how to use the following methods:endElement, startElement
	 * @param context 
	 * @throws SAXException 
	 */ 
	protected void endLayoutDefinition(TableRenderContext context)
			throws SAXException {
		this.documentHandler.endElement(FOElementMapping.URI, "region-body",
				"region-body"); 
 
		if (getShowHeader()) { 
			this.documentHandler.startElement(FOElementMapping.URI,
					"region-before", "region-before", 
					createRegionBeforeAttributes(context));
			this.documentHandler.endElement(FOElementMapping.URI,
					"region-before", "region-before"); 
		} 
 
		if (getShowFooter()) { 
			this.documentHandler.startElement(FOElementMapping.URI,
					"region-after", "region-after", 
					createRegionAfterAttributes(context));

5
CodeRank
This code example shows how to use the following methods:startElement
        baseHandler.endPrefixMapping(prefix);
    } 
 
    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
        namespaceDeclarationStack.pushNamespaces(qName, uri, atts);
        baseHandler.startElement(uri, localName, qName, atts);
    } 
 
    public void endElement(String uri, String localName, String qName) throws SAXException {
        baseHandler.endElement(uri, localName, qName);
        namespaceDeclarationStack.popNamespaces();
    } 
 
    public void characters(char[] ch, int start, int length) throws SAXException {
        baseHandler.characters(ch, start, length);
    } 
 
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        baseHandler.ignorableWhitespace(ch, start, length);
    } 
4
CodeRank
This code example shows how to use the following methods:startElement
        } 
    } 
 
    public void testStartElement() { 
        try { 
            h.startElement("uri", "name", "qname", new AttributesImpl());
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    public void testEndElement() { 
        try { 
            h.endElement("uri", "name", "qname");
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    public void testCharacters() { 
4
CodeRank
This code example shows how to use the following methods:characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace
        final Attributes attrs = new AttributesImpl();
        final char[] characters = new char[0];
        final char[] whitespace = new char[0];
         
        DefaultHandler adapter = new ContentHandlerAdapter(handler);
        adapter.setDocumentLocator(locator);
        adapter.startDocument();
        adapter.startPrefixMapping("prefix", "uri");
        adapter.endPrefixMapping("prefix");
        adapter.startElement("uri", "localName", "qName", attrs);
        adapter.endElement("uri", "localName", "qName");
        adapter.characters(characters, 1, 2);
        adapter.ignorableWhitespace(whitespace, 3, 4);
        adapter.processingInstruction("target", "data");
        adapter.skippedEntity("name");
        adapter.endDocument();
 
        verify(handler).setDocumentLocator(locator);
        verify(handler).startDocument();
        verify(handler).startPrefixMapping("prefix", "uri");
        verify(handler).endPrefixMapping("prefix");
3
CodeRank
This code example shows how to use the following methods:startElement
        } 
        if ("invitations".equals(qName)) {
            subHandler = invitationHandler;
        } 
        if (subHandler != null) {
            subHandler.startElement(uri, localName, qName, attrs);
        } 
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public void endElement(String uri, String localName, String qName) throws SAXException {
        super.endElement(uri, localName, qName);
        if ("bags".equals(qName) || ("template-queries").equals(qName)
            || "queries".equals(qName) ||  "items".equals(qName) || "tags".equals(qName)
            || "preferences".equals(qName) || "invitations".equals(qName)) {
            subHandler = null;
        } 
4
CodeRank
This code example shows how to use the following methods:startElement
            trackHandler = new QueryTrackHandler(osw);
        } else if (SearchTrackBinding.SEARCHTRACKS.equals(qName)) {
            trackHandler = new SearchTrackHandler(osw);
        } 
        if (trackHandler != null) {
            trackHandler.startElement(uri, localName, qName, attrs);
        } 
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public void endElement(String uri, String localName, String qName) throws SAXException {
        super.endElement(uri, localName, qName);
        if (TemplateTrackBinding.TEMPLATETRACKS.equals(qName)
            || LoginTrackBinding.LOGINTRACKS.equals(qName)
            || ListTrackBinding.LISTTRACKS.equals(qName)
            || QueryTrackBinding.QUERYTRACKS.equals(qName)
            || SearchTrackBinding.SEARCHTRACKS.equals(qName)) {
4
CodeRank
startElement Method Overview
Receive notification of the start of an element.
See Code Examples for other Java 8 DefaultHandler Methods: