ilog.views.appframe.settings.xml
Class IlvXMLSettings

java.lang.Object
  extended by ilog.views.appframe.settings.IlvSettings
      extended by ilog.views.appframe.settings.xml.IlvXMLSettings
All Implemented Interfaces:
Document, Node

public class IlvXMLSettings
extends IlvSettings

Defines settings associated with XML streams.
The IlvXMLSettings class provides several methods for initializing XML settings from XML streams:

XML streams that are XML settings for the Java Application Framework application must have the following form:
 <?xml version="1.0" ?>
 <appframe>
    <settings>
        ...
        < Root settings elements >
        ...
    </settings>
 </appframe>
 
Root settings elements can be settings elements that initialize either Java Application Framework components or user components. For example, the "options.xml" file below initializes both an IlvToolBar and some user application options:
 <?xml version="1.0" ?>
 <appframe>
    <settings>
        <toolbar name="default">
            <button actionCommand="OpenDocument">
            <button actionCommand="SaveDocument">
        </toolbar>

        <options
            textEditor="c:\temp\textEditor.exe">
            <save>
              autoRecover="20"
              createBackupCopies="true"
            </save>
        </options>
    </settings>
 </appframe>
 
User application options can be retrieved as shown below:
 IlvApplication application = new IlvApplication();
 ...
 application.addXMLSettings("options.xml";
 application.initialize();
 ...
 IlvSettingsElement optionsElmt = application.selectElement("options");
 String editor = optionsElmt.getString("textEditor", null);
 IlvSettingsElement saveOptionsElmt = options.getFirstChild("save");
 int autoRecover = saveOptionsElmt.getInt("autoRecover", 10);
 boolean createBackup = saveOptionsElmt.getBoolean("createBackupCopies", true);
 
You can find task-oriented documentation and examples of using XML settings in the ILOG JViews Application Framework User's Manual, in the section on Settings.


Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.appframe.settings.IlvSettings
IlvSettings.AttributeID, IlvSettings.IDAttributeMapper, IlvSettings.IDResolver
 
Field Summary
static boolean DEFAULT_PARSE_TEXT
          Constant value that determines if XML settings should automatically set the text of parsed DOM elements to specific attributes.
static String DEFAULT_TAG_TEXT_ATTRIBUTE
          Default name for attributes that store the text of DOM elements parsed for XML settings.
 
Fields inherited from class ilog.views.appframe.settings.IlvSettings
APPLY_DIFF_MODE, EVERY_NODE_KEY, READABLE, SET_MODE, UNREADABLE, VERBOSE, WRITABLE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
IlvXMLSettings()
          Constructs a new IlvXMLSettings.
IlvXMLSettings(String name)
          Constructs a new IlvXMLSettings with the specified name.
 
Method Summary
 Node appendChild(Node newChild)
          Adds the node newChild to the end of the list of children of this node.
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 void commit()
          Commits the content of the settings to the same stream as specified with the method readSettings(URL)
 Attr createAttribute(String name)
          Creates an Attr of the given name.
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
          Creates an attribute of the given qualified name and namespace URI.
 CDATASection createCDATASection(String data)
          Creates a CDATASection node whose value is the specified string.
 Comment createComment(String data)
          Creates a Comment node given the specified string.
 DocumentFragment createDocumentFragment()
          Creates an empty DocumentFragment object.
 Element createElement(String tagName)
          Creates an element of the type specified.
 Element createElementNS(String namespaceURI, String qualifiedName)
          Creates an element of the given qualified name and namespace URI.
 EntityReference createEntityReference(String name)
          Creates an EntityReference object.
protected  IlvSettingsModel createModel(short accessRights)
          Creates an empty DOM model.
 ProcessingInstruction createProcessingInstruction(String target, String data)
          Creates a ProcessingInstruction node given the specified name and data strings.
 Text createTextNode(String data)
          Creates a Text node given the specified string.
 NodeList getChildNodes()
          A NodeList that contains all children of this node.
 DocumentType getDoctype()
          The Document Type Declaration (see DocumentType) associated with this document.
 Document getDocument()
          Returns the DOM document that corresponds to the XML source specified to the XML settings.
 Element getDocumentElement()
          Returns the document element of the Document associated with these settings.
 Element getElementById(String elementId)
          Returns the Element whose ID is given by elementId.
 NodeList getElementsByTagName(String tagname)
          Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
          Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
 Node getFirstChild()
          The first child of this node.
 DOMImplementation getImplementation()
          The DOMImplementation object that handles this document.
 Node getLastChild()
          The last child of this node.
static String GetLocalName(Node node)
          Returns the local name of the specified node.
 String getSettingsRootPath()
          Returns the XPath expression that selects the root element for the XML settings.
 String getTagTextAttributeName()
          Returns the value set with the setTagTextAttributeName(java.lang.String) method or DEFAULT_TAG_TEXT_ATTRIBUTE if this method has not been used.
 URL getXMLFileURL()
          Returns the URL specified with setXMLFileURL(java.net.URL).
 boolean hasChildNodes()
          Determines whether the document associated with these settings has child nodes.
 Node importNode(Node importedNode, boolean deep)
          Imports a node from another document to this document.
 Node insertBefore(Node newChild, Node refChild)
          Inserts the node newChild before the existing child node refChild.
 boolean isSupported(String feature, String version)
          Tests whether the DOM implementation of the Document associated with these settings implements a specific feature and that feature is supported by this node.
 void newDocument()
          Initializes the XML settings as a new DOM document.
 void normalize()
          Puts all Text nodes in the full depth of the sub-tree underneath this Node.
 boolean readSettings(Reader reader)
          Reads the settings from the specified reader.
 boolean readSettings(String systemID)
          Reads the settings from the specified file name.
 boolean readSettings(URL url)
          Reads the settings from the specified file url.
 Node removeChild(Node oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 Node replaceChild(Node newChild, Node oldChild)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 void setCascadingMode(short mode)
          Sets the cascading mode of the XML settings with other settings.
 boolean setDocument(Document document)
          Sets the specified DOM document to the XML settings.
 void setParseTextNodes(boolean parse)
          Determines whether the text of DOM elements that are parsed by the settings should automatically set to a new attribute, the name of which is returned by getTagTextAttributeName().
 boolean setRootElement(Element rootElement)
          Sets the specified DOM element as the new root of elements accessed through the XML settings.
 void setSettingsRootPath(String rootPath)
          Sets the XPath expression that selects the root element for the XML settings.
 void setTagTextAttributeName(String tagTextAttribute)
          Specifies the name of the attribute that contains the text of DOM elements.
 void setXMLFileURL(URL url)
          Sets an XML file that will provide settings data for the settings.
 void writeSettings(URL url)
          Changes the file URL that the XML settings access and save the settings in.
 boolean writeSettingsIn(OutputStream output)
          Writes the settings in the specified output stream.
 boolean writeSettingsIn(URL url)
          Writes the XML settings in the file with the specified url.
 
Methods inherited from class ilog.views.appframe.settings.IlvSettings
addIDResolver, addSettingsElement, adoptNode, areSettingsInitialized, canWrite, compareDocumentPosition, createSettingsElement, ensureCorrespondingElement, ensureSettingsElement, ensureSettingsElement, getAccessRights, getApplication, getAttributes, getBaseURI, getCascadingMode, getDocumentURI, getDomConfig, getFeature, getID, getID, getInputEncoding, getLocalName, getModel, getMutableModel, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSettingsManager, getStrictErrorChecking, getTextContent, getUserData, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttributes, initializeSettings, isDefaultNamespace, isEqualNode, IsEveryNodeKey, isSameNode, lookupNamespaceURI, lookupPrefix, normalizeDocument, removeAllSettingsElements, removeIDResolver, removeSettingsElement, renameNode, select, select, select, selectElement, selectElement, selectElement, selectNodes, setAccessRights, setApplication, setDocumentURI, setID, setModel, setName, setNodeValue, setPrefix, setSettingsManager, setStrictErrorChecking, setTextContent, setUserData, setXmlStandalone, setXmlVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TAG_TEXT_ATTRIBUTE

public static String DEFAULT_TAG_TEXT_ATTRIBUTE
Default name for attributes that store the text of DOM elements parsed for XML settings.

See Also:
DEFAULT_PARSE_TEXT

DEFAULT_PARSE_TEXT

public static boolean DEFAULT_PARSE_TEXT
Constant value that determines if XML settings should automatically set the text of parsed DOM elements to specific attributes.

See Also:
DEFAULT_TAG_TEXT_ATTRIBUTE
Constructor Detail

IlvXMLSettings

public IlvXMLSettings()
Constructs a new IlvXMLSettings.


IlvXMLSettings

public IlvXMLSettings(String name)
Constructs a new IlvXMLSettings with the specified name.

Parameters:
name - The name of this settings source.
Method Detail

readSettings

public boolean readSettings(String systemID)
Reads the settings from the specified file name.

Parameters:
systemID - The file name to read the settings from.
Returns:
true if the settings could be read; false otherwise.

readSettings

public boolean readSettings(Reader reader)
Reads the settings from the specified reader.

Parameters:
reader - The reader to read the settings from.
Returns:
true if the settings could be read; false otherwise.

readSettings

public boolean readSettings(URL url)
Reads the settings from the specified file url.

Parameters:
url - The URL to read the settings from.
Returns:
true if the settings could be read; false otherwise.

setCascadingMode

public void setCascadingMode(short mode)
Sets the cascading mode of the XML settings with other settings.

Overrides:
setCascadingMode in class IlvSettings
Parameters:
mode - The new cascading mode. Can be one of the following values:
See Also:
IlvSettings.getCascadingMode()

setDocument

public boolean setDocument(Document document)
Sets the specified DOM document to the XML settings.

Parameters:
document - The new DOM document associated with the XML settings.
Returns:
true if the specified document is valid and if the settings root path can select an element in the new document; false otherwise.

newDocument

public void newDocument()
Initializes the XML settings as a new DOM document.


setRootElement

public boolean setRootElement(Element rootElement)
Sets the specified DOM element as the new root of elements accessed through the XML settings.

Parameters:
rootElement - The new DOM root element of the XML settings.
Returns:
true if the initialization of the XML settings succeeds using the new root element; false otherwise.

setXMLFileURL

public void setXMLFileURL(URL url)
Sets an XML file that will provide settings data for the settings. This method is similar to the readSettings(URL) method. It allows for initializing the XML settings using bean properties.

Parameters:
url - The URL of the XML file to read settings from.
See Also:
getXMLFileURL()

getXMLFileURL

public URL getXMLFileURL()
Returns the URL specified with setXMLFileURL(java.net.URL).

Returns:
The URL of the XML file.
See Also:
setXMLFileURL(java.net.URL)

getSettingsRootPath

public String getSettingsRootPath()
Returns the XPath expression that selects the root element for the XML settings.
By default, this path is equal to /appframe/settings.

Returns:
The XPath that locates the root element.
See Also:
setSettingsRootPath(java.lang.String)

setSettingsRootPath

public void setSettingsRootPath(String rootPath)
Sets the XPath expression that selects the root element for the XML settings.

Parameters:
rootPath - The XPath to locate the settings root element.
See Also:
getSettingsRootPath()

getDocument

public Document getDocument()
Returns the DOM document that corresponds to the XML source specified to the XML settings.

Returns:
The DOM document or null if the XML source specified to the settings cannot be read.

commit

public void commit()
Commits the content of the settings to the same stream as specified with the method readSettings(URL)

Overrides:
commit in class IlvSettings
See Also:
readSettings(URL)

writeSettings

public void writeSettings(URL url)
Changes the file URL that the XML settings access and save the settings in.

See Also:
commit(), writeSettingsIn(URL)

writeSettingsIn

public boolean writeSettingsIn(URL url)
Writes the XML settings in the file with the specified url. Using this method does not change the current XML stream accessed by the settings.

Returns:
true if the settings can be saved or false if an error occurs.
See Also:
writeSettingsIn(OutputStream), writeSettings(java.net.URL)

writeSettingsIn

public boolean writeSettingsIn(OutputStream output)
Writes the settings in the specified output stream. Using this method does not change the current XML stream accessed by the settings.

Returns:
true if the settings can be saved or false if an error occurs.

getTagTextAttributeName

public String getTagTextAttributeName()
Returns the value set with the setTagTextAttributeName(java.lang.String) method or DEFAULT_TAG_TEXT_ATTRIBUTE if this method has not been used.

See Also:
DEFAULT_TAG_TEXT_ATTRIBUTE

setTagTextAttributeName

public void setTagTextAttributeName(String tagTextAttribute)
Specifies the name of the attribute that contains the text of DOM elements.

Parameters:
tagTextAttribute - The name of the attribute.
See Also:
setParseTextNodes(boolean)

setParseTextNodes

public void setParseTextNodes(boolean parse)
Determines whether the text of DOM elements that are parsed by the settings should automatically set to a new attribute, the name of which is returned by getTagTextAttributeName().


createModel

protected IlvSettingsModel createModel(short accessRights)
Creates an empty DOM model.

Overrides:
createModel in class IlvSettings
Parameters:
accessRights - The type of access that this model is required for. If (accessRigths & WRITABLE) != 0 or if the model is intended to be accessed in Write mode, it has to implement the IlvMutableSettingsModel interface.
Returns:
The newly created settings model. By default, null is returned

GetLocalName

public static String GetLocalName(Node node)
Returns the local name of the specified node.


getDoctype

public DocumentType getDoctype()
The Document Type Declaration (see DocumentType) associated with this document. For HTML documents as well as XML documents without a document type declaration this returns null. The DOM Level 2 does not support editing the Document Type Declaration. docType cannot be altered in any way, including through the use of methods inherited from the Node interface, such as insertNode or removeNode.
The implementation of this method returns the document type of the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getDoctype in interface Document
Overrides:
getDoctype in class IlvSettings
Returns:
The implementation of this method returns null. It is overridden by the IlvXMLSettings class to return the document type of the associated DOM document.
See Also:
getDoctype()

getImplementation

public DOMImplementation getImplementation()
The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.
The implementation of this method returns the DOM implementation of the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getImplementation in interface Document
Overrides:
getImplementation in class IlvSettings
Returns:
The implementation of this method returns null. It is overridden by the IlvXMLSettings class to return the document implementation of the associated DOM document.
See Also:
getImplementation()

getDocumentElement

public Element getDocumentElement()
Returns the document element of the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getDocumentElement in interface Document
Overrides:
getDocumentElement in class IlvSettings
Returns:
The document element.
See Also:
getDocumentElement()

createElement

public Element createElement(String tagName)
                      throws DOMException
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
In addition, if there are known attributes with default values, Attr nodes representing them are automatically created and attached to the element.
To create an element with a qualified name and namespace URI, use the createElementNS(java.lang.String, java.lang.String) method.
The implementation of this method delegates the creation of the element to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createElement in interface Document
Overrides:
createElement in class IlvSettings
Parameters:
tagName - The name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the tagName parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation.
Returns:
A new Element object with the nodeName attribute set to tagName, and localName, prefix, and namespaceURI set to null.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
See Also:
IlvSettings.createSettingsElement(java.lang.String)

createDocumentFragment

public DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object.
The implementation of this method delegates the creation of the document fragment to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createDocumentFragment in interface Document
Overrides:
createDocumentFragment in class IlvSettings
Returns:
A new DocumentFragment.
See Also:
createDocumentFragment()

createTextNode

public Text createTextNode(String data)
Creates a Text node given the specified string.
The implementation of this method delegates the creation of the Text node to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createTextNode in interface Document
Overrides:
createTextNode in class IlvSettings
Parameters:
data - The data for the node.
Returns:
The new Text object.
See Also:
createTextNode(java.lang.String)

createComment

public Comment createComment(String data)
Creates a Comment node given the specified string.
The implementation of this method delegates the creation of the Comment to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createComment in interface Document
Overrides:
createComment in class IlvSettings
Parameters:
data - The data for the node.
Returns:
The new Comment object.
See Also:
createComment(java.lang.String)

createCDATASection

public CDATASection createCDATASection(String data)
                                throws DOMException
Creates a CDATASection node whose value is the specified string.
The implementation of this method delegates the creation of the CDATASection to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createCDATASection in interface Document
Overrides:
createCDATASection in class IlvSettings
Parameters:
data - The data for the CDATASection contents.
Returns:
The new CDATASection object.
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
See Also:
createCDATASection(java.lang.String)

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
                                                  throws DOMException
Creates a ProcessingInstruction node given the specified name and data strings.
The implementation of this method delegates the creation of the ProcessingInstruction to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createProcessingInstruction in interface Document
Overrides:
createProcessingInstruction in class IlvSettings
Parameters:
target - The target part of the processing instruction.
data - The data for the node.
Returns:
The new ProcessingInstruction object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
See Also:
createProcessingInstruction(java.lang.String, java.lang.String)

createAttribute

public Attr createAttribute(String name)
                     throws DOMException
Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttributeNode method.
To create an attribute with a qualified name and namespace URI, use the createAttributeNS(java.lang.String, java.lang.String) method.
The implementation of this method delegates the creation of the attribute to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createAttribute in interface Document
Overrides:
createAttribute in class IlvSettings
Parameters:
name - The name of the attribute.
Returns:
A new Attr object with the nodeName attribute set to name, and localName, prefix, and namespaceURI set to null. The value of the attribute is the empty string.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
See Also:
createAttribute(java.lang.String)

createEntityReference

public EntityReference createEntityReference(String name)
                                      throws DOMException
Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.If any descendant of the Entity node has an unbound namespace prefix, the corresponding descendant of the created EntityReference node is also unbound; (its namespaceURI is null). The DOM Level 2 does not support any mechanism to resolve namespace prefixes.
The implementation of this method delegates the creation of the EntityReference to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createEntityReference in interface Document
Overrides:
createEntityReference in class IlvSettings
Parameters:
name - The name of the entity to reference.
Returns:
The new EntityReference object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
See Also:
createEntityReference(java.lang.String)

getElementsByTagName

public NodeList getElementsByTagName(String tagname)
Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
The implementation of this method delegates the selection of the elements to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getElementsByTagName in interface Document
Overrides:
getElementsByTagName in class IlvSettings
Parameters:
tagname - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A new NodeList object containing all the matched Elements.

importNode

public Node importNode(Node importedNode,
                       boolean deep)
                throws DOMException
Imports a node from another document to this document.
The implementation of this method delegates this task to the Document associated with these settings. This document is accessible with the method getDocument().
For more info on what this method is supposed to do, refer to the documentation of the method Document.importNode(org.w3c.dom.Node, boolean).

Specified by:
importNode in interface Document
Overrides:
importNode in class IlvSettings
Parameters:
importedNode - The node to import.
deep - If true, recursively import the subtree under the specified node; if false, import only the node itself, as explained above. This has no effect on Attr , EntityReference, and Notation nodes.
Returns:
The imported node that belongs to this Document.
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
Since:
DOM Level 2
See Also:
importNode(org.w3c.dom.Node, boolean)

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
                        throws DOMException
Creates an element of the given qualified name and namespace URI.
The implementation of this method delegates the creation of the element to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createElementNS in interface Document
Overrides:
createElementNS in class IlvSettings
Parameters:
namespaceURI - The namespace URI of the element to create.
qualifiedName - The qualified name of the element type to instantiate.
Returns:
A new Element object with the following attributes:AttributeValueNode.nodeName qualifiedNameNode.namespaceURI namespaceURINode.prefixprefix, extracted from qualifiedName, or null if there is no prefixNode.localNamelocal name, extracted from qualifiedNameElement.tagName qualifiedName
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" .
Since:
DOM Level 2

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
                       throws DOMException
Creates an attribute of the given qualified name and namespace URI.
The implementation of this method delegates the creation of the attribute to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
createAttributeNS in interface Document
Overrides:
createAttributeNS in class IlvSettings
Parameters:
namespaceURI - The namespace URI of the attribute to create.
qualifiedName - The qualified name of the attribute to instantiate.
Returns:
A new Attr object with the following attributes: AttributeValueNode.nodeNamequalifiedName Node.namespaceURInamespaceURI Node.prefixprefix, extracted from qualifiedName, or null if there is no prefixNode.localNamelocal name, extracted from qualifiedNameAttr.name qualifiedNameNode.nodeValuethe empty string
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", or if the qualifiedName is "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
Since:
DOM Level 2

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
The implementation of this method delegates the selection of the elements to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getElementsByTagNameNS in interface Document
Overrides:
getElementsByTagNameNS in class IlvSettings
Parameters:
namespaceURI - The namespace URI of the elements to match on. The special value "*" matches all namespaces.
localName - The local name of the elements to match on. The special value "*" matches all local names.
Returns:
A new NodeList object containing all the matched Elements.
Since:
DOM Level 2

getElementById

public Element getElementById(String elementId)
Returns the Element whose ID is given by elementId. If no such element exists, returns null.
The implementation of this method delegates the selection of the element to the Document associated with these settings. This document is accessible with the method getDocument().
For more information on the behavior of this method, refer to the documentation of the method Document.getElementById(java.lang.String).

Specified by:
getElementById in interface Document
Overrides:
getElementById in class IlvSettings
Parameters:
elementId - The unique id value for an element.
Returns:
The matching element.
Since:
DOM Level 2
See Also:
getElementById(java.lang.String)

getChildNodes

public NodeList getChildNodes()
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
The implementation of this method delegates the selection of the nodes to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getChildNodes in interface Node
Overrides:
getChildNodes in class IlvSettings
Returns:
The list of elements given by a call to IlvSettings.select(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement[]) with null as the two parameters.

getFirstChild

public Node getFirstChild()
The first child of this node. If there is no such node, this returns null.
The implementation of this method delegates the selection of the node to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getFirstChild in interface Node
Overrides:
getFirstChild in class IlvSettings
See Also:
IlvSettings.getChildNodes()

getLastChild

public Node getLastChild()
The last child of this node. If there is no such node, this returns null.
The implementation of this method delegates the selection of the node to the Document associated with these settings. This document is accessible with the method getDocument().

Specified by:
getLastChild in interface Node
Overrides:
getLastChild in class IlvSettings

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children.
If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

Specified by:
insertBefore in interface Node
Overrides:
insertBefore in class IlvSettings
Parameters:
newChild - The node to insert.
refChild - The reference node, i.e., the node before which the new node must be inserted.
Returns:
The node being inserted.
Throws:
DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
The implementation of this method delegates this task to the the Document associated with these settings. This document is accessible with the method getDocument().
For more information on the behavior of this method, refer to the documentation of the method Node.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node).

Specified by:
replaceChild in interface Node
Overrides:
replaceChild in class IlvSettings
Parameters:
newChild - The new node to put in the child list.
oldChild - The node being replaced in the list.
Returns:
The node replaced.
Throws: