Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributesImpl.clear()


                          currentNode.getNodeName(),
                          currentNode.getNodeValue());
                        break;
                    case Node.ELEMENT_NODE:
                        NamedNodeMap map = currentNode.getAttributes();
                        currentAtts.clear();
                        for (int i = map.getLength() - 1; i >= 0; i--) {
                            Attr att = (Attr) map.item(i);
                            currentAtts.addAttribute( att.getNamespaceURI(),
                                                      att.getLocalName(), att.getName(),
                                                      "CDATA", att.getValue());
View Full Code Here


            if (conf.getFeatures().contains(Feature.memberships)) {
                handler.startElement("", "", "memberships", null);

                for (MembershipTO memb : userTO.getMemberships()) {
                    atts.clear();

                    atts.addAttribute("", "", "id", XSD_LONG, String.valueOf(memb.getId()));
                    atts.addAttribute("", "", "roleId", XSD_LONG, String.valueOf(memb.getRoleId()));
                    atts.addAttribute("", "", "roleName", XSD_STRING, String.valueOf(memb.getRoleName()));
                    handler.startElement("", "", "membership", atts);
View Full Code Here

        } else {
            AttributesImpl atts = new AttributesImpl();
            handler.startElement("", "", "resources", null);

            for (String resourceName : attributableTO.getResources()) {
                atts.clear();

                atts.addAttribute("", "", ATTR_NAME, XSD_STRING, resourceName);
                handler.startElement("", "", "resource", atts);
                handler.endElement("", "", "resource");
            }
View Full Code Here

        if (!attrs.isEmpty()) {
            Map<String, AttributeTO> attrMap = attributableTO.getAttributeMap();

            handler.startElement("", "", "attributes", null);
            for (String attrName : attrs) {
                atts.clear();

                atts.addAttribute("", "", ATTR_NAME, XSD_STRING, attrName);
                handler.startElement("", "", "attribute", atts);

                if (attrMap.containsKey(attrName)) {
View Full Code Here

        if (!derAttrs.isEmpty()) {
            Map<String, AttributeTO> derAttrMap = attributableTO.getDerivedAttributeMap();

            handler.startElement("", "", "derivedAttributes", null);
            for (String attrName : derAttrs) {
                atts.clear();

                atts.addAttribute("", "", ATTR_NAME, XSD_STRING, attrName);
                handler.startElement("", "", "derivedAttribute", atts);

                if (derAttrMap.containsKey(attrName)) {
View Full Code Here

        if (!virAttrs.isEmpty()) {
            Map<String, AttributeTO> virAttrMap = attributableTO.getVirtualAttributeMap();

            handler.startElement("", "", "virtualAttributes", null);
            for (String attrName : virAttrs) {
                atts.clear();

                atts.addAttribute("", "", ATTR_NAME, XSD_STRING, attrName);
                handler.startElement("", "", "virtualAttribute", atts);

                if (virAttrMap.containsKey(attrName)) {
View Full Code Here

    private void doExtract(final ContentHandler handler, final List<SyncopeUser> users)
            throws SAXException, ReportException {

        AttributesImpl atts = new AttributesImpl();
        for (SyncopeUser user : users) {
            atts.clear();

            for (Feature feature : conf.getFeatures()) {
                String type = null;
                String value = null;
                switch (feature) {
View Full Code Here

                handler.startElement(URI, COLLECTIONS, QCOLLECTIONS, attributes);

                // Print child collections
                String[] collections = collection.listChildCollections();
                for (int i = 0; i < collections.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, collections[i]);
                    handler.startElement(URI, COLLECTION,
                            QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, COLLECTION);
                }
View Full Code Here

                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE,
                            QRESOURCE, attributes);
                    handler.endElement(URI, RESOURCE, RESOURCE);
                }
View Full Code Here

                XMLResource result = (XMLResource)results.nextResource();

                final String id = result.getId();
                final String documentId = result.getDocumentId();

                attributes.clear();
                if (id != null) {
                    attributes.addAttribute("", RESULT_ID_ATTR, RESULT_ID_ATTR,
                        CDATA, id);
                }
                if (documentId != 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.