org.w3c.dom.UserDataHandler Java Examples

The following examples show how to use org.w3c.dom.UserDataHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IIOMetadataNode.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #2
Source File: DomNode.java    From HtmlUnit-Android with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Object setUserData(final String key, final Object data, final UserDataHandler handler) {
    if (userData_ == null) {
        userData_ = new HashMap<>();
    }
    return userData_.put(key, data);
}
 
Example #3
Source File: IIOMetadataNode.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #4
Source File: IIOMetadataNode.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #5
Source File: IIOMetadataNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #6
Source File: NodeImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a duplicate of a given node. You can consider this a
 * generic "copy constructor" for nodes. The newly returned object should
 * be completely independent of the source object's subtree, so changes
 * in one after the clone has been made will not affect the other.
 * <P>
 * Note: since we never have any children deep is meaningless here,
 * ParentNode overrides this behavior.
 * @see ParentNode
 *
 * <p>
 * Example: Cloning a Text node will copy both the node and the text it
 * contains.
 * <p>
 * Example: Cloning something that has children -- Element or Attr, for
 * example -- will _not_ clone those children unless a "deep clone"
 * has been requested. A shallow clone of an Attr node will yield an
 * empty Attr of the same name.
 * <p>
 * NOTE: Clones will always be read/write, even if the node being cloned
 * is read-only, to permit applications using only the DOM API to obtain
 * editable copies of locked portions of the tree.
 */
public Node cloneNode(boolean deep) {

    if (needsSyncData()) {
        synchronizeData();
    }

    NodeImpl newnode;
    try {
        newnode = (NodeImpl)clone();
    }
    catch (CloneNotSupportedException e) {
        // if we get here we have an error in our program we may as well
        // be vocal about it, so that people can take appropriate action.
        throw new RuntimeException("**Internal Error**" + e);
    }

    // Need to break the association w/ original kids
    newnode.ownerNode      = ownerDocument();
    newnode.isOwned(false);

    // By default we make all clones readwrite,
    // this is overriden in readonly subclasses
    newnode.isReadOnly(false);

    ownerDocument().callUserDataHandlers(this, newnode,
                                         UserDataHandler.NODE_CLONED);

    return newnode;

}
 
Example #7
Source File: DomNode.java    From htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Object setUserData(final String key, final Object data, final UserDataHandler handler) {
    if (userData_ == null) {
        userData_ = new HashMap<>();
    }
    return userData_.put(key, data);
}
 
Example #8
Source File: IIOMetadataNode.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #9
Source File: NodeImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a duplicate of a given node. You can consider this a
 * generic "copy constructor" for nodes. The newly returned object should
 * be completely independent of the source object's subtree, so changes
 * in one after the clone has been made will not affect the other.
 * <P>
 * Note: since we never have any children deep is meaningless here,
 * ParentNode overrides this behavior.
 * @see ParentNode
 *
 * <p>
 * Example: Cloning a Text node will copy both the node and the text it
 * contains.
 * <p>
 * Example: Cloning something that has children -- Element or Attr, for
 * example -- will _not_ clone those children unless a "deep clone"
 * has been requested. A shallow clone of an Attr node will yield an
 * empty Attr of the same name.
 * <p>
 * NOTE: Clones will always be read/write, even if the node being cloned
 * is read-only, to permit applications using only the DOM API to obtain
 * editable copies of locked portions of the tree.
 */
public Node cloneNode(boolean deep) {

    if (needsSyncData()) {
        synchronizeData();
    }

    NodeImpl newnode;
    try {
        newnode = (NodeImpl)clone();
    }
    catch (CloneNotSupportedException e) {
        // if we get here we have an error in our program we may as well
        // be vocal about it, so that people can take appropriate action.
        throw new RuntimeException("**Internal Error**" + e);
    }

    // Need to break the association w/ original kids
    newnode.ownerNode      = ownerDocument();
    newnode.isOwned(false);

    // By default we make all clones readwrite,
    // this is overriden in readonly subclasses
    newnode.isReadOnly(false);

    ownerDocument().callUserDataHandlers(this, newnode,
                                         UserDataHandler.NODE_CLONED);

    return newnode;

}
 
Example #10
Source File: IIOMetadataNode.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #11
Source File: IIOMetadataNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #12
Source File: NodeImpl.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public final Object setUserData(String key, Object data, UserDataHandler handler) {
    if (key == null) {
        throw new NullPointerException("key == null");
    }
    Map<String, UserData> map = document.getUserDataMap(this);
    UserData previous = data == null
            ? map.remove(key)
            : map.put(key, new UserData(data, handler));
    return previous != null ? previous.value : null;
}
 
Example #13
Source File: IIOMetadataNode.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #14
Source File: IIOMetadataNode.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #15
Source File: NodeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a duplicate of a given node. You can consider this a
 * generic "copy constructor" for nodes. The newly returned object should
 * be completely independent of the source object's subtree, so changes
 * in one after the clone has been made will not affect the other.
 * <P>
 * Note: since we never have any children deep is meaningless here,
 * ParentNode overrides this behavior.
 * @see ParentNode
 *
 * <p>
 * Example: Cloning a Text node will copy both the node and the text it
 * contains.
 * <p>
 * Example: Cloning something that has children -- Element or Attr, for
 * example -- will _not_ clone those children unless a "deep clone"
 * has been requested. A shallow clone of an Attr node will yield an
 * empty Attr of the same name.
 * <p>
 * NOTE: Clones will always be read/write, even if the node being cloned
 * is read-only, to permit applications using only the DOM API to obtain
 * editable copies of locked portions of the tree.
 */
public Node cloneNode(boolean deep) {

    if (needsSyncData()) {
        synchronizeData();
    }

    NodeImpl newnode;
    try {
        newnode = (NodeImpl)clone();
    }
    catch (CloneNotSupportedException e) {
        // if we get here we have an error in our program we may as well
        // be vocal about it, so that people can take appropriate action.
        throw new RuntimeException("**Internal Error**" + e);
    }

    // Need to break the association w/ original kids
    newnode.ownerNode      = ownerDocument();
    newnode.isOwned(false);

    // By default we make all clones readwrite,
    // this is overriden in readonly subclasses
    newnode.isReadOnly(false);

    ownerDocument().callUserDataHandlers(this, newnode,
                                         UserDataHandler.NODE_CLONED);

    return newnode;

}
 
Example #16
Source File: IIOMetadataNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * This DOM Level 3 method is not supported for {@code IIOMetadataNode}
 * and will throw a {@code DOMException}.
 * @throws DOMException - always.
 */
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) throws DOMException {
    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                           "Method not supported");
}
 
Example #17
Source File: UnImplNode.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return getOwnerDocument().setUserData( key, data, handler);
}
 
Example #18
Source File: XPathNamespaceImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return null; //PENDING
}
 
Example #19
Source File: ProjectRunnerImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Object setUserData(String key, Object data, UserDataHandler handler) {
    return delegate.setUserData(key, data, handler);
}
 
Example #20
Source File: DefaultNode.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Object setUserData(String key,  Object data, UserDataHandler handler){
   throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
}
 
Example #21
Source File: UnImplNode.java    From j2objc with Apache License 2.0 4 votes vote down vote up
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return getOwnerDocument().setUserData( key, data, handler);
}
 
Example #22
Source File: SyntaxNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Object setUserData(String a, Object b, UserDataHandler c) {
    throw new UOException();
}
 
Example #23
Source File: DTMNodeProxy.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return getOwnerDocument().setUserData( key, data, handler);
}
 
Example #24
Source File: SOAPPartImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Object setUserData(String key,
               Object data,
              UserDataHandler handler) {
    return document.setUserData(key, data, handler);
}
 
Example #25
Source File: SVGAttr.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Object setUserData(final String key, final Object data, final UserDataHandler handler) {
	throw new DOMException(DOMException.INVALID_ACCESS_ERR, SVGDocument.ACTION_NOT_IMPLEMENTED);
}
 
Example #26
Source File: DTMNodeProxy.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return getOwnerDocument().setUserData( key, data, handler);
}
 
Example #27
Source File: DOMNode.java    From lemminx with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Object setUserData(String arg0, Object arg1, UserDataHandler arg2) {
	return null;
}
 
Example #28
Source File: DefaultNode.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Object setUserData(String key,  Object data, UserDataHandler handler){
   throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
}
 
Example #29
Source File: UnImplNode.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return getOwnerDocument().setUserData( key, data, handler);
}
 
Example #30
Source File: XPathNamespaceImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler) {
    return null; //PENDING
}