public void setPrefix(String prefix) throws DOMException { throw new DOMException(DOMException.NAMESPACE_ERR, DOMMessageFormatter .formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null)); }
ResourceBundle resourceBundle = getResourceBundle(domain); if (resourceBundle == null) { init(); resourceBundle = getResourceBundle(domain); if (resourceBundle == null) throw new MissingResourceException("Unknown domain" + domain,
public void insertSiblingAfter(OMNode sibling) throws OMException { // Overridden in ChildNode throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public void setPreviousOMSibling(OMNode previousSibling) { throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public void insertSiblingBefore(OMNode sibling) throws OMException { // Overridden in ChildNode throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public void setNextOMSibling(OMNode previousSibling) { throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public Node insertBefore(Node newChild, Node refChild) throws DOMException { // Overridden in ParentNode throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); }
public Node removeChild(Node oldChild) throws DOMException { throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessageFormatter .formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null)); }
public void appendData(String value) throws DOMException { if (this.isReadonly()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } this.textValue.append(value); }
/** * Extracts a range of data from the node. * * @return Returns the specified substring. If the sum of offset and count exceeds the length, then * all 16-bit units to the end of the data are returned. */ public String substringData(int offset, int count) throws DOMException { if (offset < 0 || offset > this.getLength() || count < 0) { throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null)); } int end = Math.min(count + offset, textValue.length()); return this.textValue.substring(offset, end); }
/** If the given data is null the content will be deleted. */ public void replaceData(int offset, int count, String data) throws DOMException { if (this.isReadonly()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } int length = this.textValue.length(); if (offset < 0 || offset > length - 1 || count < 0) { throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null)); } else { int end = Math.min(count + offset, length); if (data == null) { this.textValue.delete(offset, end); } else { this.textValue.replace(offset, end, data); } } }
/***/ public Node removeNamedItem(String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(name, 0); if (i < 0) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl) nodes.elementAt(i); nodes.removeElementAt(i); return n; } // removeNamedItem(String):Node
/** Inserts a string at the specified offset. */ public void insertData(int offset, String data) throws DOMException { int length = this.getLength(); if (this.isReadonly()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } if (offset < 0 || offset > length - 1) { throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null)); } this.textValue.insert(offset, data); }
/** Sets the text value of data. */ public void setData(String data) throws DOMException { if (!this.isReadonly()) { this.textValue.replace(0, this.getLength(), data); } else { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } }
/** * Removes the specified attribute node. * * @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr) */ public Attr removeAttributeNode(Attr oldAttr) throws DOMException { if (isReadonly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } if (this.attributes == null || this.attributes.getNamedItem(oldAttr.getName()) == null) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } return (AttrImpl) this.attributes.removeNamedItem(oldAttr .getName()); }
/** * Sets the attribute value. * * @see org.apache.axiom.om.OMAttribute#setAttributeValue(String) */ public void setAttributeValue(String value) { if (isReadonly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } this.attrValue = (TextImpl) this.getOwnerDocument().createTextNode( value); }
/** * Borrowed from the Xerces impl. Checks if the given qualified name is legal with respect to * the version of XML to which this document must conform. * * @param prefix prefix of qualified name * @param local local part of qualified name */ protected final void checkQName(String prefix, String local) { // check that both prefix and local part match NCName boolean validNCName = (prefix == null || XMLChar.isValidNCName(prefix)) && XMLChar.isValidNCName(local); if (!validNCName) { // REVISIT: add qname parameter to the message String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } if (prefix == null || prefix.equals("")) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } }
public Attr createAttribute(String name) throws DOMException { if (!DOMUtil.isQualifiedName(name)) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } return new AttrImpl(this, name, this.factory); }
/** * Introduced in DOM Level 2. Removes a node specified by local name and namespace URI. * * @param namespaceURI The namespace URI of the node to remove. When it is null or an empty * string, this method behaves like removeNamedItem. * @param name The local name of the node to remove. * @return Returns the node removed from the map if a node with such a local name and namespace * URI exists. * @throws NOT_FOUND_ERR: Raised if there is no node named name in the map. */ public Node removeNamedItemNS(String namespaceURI, String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(namespaceURI, name); if (i < 0) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl) nodes.elementAt(i); nodes.removeElementAt(i); return n; } // removeNamedItem(String):Node