/** * createProcessingInstruction method * * @return org.w3c.dom.ProcessingInstruction * @param target * java.lang.String * @param data * java.lang.String */ public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException { ProcessingInstructionImpl pi = new ProcessingInstructionImpl(); pi.setOwnerDocument(this); pi.setTarget(target); if (data != null) pi.setData(data); return pi; }
/** */ void resetStructuredDocumentRegions() { this.data = getData(); setStructuredDocumentRegion(null); }
/** * getNodeName method * * @return java.lang.String */ public String getNodeName() { return getTarget(); }
/** * cloneNode method * * @return org.w3c.dom.Node * @param deep * boolean */ public Node cloneNode(boolean deep) { ProcessingInstructionImpl cloned = new ProcessingInstructionImpl(this); notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned); return cloned; }
/** * setData method * * @param data * java.lang.String */ public void setData(String data) throws DOMException { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.data = data; notifyValueChanged(); }
/** */ private void changeAttrEqual(IStructuredDocumentRegion flatNode, ITextRegion region) { int offset = flatNode.getStart(); if (offset < 0) return; NodeImpl root = (NodeImpl) this.context.getRootNode(); if (root == null) return; Node node = root.getNodeAt(offset); if (node == null) return; if (node.getNodeType() != Node.ELEMENT_NODE) { if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { // just notify the change instead of setting data ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node; pi.notifyValueChanged(); } return; } // actually, do nothing }
/** * getNodeValue method * * @return java.lang.String */ public String getNodeValue() { return getData(); }
/** * setNodeValue method * * @param nodeValue * java.lang.String */ public void setNodeValue(String nodeValue) throws DOMException { setData(nodeValue); }
/** */ public boolean isClosed() { IStructuredDocumentRegion flatNode = getStructuredDocumentRegion(); if (flatNode == null) return true; // will be generated String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode); return (regionType == DOMRegionContext.XML_PI_CLOSE); }
return this.data; IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion(); if (flatNode == null) return new String();
/** * ProcessingInstructionImpl constructor * * @param that * ProcessingInstructionImpl */ protected ProcessingInstructionImpl(ProcessingInstructionImpl that) { super(that); if (that != null) { this.target = that.target; this.data = that.getData(); } }