org.vectomatic.dom.svg.impl.Attr Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lib-gwt-svg Show documentation
Show all versions of lib-gwt-svg Show documentation
A GWT library to access the SVG functionalities of web browsers
/**********************************************
* Copyright (C) 2010 Lukas Laag
* This file is part of lib-gwt-svg.
*
* libgwtsvg is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libgwtsvg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libgwtsvg. If not, see http://www.gnu.org/licenses/
**********************************************/
/*
* Copyright (c) 2004 World Wide Web Consortium,
*
* (Massachusetts Institute of Technology, European Research Consortium for
* Informatics and Mathematics, Keio University). All Rights Reserved. This
* work is distributed under the W3C(r) Software License [1] in the hope that
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*/
package org.vectomatic.dom.svg.impl;
import org.w3c.dom.DOMException;
import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
/**
* Overlay class for DOM Attr
* @author laaglu
*/
public class Attr extends Node {
/**
* Constructor
*/
protected Attr() {
}
/**
* Returns the name of this attribute. If OMNode.localName
is
* different from null
, this attribute is a qualified name.
* @return the attribute name
*/
public final native String getName() /*-{
return this.name;
}-*/;
/**
* On retrieval, the value of the attribute is returned as a string.
* Character and general entity references are replaced with their
* values. See also the method getAttribute
on the
* Element
interface.
*
On setting, this creates a Text
node with the unparsed
* contents of the string, i.e. any characters that an XML processor
* would recognize as markup are instead treated as literal text. See
* also the method Element.setAttribute()
.
*
Some specialized implementations, such as some [SVG 1.1]
* implementations, may do normalization automatically, even after
* mutation; in such case, the value on retrieval may differ from the
* value on setting.
* @return the attribute value
*/
public final native String getValue() /*-{
return this.value;
}-*/;
/**
* On retrieval, the value of the attribute is returned as a string.
* Character and general entity references are replaced with their
* values. See also the method getAttribute
on the
* Element
interface.
*
On setting, this creates a Text
node with the unparsed
* contents of the string, i.e. any characters that an XML processor
* would recognize as markup are instead treated as literal text. See
* also the method Element.setAttribute()
.
*
Some specialized implementations, such as some [SVG 1.1]
* implementations, may do normalization automatically, even after
* mutation; in such case, the value on retrieval may differ from the
* value on setting.
* @param value the attribute value
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
*/
public final native void setValue(String value) throws JavaScriptException /*-{
this.value = value;
}-*/;
/**
* Returns whether this attribute is known to be of type ID (i.e. to
* contain an identifier for its owner element) or not. When it is and
* its value is unique, the ownerElement
of this attribute
* can be retrieved using the method Document.getElementById
* . The implementation could use several ways to determine if an
* attribute node is known to contain an identifier:
*
* - If validation
* occurred using an XML Schema [XML Schema Part 1]
* while loading the document or while invoking
*
Document.normalizeDocument()
, the post-schema-validation
* infoset contributions (PSVI contributions) values are used to
* determine if this attribute is a schema-determined ID attribute using
* the
* schema-determined ID definition in [XPointer]
* .
*
* - If validation occurred using a DTD while loading the document or
* while invoking
Document.normalizeDocument()
, the infoset [type definition] value is used to determine if this attribute is a DTD-determined ID
* attribute using the
* DTD-determined ID definition in [XPointer]
* .
*
* - from the use of the methods
Element.setIdAttribute()
,
* Element.setIdAttributeNS()
, or
* Element.setIdAttributeNode()
, i.e. it is an
* user-determined ID attribute;
* Note: XPointer framework (see section 3.2 in [XPointer]
* ) consider the DOM user-determined ID attribute as being part of the
* XPointer externally-determined ID definition.
*
* - using mechanisms that
* are outside the scope of this specification, it is then an
* externally-determined ID attribute. This includes using schema
* languages different from XML schema and DTD.
*
*
*
If validation occurred while invoking
* Document.normalizeDocument()
, all user-determined ID
* attributes are reset and all attribute nodes ID information are then
* reevaluated in accordance to the schema used. As a consequence, if
* the Attr.schemaTypeInfo
attribute contains an ID type,
* isId
will always return true.
* @since DOM Level 3
*/
public final native boolean isId() /*-{
return this.isId;
}-*/;
/**
* The Element
node this attribute is attached to or
* null
if this attribute is not in use.
*/
public final native Element getOwnerElement() /*-{
return this.ownerElement;
}-*/;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy