Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributesImpl


  void setAttribute(NodeDescriptor descriptor, String value){
        if (this.elementStarted) {
            Assertion.failed("Attributes must not be added to Element after Element is started."); //$NON-NLS-1$
        }
    if(attributes == null) {
            attributes = new AttributesImpl();
        }
        attributes.addAttribute(descriptor.getNamespaceURI(), descriptor.getName(), descriptor.getQName(), DEFAULT_ATTRIBUTE_TYPE, value);
  }
View Full Code Here


            if(curDefaultNamespace != null && curDefaultNamespace.length() > 0) {
                this.evNamespace("", "");
            }
        }

        final AttributesImpl pendingAtts = this._pendingAtts;
        final int attlen = pendingAtts.getLength();
        if(attlen > 0) {
            fixNamespacePrefix(pendingAtts, attlen);
        }

        final String elemQName = (prefix != null && prefix.length() > 0) ? prefix + ':' + lname
                : lname;
        try {
            _contentHandle.startElement(nsuri, lname, elemQName, pendingAtts);
        } catch (SAXException e) {
            wrapSAXException(e);
        }
        pendingAtts.clear();
        this._hasPendingElem = false;
    }
View Full Code Here

    public void testCreateSimpleConfiguration()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
        assertEquals( "configuration.path", "", configuration.getPath() );
View Full Code Here

        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String value = "value";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
View Full Code Here

        throws Exception
    {
        final SAXConfigurationHandler handler = new MockSAXConfigurationHandler();
        final String qName = "myElement";
        final String value = "value";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
View Full Code Here

        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String value = "value";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
View Full Code Here

        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String childName = "myChild";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.startElement( "", "", childName, new AttributesImpl() );
        handler.endElement( "", "", childName );
        handler.endElement( "", "", qName );

        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
View Full Code Here

    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String childName = "myChild";
        final String grandChildName = "myGrandChild";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.startElement( "", "", childName, new AttributesImpl() );
        handler.startElement( "", "", grandChildName, new AttributesImpl() );
        handler.endElement( "", "", grandChildName );
        handler.endElement( "", "", childName );
        handler.endElement( "", "", qName );

        final Configuration configuration = handler.getConfiguration();
View Full Code Here

    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String childName = "myChild";
        final String value = "value";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.startElement( "", "", childName, new AttributesImpl() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.endElement( "", "", childName );
        handler.endElement( "", "", qName );

        final Configuration configuration = handler.getConfiguration();
View Full Code Here

    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final String childName = "myChild";
        final String value = "value";
        handler.startElement( "", "", qName, new AttributesImpl() );
        handler.characters( value.toCharArray(), 0, value.length() );
        handler.startElement( "", "", childName, new AttributesImpl() );
        handler.endElement( "", "", childName );
        try
        {
            handler.endElement( "", "", qName );
        }
View Full Code Here

TOP

Related Classes of org.xml.sax.helpers.AttributesImpl

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.