Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributeListImpl



    public void produce( LDAPAttributeSchema schema )
  throws SAXException
    {
  AttributeListImpl attrList;

  leaveDirectory();
  enterSchema();
  attrList = new AttributeListImpl();
  // dsml:attribute id
  attrList.addAttribute( XML.Schema.Attributes.Id, "ID", schema.getName() );
  // dsml:attribute superior
  if ( schema.getSuperior() != null ) {
      attrList.addAttribute( XML.Schema.Attributes.Superior, "CDATA", "#" + schema.getSuperior() );
  }
  // dsml:attribute obsolete
  attrList.addAttribute( XML.Schema.Attributes.Obsolete, null,
             schema.isObsolete() ? "true" : "false" );
  // dsml:attribute single-value
  attrList.addAttribute( XML.Schema.Attributes.SingleValue, null,
             schema.isSingleValued() ? "true" : "false" );
  // dsml:attribute user-modification
  // XXX

  // dsml:attribute
  _docHandler.startElement( prefix( XML.Schema.Elements.AttributeType) , attrList );

  // dsml:attribute name
  if ( schema.getName() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Name ), attrList );
      _docHandler.characters( schema.getName().toCharArray(), 0,
            schema.getName().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Name ) );
  }
  // dsml:attribute description
  if ( schema.getDescription() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Description ), attrList );
      _docHandler.characters( schema.getDescription().toCharArray(), 0,
            schema.getDescription().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Description ) );
  }
  // dsml:attribute object-identifier
  if ( schema.getID() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.OID ), attrList );
      _docHandler.characters( schema.getID().toCharArray(), 0,
            schema.getID().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.OID ) );
  }
  // dsml:attribute syntax
  if ( schema.getSyntaxString() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Syntax ), attrList );
      _docHandler.characters( schema.getSyntaxString().toCharArray(), 0,
            schema.getSyntaxString().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Syntax ) );
  }
View Full Code Here


     * @deprecated since 1.6.x.
     * @param attributes List of attributes defined in the XML for this
     *                   element. May be <code>null</code>.
     */
    public synchronized void setAttributes(AttributeList attributes) {
        this.attributes = new AttributeListImpl(attributes);
        for (int i = 0; i < attributes.getLength(); i++) {
            setAttribute(attributes.getName(i), attributes.getValue(i));
        }
    }
View Full Code Here

    throws SAXException {
        if (this.documentHandler==null)
            throw new SAXException("DocumentHandler not set");
        NamespacesTable.Name name=this.namespaces.resolve(uri,raw,null,loc);
        // Create the AttributeList
        AttributeListImpl a2=new AttributeListImpl();
        // Set the xmlns:...="..." attributes
        if (this.undecl.size()>0) {
            for (int x=0; x<this.undecl.size(); x++) {
                NamespacesTable.Declaration dec=null;
                dec=(NamespacesTable.Declaration)this.undecl.elementAt(x);
                String aname="xmlns";
                if (dec.getPrefix().length()>0) aname="xmlns:"+dec.getPrefix();
                a2.addAttribute(aname,"CDATA",dec.getUri());
            }
            this.undecl.clear();
        }
        // Set the real attributes
        for (int x=0; x<a.getLength(); x++) {
            NamespacesTable.Name aname=namespaces.resolve(a.getURI(x),
                                                          a.getQName(x),
                                                          null,
                                                          a.getLocalName(x));
            a2.addAttribute(aname.getQName(),a.getType(x),a.getValue(x));
        }
        // Call the document handler startElement() method.
        this.documentHandler.startElement(name.getQName(),a2);
    }
View Full Code Here

    throws SAXException {
        if (this.documentHandler==null)
            throw new SAXException("DocumentHandler not set");
        NamespacesTable.Name name=this.namespaces.resolve(uri,raw,null,loc);
        // Create the AttributeList
        AttributeListImpl a2=new AttributeListImpl();
        // Set the xmlns:...="..." attributes
        if (this.undecl.size()>0) {
            for (int x=0; x<this.undecl.size(); x++) {
                NamespacesTable.Declaration dec=null;
                dec=(NamespacesTable.Declaration)this.undecl.elementAt(x);
                String aname="xmlns";
                if (dec.getPrefix().length()>0) aname="xmlns:"+dec.getPrefix();
                a2.addAttribute(aname,"CDATA",dec.getUri());
            }
            this.undecl.clear();
        }
        // Set the real attributes
        for (int x=0; x<a.getLength(); x++) {
            NamespacesTable.Name aname=namespaces.resolve(a.getURI(x),
                                                          a.getQName(x),
                                                          null,
                                                          a.getLocalName(x));
            a2.addAttribute(aname.getQName(),a.getType(x),a.getValue(x));
        }
        // Call the document handler startElement() method.
        this.documentHandler.startElement(name.getQName(),a2);
    }
View Full Code Here

    throws SAXException {
        if (this.documentHandler==null)
            throw new SAXException("DocumentHandler not set");
        NamespacesTable.Name name=this.namespaces.resolve(uri,raw,null,loc);
        // Create the AttributeList
        AttributeListImpl a2=new AttributeListImpl();
        // Set the xmlns:...="..." attributes
        if (this.undecl.size()>0) {
            for (int x=0; x<this.undecl.size(); x++) {
                NamespacesTable.Declaration dec=null;
                dec=(NamespacesTable.Declaration)this.undecl.elementAt(x);
                String aname="xmlns";
                if (dec.getPrefix().length()>0) aname="xmlns:"+dec.getPrefix();
                a2.addAttribute(aname,"CDATA",dec.getUri());
            }
            this.undecl.clear();
        }
        // Set the real attributes
        for (int x=0; x<a.getLength(); x++) {
            NamespacesTable.Name aname=namespaces.resolve(a.getURI(x),
                                                          a.getQName(x),
                                                          null,
                                                          a.getLocalName(x));
            a2.addAttribute(aname.getQName(),a.getType(x),a.getValue(x));
        }
        // Call the document handler startElement() method.
        this.documentHandler.startElement(name.getQName(),a2);
    }
View Full Code Here

            AnyNode siblingNode = node.getNextSibling();

            String name = node.getLocalName();

            //-- retrieve the attributes and handle them
            AttributeListImpl atts = new AttributeListImpl();
            AnyNode tempNode = node.getFirstAttribute();
            String xmlName = null;
            String value = null;
            while (tempNode != null) {
                xmlName = tempNode.getLocalName();
                value = tempNode.getStringValue();
                atts.addAttribute(xmlName, null, value);
                tempNode = tempNode.getNextSibling();
            }//attributes

            //-- namespace management
            _context = _context.createNamespaces();
View Full Code Here

        _cdResolver      = new ClassDescriptorResolverImpl();
        _parents         = new Stack();
        _validate        = _config.marshallingValidation();
        _naming          = XMLNaming.getInstance();
        _processingInstructions = new List(3);
        _attributes      = new AttributeListImpl();
        _topLevelAtts    = new AttributeSetImpl();
    } //-- initialize();
View Full Code Here


    public void produce( LDAPAttributeSchema schema )
  throws SAXException
    {
  AttributeListImpl attrList;

  leaveDirectory();
  enterSchema();
  attrList = new AttributeListImpl();
  // dsml:attribute id
  attrList.addAttribute( XML.Schema.Attributes.Id, "ID", schema.getName() );
  // dsml:attribute superior
  if ( schema.getSuperior() != null ) {
      attrList.addAttribute( XML.Schema.Attributes.Superior, "CDATA", "#" + schema.getSuperior() );
  }
  // dsml:attribute obsolete
  attrList.addAttribute( XML.Schema.Attributes.Obsolete, null,
             schema.isObsolete() ? "true" : "false" );
  // dsml:attribute single-value
  attrList.addAttribute( XML.Schema.Attributes.SingleValue, null,
             schema.isSingleValued() ? "true" : "false" );
  // dsml:attribute user-modification
  // XXX

  // dsml:attribute
  _docHandler.startElement( prefix( XML.Schema.Elements.AttributeType) , attrList );

  // dsml:attribute name
  if ( schema.getName() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Name ), attrList );
      _docHandler.characters( schema.getName().toCharArray(), 0,
            schema.getName().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Name ) );
  }
  // dsml:attribute description
  if ( schema.getDescription() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Description ), attrList );
      _docHandler.characters( schema.getDescription().toCharArray(), 0,
            schema.getDescription().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Description ) );
  }
  // dsml:attribute object-identifier
  if ( schema.getID() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.OID ), attrList );
      _docHandler.characters( schema.getID().toCharArray(), 0,
            schema.getID().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.OID ) );
  }
  // dsml:attribute syntax
  if ( schema.getSyntaxString() != null ) {
      attrList = new AttributeListImpl();
      _docHandler.startElement( prefix( XML.Schema.Elements.Syntax ), attrList );
      _docHandler.characters( schema.getSyntaxString().toCharArray(), 0,
            schema.getSyntaxString().length() );
      _docHandler.endElement( prefix( XML.Schema.Elements.Syntax ) );
  }
View Full Code Here


    public void startDocument()
  throws SAXException
    {
  AttributeListImpl attrList;

  attrList = new AttributeListImpl();
  if ( _namespace )
      attrList.addAttribute( "xmlns:" + XML.Namespace.Prefix, "CDATA", XML.Namespace.URI );
  else
      attrList.addAttribute( "xmlns", "CDATA", XML.Namespace.URI );
  _docHandler.startElement( prefix( XML.Namespace.Root ), attrList );
 
    }
View Full Code Here

  throws SAXException
    {
  // If not inside directory element, start it
  if ( ! _insideDirectory ) {
      _insideDirectory = true;
      _docHandler.startElement( prefix( XML.Entries.Element ), new AttributeListImpl() );
  }
    }
View Full Code Here

TOP

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

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.