Package org.exist.util.serializer

Examples of org.exist.util.serializer.AttrList.addAttribute()


                        attrs.addAttribute(ATTR_CHANGE, changeMessage);
                    else {
                        NodeId nodeId = (NodeId) reader.getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
                        NodeSet children = changeSet.selectParentChild(new NodeProxy(diffDoc, nodeId), NodeSet.ANCESTOR);
                        if (children != null && !children.isEmpty())
                            attrs.addAttribute(ATTR_CHANGE, "changed");
                    }
                    if (elementStack.size() == 0)
                        receiver.startPrefixMapping(StandardDiff.PREFIX, StandardDiff.NAMESPACE);
                }
View Full Code Here


                            if (StandardDiff.NAMESPACE.equals(child.getNamespaceURI()) && "attribute".equals(child.getLocalName())) {
                                NamedNodeMap map = child.getAttributes();
                                for (int j = 0; j < map.getLength(); j++) {
                                    AttrImpl attr = (AttrImpl) map.item(j);
                                    if (!attr.getName().startsWith("xmlns"))
                                        attrs.addAttribute(attr.getQName(), attr.getValue(),
                                                attr.getType(), attr.getNodeId());
                                }
                            }
                            child = (StoredNode) child.getNextSibling();
                        }
View Full Code Here

                    }

                    if (deletedNodes.get(nodeId) == null) {
                        QName attrQn = new QName(reader.getAttributeLocalName(i), reader.getAttributeNamespace(i),
                                reader.getAttributePrefix(i));
                        attrs.addAttribute(
                                attrQn,
                                reader.getAttributeValue(i),
                                getAttributeType(reader.getAttributeType(i))
                        );
                    }
View Full Code Here

                }
                break;
            case XMLStreamReader.CHARACTERS:
                if (onFirstNode && annotate) {
                    attrs = new AttrList();
                    attrs.addAttribute(ATTR_CHANGE, changeMessage);
                    receiver.startElement(ELEMENT_WRAPPER, attrs);
                }
                receiver.characters(reader.getText());
                if (onFirstNode && annotate)
                    receiver.endElement(ELEMENT_WRAPPER);
View Full Code Here

        }

        public void serialize(DBBroker broker, Receiver handler) {
            try {
                AttrList attribs = new AttrList();
                attribs.addAttribute(ATTR_REF, refChild.getNodeId().toString());
                handler.startElement(ELEMENT_INSERT, attribs);
                serializeChildren(broker, handler);
                handler.endElement(ELEMENT_INSERT);
            } catch (SAXException e) {
                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here

            for (int i = 0; i < nodes.length; i++) {
                switch (nodes[i].nodeType) {
                    case XMLStreamReader.ATTRIBUTE:
                        attribs = new AttrList();
                        AttrImpl attr = (AttrImpl) broker.objectWith(otherDoc, nodes[i].nodeId);
                        attribs.addAttribute(new QName(attr.getLocalName(), attr.getNamespaceURI(), attr.getPrefix()),
                                attr.getValue(), attr.getType());
                        handler.startElement(ELEMENT_ATTRIBUTE, attribs);
                        handler.endElement(ELEMENT_ATTRIBUTE);
                        break;
                    case XMLStreamReader.START_ELEMENT:
View Full Code Here

        }
    }

    public synchronized void report(Action action, String message, long elapsed) {
        AttrList attribs = new AttrList();
        attribs.addAttribute(THREAD_ATTRIB, Thread.currentThread().getName());
        attribs.addAttribute(NAME_ATTRIB, action.getClass().getName());
        attribs.addAttribute(ELAPSED_ATTRIB, Long.toString(elapsed));
        attribs.addAttribute(ID_ATTRIB, action.getId());
        if (action.getParent() != null && !(action.getParent() instanceof ActionThread))
            attribs.addAttribute(PARENT_ATTRIB, action.getParent().getId());
View Full Code Here

    }

    public synchronized void report(Action action, String message, long elapsed) {
        AttrList attribs = new AttrList();
        attribs.addAttribute(THREAD_ATTRIB, Thread.currentThread().getName());
        attribs.addAttribute(NAME_ATTRIB, action.getClass().getName());
        attribs.addAttribute(ELAPSED_ATTRIB, Long.toString(elapsed));
        attribs.addAttribute(ID_ATTRIB, action.getId());
        if (action.getParent() != null && !(action.getParent() instanceof ActionThread))
            attribs.addAttribute(PARENT_ATTRIB, action.getParent().getId());
        if (action.getDescription() != null)
View Full Code Here

    public synchronized void report(Action action, String message, long elapsed) {
        AttrList attribs = new AttrList();
        attribs.addAttribute(THREAD_ATTRIB, Thread.currentThread().getName());
        attribs.addAttribute(NAME_ATTRIB, action.getClass().getName());
        attribs.addAttribute(ELAPSED_ATTRIB, Long.toString(elapsed));
        attribs.addAttribute(ID_ATTRIB, action.getId());
        if (action.getParent() != null && !(action.getParent() instanceof ActionThread))
            attribs.addAttribute(PARENT_ATTRIB, action.getParent().getId());
        if (action.getDescription() != null)
            attribs.addAttribute(DESCRIPTION_ATTRIB, action.getDescription());
View Full Code Here

    public synchronized void report(Action action, String message, long elapsed) {
        AttrList attribs = new AttrList();
        attribs.addAttribute(THREAD_ATTRIB, Thread.currentThread().getName());
        attribs.addAttribute(NAME_ATTRIB, action.getClass().getName());
        attribs.addAttribute(ELAPSED_ATTRIB, Long.toString(elapsed));
        attribs.addAttribute(ID_ATTRIB, action.getId());
        if (action.getParent() != null && !(action.getParent() instanceof ActionThread))
            attribs.addAttribute(PARENT_ATTRIB, action.getParent().getId());
        if (action.getDescription() != null)
            attribs.addAttribute(DESCRIPTION_ATTRIB, action.getDescription());
        if (action.getLastResult() != 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.