public class IlvSettings extends Object implements Document
IlvMenuBar
. They
also provide an API for initializing user objects.
Settings model
Data accessed by the settings is specified in an IlvSettingsModel
that is instantiated with the createModel(short)
method.
Settings classes are provided for initializing the settings from different
types of settings model:
IlvXMLSettings
class initializes
the settings from XML streams.IlvBeanSettings
class initializes
the settings from bean properties.Settings query
Objects accessed by settings are selected using query methods:
selectElement(java.lang.String, java.lang.String, java.lang.Object)
selectElement(ilog.views.appframe.settings.IlvSettingsQuery)
select(ilog.views.appframe.settings.IlvSettingsQuery)
select(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement[])
select(ilog.views.appframe.settings.IlvSettingsQuery, ilog.views.appframe.settings.IlvSettingsElement[])
IlvSettingsQuery
for more information on how
to construct a query.
Result elements
Objects of the settings model selected by those queries are not directly
accessible to the user.
Instead, IlvSettingsNode
instances are returned. Settings nodes can be
either IlvSettingsAttribute
or IlvSettingsElement
instances.
They facilitate the manipulation of the objects of the model in many ways.
First, they cascade those objects transparently. If the settings are a settings
manager, objects of the model can be selected in several settings with the
same query. The settings element cascades the attributes of those objects
and gives access to them as only one node.
Secondly, they return typed values to the user, such as
IlvSettingsElement.getInt(java.lang.String)
or IlvSettingsElement.getFont(java.lang.String)
, which
ease the initialization of user objects initialized from the settings.
Customized settings
You can initialize your settings from other sources
by defining your own IlvSettingsModel
or IlvMutableSettingsModel
implementation. This settings model can be set to an IlvSettings
.
Its data is accessible with all the query
methods of the IlvSettings
class returning the same resulting
settings nodes,
Modifier and Type | Class and Description |
---|---|
static class |
IlvSettings.AttributeID
Defines ID values that contain the value and the name of an attribute.
|
static class |
IlvSettings.IDAttributeMapper
Maps the ID value of a settings element with the value of a specified
attribute.
|
static interface |
IlvSettings.IDResolver
Provides ID values for objects of the settings models.
|
Modifier and Type | Field and Description |
---|---|
static short |
APPLY_DIFF_MODE
Cascading constant used when settings are merged with other settings
within a settings manager.
|
static String |
EVERY_NODE_KEY
Key to be used in a query to specify that all the nodes that the axis of
the query applies to must be selected.
|
static short |
READABLE
Access right constant used to specify that the settings elements can be read.
|
static short |
SET_MODE
Cascading constant used when settings are merged with other settings
within a settings manager.
|
static short |
UNREADABLE
Access right constant used to specify that the settings elements can neither
be read nor modified.
|
static boolean |
VERBOSE
Static variable that specifies whether verbose strings depending on the
Settings API should be printed on the
System.out output. |
static short |
WRITABLE
Access right constant used to specify that the settings elements can be modified.
|
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 and Description |
---|
IlvSettings()
Constructs a new empty
IlvSettings , without associated
model and without name. |
IlvSettings(String name)
Constructs a new
IlvSettings with the specified name . |
IlvSettings(String name,
IlvSettingsModel model)
Constructs settings with the specified name and model.
|
Modifier and Type | Method and Description |
---|---|
void |
addIDResolver(IlvSettings.IDResolver resolver)
Adds the specified ID resolver for providing ID attributes for new
settings types.
|
void |
addSettingsElement(IlvSettingsElement parentElement,
IlvSettingsElement element,
int index)
Adds the specified element to the specified parent.
|
Node |
adoptNode(Node source) |
Node |
appendChild(Node newChild)
Adds the node
newChild to the end of the list of children
of this node. |
boolean |
areSettingsInitialized()
Determines whether those settings are initialized.
|
boolean |
canWrite()
Determines whether those settings can be modified by checking if the
value returned by the method
getAccessRights() contains the
tag value WRITABLE . |
Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes.
|
void |
commit()
Commits the changes made on the model associated with those settings.
|
short |
compareDocumentPosition(Node other) |
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 the model of those settings.
|
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
Creates a
ProcessingInstruction node given the specified
name and data strings. |
IlvSettingsElement |
createSettingsElement(String type)
Creates a new element with the specified type.
|
Text |
createTextNode(String data)
Creates a
Text node given the specified string. |
Object |
ensureCorrespondingElement(IlvSettingsElement element)
Ensures that the specified settings
element has a
cascaded element in these settings. |
IlvSettingsElement |
ensureSettingsElement(IlvSettingsQuery query)
Ensures that a settings element of those settings is selectable from
the specified
query . |
IlvSettingsElement |
ensureSettingsElement(String type)
Ensures that a root settings element with the
specified
type exists in those settings. |
short |
getAccessRights()
Returns the access rights for reading and modifying the model associated
with those settings.
|
IlvApplication |
getApplication()
Returns the application of those settings.
|
NamedNodeMap |
getAttributes()
Returns
null as a document has no attributes. |
String |
getBaseURI() |
short |
getCascadingMode()
Specifies how the content of those settings should be merged with other
settings if those settings are inserted into an
IlvSettingsManager manager. |
NodeList |
getChildNodes()
A
NodeList that contains all children of this node. |
DocumentType |
getDoctype()
The Document Type Declaration (see
DocumentType )
associated with this document. |
Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child
node that is the root element of the document.
|
String |
getDocumentURI() |
DOMConfiguration |
getDomConfig() |
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. |
Object |
getFeature(String feature,
String version) |
Node |
getFirstChild()
The first child of this node.
|
Object |
getID(Object element)
Returns the ID value for the specified settings element owned by those
settings.
|
protected Object |
getID(Object element,
String type,
IlvSettingsModel model)
Returns the ID value that uniquely identifies the specified object of
the model among other objects with the same type and parent.
|
DOMImplementation |
getImplementation()
The
DOMImplementation object that handles this document. |
String |
getInputEncoding() |
Node |
getLastChild()
The last child of this node.
|
String |
getLocalName()
Returns the local part of the qualified name of this node.
|
IlvSettingsModel |
getModel()
Returns the model of those settings.
|
IlvMutableSettingsModel |
getMutableModel()
Returns the mutable model associated with this model.
|
String |
getName()
Returns the name of those settings.
|
String |
getNamespaceURI()
Implementation of the method
Node.getNamespaceURI() method. |
Node |
getNextSibling()
The node immediately following this node.
|
String |
getNodeName()
The name of this node.
|
short |
getNodeType()
A code representing the type of this node.
|
String |
getNodeValue()
null as this node is a document and has not associated
value. |
Document |
getOwnerDocument()
The
Document object associated with this node. |
Node |
getParentNode()
The parent of this node.
|
String |
getPrefix()
Implementation of the method
Node.getPrefix() method. |
Node |
getPreviousSibling()
The node immediately preceding this node.
|
IlvSettingsManager |
getSettingsManager()
Returns the settings manager that owns those settings.
|
boolean |
getStrictErrorChecking() |
String |
getTextContent() |
Object |
getUserData(String key) |
String |
getXmlEncoding() |
boolean |
getXmlStandalone() |
String |
getXmlVersion() |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes.
|
boolean |
hasChildNodes()
Returns whether this node has any children.
|
Node |
importNode(Node importedNode,
boolean deep)
Imports a node from another document to this document.
|
boolean |
initializeSettings()
Initializes the settings.
|
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node
newChild before the existing child node
refChild . |
boolean |
isDefaultNamespace(String namespaceURI) |
boolean |
isEqualNode(Node arg) |
static boolean |
IsEveryNodeKey(String key)
Determines whether the specified key selects all the nodes if used
in a query.
|
boolean |
isSameNode(Node other) |
boolean |
isSupported(String feature,
String version)
Tests whether the DOM implementation implements a specific feature and
that feature is supported by this node.
|
String |
lookupNamespaceURI(String prefix) |
String |
lookupPrefix(String namespaceURI) |
void |
normalize()
Puts all
Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
void |
normalizeDocument() |
boolean |
removeAllSettingsElements(IlvSettingsElement parent,
String type)
Removes all the settings elements that are children of the specified
parent element and have the specified type. |
Node |
removeChild(Node oldChild)
Removes the child node indicated by
oldChild from the list
of children, and returns it. |
boolean |
removeIDResolver(IlvSettings.IDResolver resolver)
Removes the specified ID resolver from the list of mappers stored in those
settings.
|
boolean |
removeSettingsElement(IlvSettingsElement element)
Removes the model element of the settings referenced by the
specified settings element.
|
Node |
renameNode(Node n,
String namespaceURI,
String qualifiedName) |
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces the child node
oldChild with newChild
in the list of children, and returns the oldChild node. |
IlvSettingsElement[] |
select(IlvSettingsQuery query)
Returns the settings elements selected by the specified query.
|
IlvSettingsElement[] |
select(IlvSettingsQuery query,
IlvSettingsElement[] contextElements)
Returns the settings elements selected by the specified query from the
specified settings element.
|
IlvSettingsElement[] |
select(String type,
IlvSettingsElement[] contextElements)
Returns the settings elements with the specified settings type
and children of the specified
contextElements . |
IlvSettingsElement |
selectElement(IlvSettingsQuery query)
Returns the first settings element selected by the specified query.
|
IlvSettingsElement |
selectElement(String type)
Returns the first root settings element with the specified type.
|
IlvSettingsElement |
selectElement(String type,
String attributeName,
Object attributeValue)
Returns the first root settings element selected by the specified query
parameters.
|
IlvSettingsNode[] |
selectNodes(IlvSettingsQuery query)
Returns the settings nodes selected by the specified query.
|
void |
setAccessRights(short accessRights)
Sets the rights for accessing the model associated with those settings.
|
void |
setApplication(IlvApplication application)
Sets the application that owns those settings.
|
void |
setCascadingMode(short mode)
Sets the cascading mode of those settings with other settings.
|
void |
setDocumentURI(String documentURI) |
protected boolean |
setID(Object element,
Object id,
String type,
IlvMutableSettingsModel model)
Sets the specified ID value to the specified object of the model.
|
void |
setModel(IlvSettingsModel model)
Sets the model of those settings.
|
void |
setName(String name)
Sets the name of those settings.
|
void |
setNodeValue(String nodeValue)
Sets a value to this node.
|
void |
setPrefix(String prefix)
This method has no effects as documents do not support prefixes.
|
void |
setSettingsManager(IlvSettingsManager manager)
Sets the settings manager that owns those settings.
|
void |
setStrictErrorChecking(boolean strictErrorChecking) |
void |
setTextContent(String textContent) |
Object |
setUserData(String key,
Object data,
UserDataHandler handler) |
void |
setXmlStandalone(boolean xmlStandalone) |
void |
setXmlVersion(String xmlVersion) |
public static final short WRITABLE
public static final short READABLE
public static final short UNREADABLE
public static final short SET_MODE
public static final short APPLY_DIFF_MODE
public static String EVERY_NODE_KEY
IsEveryNodeKey(java.lang.String)
public static boolean VERBOSE
System.out
output.
If true
, verbose messages will be printed;
if false
, there
will be no output specific to the Settings API printed. By default,
the value of this variable is false
.
public IlvSettings()
IlvSettings
, without associated
model and without name.public IlvSettings(String name)
IlvSettings
with the specified name
.name
- The name of the settingsgetName()
,
setModel(ilog.views.appframe.settings.IlvSettingsModel)
public IlvSettings(String name, IlvSettingsModel model)
name
- The name of the settings.model
- The new model of those settings.getName()
,
setModel(ilog.views.appframe.settings.IlvSettingsModel)
public String getBaseURI()
getBaseURI
in interface Node
public short compareDocumentPosition(Node other) throws DOMException
compareDocumentPosition
in interface Node
DOMException
public String getTextContent() throws DOMException
getTextContent
in interface Node
DOMException
public void setTextContent(String textContent) throws DOMException
setTextContent
in interface Node
DOMException
public boolean isSameNode(Node other)
isSameNode
in interface Node
public String lookupPrefix(String namespaceURI)
lookupPrefix
in interface Node
public boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace
in interface Node
public String lookupNamespaceURI(String prefix)
lookupNamespaceURI
in interface Node
public boolean isEqualNode(Node arg)
isEqualNode
in interface Node
public Object getFeature(String feature, String version)
getFeature
in interface Node
public Object setUserData(String key, Object data, UserDataHandler handler)
setUserData
in interface Node
public Object getUserData(String key)
getUserData
in interface Node
public String getInputEncoding()
getInputEncoding
in interface Document
public String getXmlEncoding()
getXmlEncoding
in interface Document
public boolean getXmlStandalone()
getXmlStandalone
in interface Document
public void setXmlStandalone(boolean xmlStandalone) throws DOMException
setXmlStandalone
in interface Document
DOMException
public String getXmlVersion()
getXmlVersion
in interface Document
public void setXmlVersion(String xmlVersion) throws DOMException
setXmlVersion
in interface Document
DOMException
public boolean getStrictErrorChecking()
getStrictErrorChecking
in interface Document
public void setStrictErrorChecking(boolean strictErrorChecking)
setStrictErrorChecking
in interface Document
public String getDocumentURI()
getDocumentURI
in interface Document
public void setDocumentURI(String documentURI)
setDocumentURI
in interface Document
public Node adoptNode(Node source) throws DOMException
adoptNode
in interface Document
DOMException
public DOMConfiguration getDomConfig()
getDomConfig
in interface Document
public void normalizeDocument()
normalizeDocument
in interface Document
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
renameNode
in interface Document
DOMException
public String getName()
setName(java.lang.String)
public void setName(String name)
name
- The new name of those settings.getName()
public boolean initializeSettings()
true
.areSettingsInitialized()
public boolean areSettingsInitialized()
true
if those settings are initialized; false
otherwise.initializeSettings()
public void setModel(IlvSettingsModel model)
model
- The new model of those settings.getModel()
public IlvSettingsModel getModel()
public IlvMutableSettingsModel getMutableModel()
IlvMutableSettingsModel
,
null
will be returned.public IlvSettingsManager getSettingsManager()
public void setSettingsManager(IlvSettingsManager manager)
manager
- The new settings manager that owns those settings.getSettingsManager()
public void setApplication(IlvApplication application)
application
- The new application of those settings.getApplication()
public IlvApplication getApplication()
public void commit()
getModel()
public short getAccessRights()
IlvMutableSettingsModel
interface, the tag value
WRITABLE
is automatically removed from the returned value.
UNREADABLE
is returned if no model
is associated with those settings.setAccessRights(short)
public void setAccessRights(short accessRights)
accessRights
- The new rights for accessing the model of those settings.getAccessRights()
public boolean canWrite()
getAccessRights()
contains the
tag value WRITABLE
.protected Object getID(Object element, String type, IlvSettingsModel model)
addIDResolver(ilog.views.appframe.settings.IlvSettings.IDResolver)
.
If this search fails, all the attributes of the specified element
will be scanned. If an attribute with the name
"ID"
is found, its value will be returned. Otherwise, if an attribute
with the name "name"
is found, its value will be returned. Comparison
between attribute names and those two names is case insensitive.
If no attributes with one of those two names is found, null
will be returned.
element
- The element to retrieve the ID value from.type
- The settings type of the specified element that can be
retrieved with the code getModel().getType(element)
.model
- The settings model that owns the specified element. If those
settings are not a settings manager, this parameter is equal to
getModel()
. Otherwise, this parameter authorizes the settings
manager for introspection of the values of the specified element.null
if the element does not
have an ID.getID(Object)
,
setID(java.lang.Object, java.lang.Object, java.lang.String, IlvMutableSettingsModel)
,
addIDResolver(ilog.views.appframe.settings.IlvSettings.IDResolver)
,
removeIDResolver(ilog.views.appframe.settings.IlvSettings.IDResolver)
public Object getID(Object element)
getID(java.lang.Object, java.lang.String, IlvSettingsModel)
with the specified element, the settings type of this element,
and the settings model of those settings respectively as the parameters.getID(Object, String, IlvSettingsModel)
protected boolean setID(Object element, Object id, String type, IlvMutableSettingsModel model)
element
- The element to set the ID to.id
- The ID value to set the specified element to.type
- The type of the specified element.model
- The settings model that owns the specified settings element.true
if the ID value could be set to the
element or false
if no ID is defined for the specified type.getID(java.lang.Object, java.lang.String, IlvSettingsModel)
public void addIDResolver(IlvSettings.IDResolver resolver)
resolver
- The resolver to add.removeIDResolver(ilog.views.appframe.settings.IlvSettings.IDResolver)
,
IlvSettings.IDResolver
public boolean removeIDResolver(IlvSettings.IDResolver resolver)
true
if this resolver was added to those settings;
false
otherwise.addIDResolver(ilog.views.appframe.settings.IlvSettings.IDResolver)
public IlvSettingsElement selectElement(IlvSettingsQuery query)
query
- The query.null
if no settings elements could be found.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
public IlvSettingsElement selectElement(String type, String attributeName, Object attributeValue)
attributeName
equal to attributeValue
is
returned.type
- The type of the element to retrieve.attributeName
- The name of the attribute to match the value of.attributeValue
- The value of the attribute to compare.null
if no settings elements could be found.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
public IlvSettingsElement selectElement(String type)
type
- The type of the element to retrieve.null
if no elements
are found.IlvSettingsQuery
,
IlvSettingsElement.getFirstChild(java.lang.String)
public IlvSettingsElement[] select(IlvSettingsQuery query)
query
- The query.IlvSettingsQuery
,
IlvSettingsElement
public IlvSettingsNode[] selectNodes(IlvSettingsQuery query)
IlvSettingsElement
or IlvSettingsAttribute
instances.query
- The query.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsAttribute
public IlvSettingsElement[] select(String type, IlvSettingsElement[] contextElements)
contextElements
.type
- The type of the settings elements to return.contextElements
- The elements to start the selection from. If
this array is null
, the root settings elements of those
settings with the specified type will be returned.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
public IlvSettingsElement[] select(IlvSettingsQuery query, IlvSettingsElement[] contextElements)
query
- The query that selects the elements to retrieve.contextElements
- The elements to start the selection from. If
null
, the selection will start from the root elements of all
the settings added to the application.public IlvSettingsElement ensureSettingsElement(IlvSettingsQuery query)
query
. If no settings element could be
selected from the query, the method attempts to create a new settings
element and add it to the settings so that it can be selectable from the
specified query.query
- The settings query that selects the returned element.null
if no settings element could be found and if no
settings element could be created from the specified query
.selectElement(IlvSettingsQuery)
,
ensureSettingsElement(String)
,
IlvSettingsElement.ensureChildElement(IlvSettingsQuery)
public IlvSettingsElement ensureSettingsElement(String type)
type
exists in those settings.
If no root element could be found with the specified type,
a new settings element is created with this type and added as a root
element of those settings.type
- The type of the root settings element to retrieve.type
.ensureSettingsElement(IlvSettingsQuery)
,
IlvSettingsElement.ensureChildElement(String)
public short getCascadingMode()
IlvSettingsManager
manager.
This mode can have one of the following values:
SET_MODE
The data of those settings erase data with the
same keys defined in settings of lower priority.APPLY_DIFF_MODE
The data of those settings must be merged
with data defined in settings of lower priority, when both lots of data have
the same key.setCascadingMode(short)
public void setCascadingMode(short mode)
mode
- The new cascading mode. Can be one of the following values:
getCascadingMode()
public IlvSettingsElement createSettingsElement(String type)
null
if those settings do not support the
specified type.public boolean removeSettingsElement(IlvSettingsElement element)
element
- The settings element to remove.true
if the element could be removed;
false
otherwise.addSettingsElement(ilog.views.appframe.settings.IlvSettingsElement, ilog.views.appframe.settings.IlvSettingsElement, int)
public void addSettingsElement(IlvSettingsElement parentElement, IlvSettingsElement element, int index)
parentElement
- The settings element to add a child to.element
- The settings element to add.index
- The insertion index.removeSettingsElement(ilog.views.appframe.settings.IlvSettingsElement)
public boolean removeAllSettingsElements(IlvSettingsElement parent, String type)
parent
element and have the specified type.parent
- The parent element to remove child elements from.
If null
, all the root elements of those settings with the
specified type will be removed.type
- The settings type of the elements to remove. If null
,
all the child elements will be removed.true
if all the child elements could be removed;
false
otherwise.public Object ensureCorrespondingElement(IlvSettingsElement element)
element
has a
cascaded element in these settings.element
- The settings element to make corresponding in these
settings.protected IlvSettingsModel createModel(short accessRights)
setModel(ilog.views.appframe.settings.IlvSettingsModel)
method.
If the accessRights
parameter contains the WRITABLE
tag, it is possible that a model has already been created and set to
those settings, if this model does not implement the
IlvMutableSettingsModel
interface.
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.null
is returnedpublic DocumentType getDoctype()
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
.getDoctype
in interface Document
null
.
It is overridden by the
IlvXMLSettings
class to
return the document type of the associated DOM document.IlvXMLSettings.getDoctype()
public DOMImplementation getImplementation()
DOMImplementation
object that handles this document. A
DOM application may use objects from multiple implementations.getImplementation
in interface Document
null
.
It is overridden by the
IlvXMLSettings
class to
return the document implementation of the associated DOM document.IlvXMLSettings.getImplementation()
public Element getDocumentElement()
getDocumentElement
in interface Document
selectElement(java.lang.String, java.lang.String, java.lang.Object)
with null
given for all the parameters. If no element
is selected, this method returns null
.IlvXMLSettings.getDocumentElement()
public Element createElement(String tagName) throws DOMException
Element
interface, so attributes
can be specified directly on the returned object.
Attr
nodes representing them are automatically created
and attached to the element.
createElementNS
method.
createSettingsElement(java.lang.String)
.createElement
in interface Document
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.Element
object with the
nodeName
attribute set to tagName
, and
localName
, prefix
, and
namespaceURI
set to null
.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.createSettingsElement(java.lang.String)
public DocumentFragment createDocumentFragment()
DocumentFragment
object.createDocumentFragment
in interface Document
null
. It is overridden by the
IlvXMLSettings
class to
return a new document fragment created by the associated DOM document.IlvXMLSettings.createDocumentFragment()
public Text createTextNode(String data)
Text
node given the specified string.createTextNode
in interface Document
data
- The data for the node.null
.
It is overridden by the
IlvXMLSettings
class to
return a new Text
created by the associated DOM document.IlvXMLSettings.createTextNode(java.lang.String)
public Comment createComment(String data)
Comment
node given the specified string.createComment
in interface Document
data
- The data for the node.null
.
It is overridden by the
IlvXMLSettings
class to
return a new comment created by the associated DOM document.IlvXMLSettings.createComment(java.lang.String)
public CDATASection createCDATASection(String data) throws DOMException
CDATASection
node whose value is the specified
string.createCDATASection
in interface Document
data
- The data for the CDATASection
contents.null
.
It is overridden by the
IlvXMLSettings
class to
return a new CDATASection
object created by the
associated DOM document.DOMException
- NOT_SUPPORTED_ERR: Raised if this document is an HTML document.IlvXMLSettings.createCDATASection(java.lang.String)
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
ProcessingInstruction
node given the specified
name and data strings.createProcessingInstruction
in interface Document
target
- The target part of the processing instruction.data
- The data for the node.null
.
It is overridden by the
IlvXMLSettings
class to
return a new ProcessingInstruction
object created by the
associated DOM document.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified target contains an
illegal character.
IlvXMLSettings.createProcessingInstruction(java.lang.String, java.lang.String)
public Attr createAttribute(String name) throws DOMException
Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttributeNode
method.
createAttributeNS
method.createAttribute
in interface Document
name
- The name of the attribute.null
.
It is overridden by the
IlvXMLSettings
class to
return a new Attr
object created by the
associated DOM document.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.IlvXMLSettings.createAttribute(java.lang.String)
public EntityReference createEntityReference(String name) throws DOMException
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.createEntityReference
in interface Document
name
- The name of the entity to reference.null
.
It is overridden by the
IlvXMLSettings
class to
return a new EntityReference
object created by the
associated DOM document.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
IlvXMLSettings.createEntityReference(java.lang.String)
public NodeList getElementsByTagName(String tagname)
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.
select(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement[])
with tagname
given as the first parameter and
null
as the second.getElementsByTagName
in interface Document
tagname
- The name of the tag to match on. The special value "*"
matches all tags.NodeList
object containing all the matched
Elements
.public Node importNode(Node importedNode, boolean deep) throws DOMException
IlvXMLSettings
class to
import a node the associated DOM document.importNode
in interface Document
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.null
.DOMException
- NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
supported.IlvXMLSettings.importNode(org.w3c.dom.Node, boolean)
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException
createSettingsElement(java.lang.String)
method with the result of the
concatenation of namespaceURI
and
qualifiedName
as the parameter.
IlvXMLSettings
class
overrides this method to make the associated DOM document create
the element.createElementNS
in interface Document
namespaceURI
- The namespace URI of the element to create.qualifiedName
- The qualified name of the element type to
instantiate.Element
object with the following
attributes:AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted
from qualifiedName
, or null
if there is
no prefixNode.localName
local name, extracted from
qualifiedName
Element.tagName
qualifiedName
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
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" .public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException
null
.
IlvXMLSettings
class
overrides this method to make the associated DOM document create
the attribute.createAttributeNS
in interface Document
namespaceURI
- The namespace URI of the attribute to create.qualifiedName
- The qualified name of the attribute to instantiate.Attr
object with the following attributes:
AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from
qualifiedName
, or null
if there is no
prefixNode.localName
local name, extracted from
qualifiedName
Attr.name
qualifiedName
Node.nodeValue
the empty
stringDOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
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/".public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
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.getElementsByTagNameNS
in interface Document
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.NodeList
object containing all the matched
Elements
.public Element getElementById(String elementId)
Element
whose ID
is given by
elementId
. If no such element exists, returns
null
. Behavior is not defined if more than one element
has this ID
. The DOM implementation must have
information that says which attributes are of type ID. Attributes
with the name "ID" are not of type ID unless so defined.
Implementations that do not know whether attributes are of type ID or
not are expected to return null
.getElementById
in interface Document
elementId
- The unique id
value for an element.null
as this default implementation does not
support this feature. The
IlvXMLSettings
class overrides
this method to return the matching element in the associated
DOM document.IlvXMLSettings.getElementById(java.lang.String)
public String getNodeName()
getNodeName
in interface Node
#document
as this node is a document.public String getNodeValue() throws DOMException
null
as this node is a document and has not associated
value.getNodeValue
in interface Node
DOMException
setNodeValue(java.lang.String)
public void setNodeValue(String nodeValue) throws DOMException
setNodeValue
in interface Node
nodeValue
- This parameter is not used.DOMException
public short getNodeType()
getNodeType
in interface Node
Node.DOCUMENT_NODE
code value.public Node getParentNode()
getParentNode
in interface Node
null
has this node is a document.public NodeList getChildNodes()
NodeList
that contains all children of this node. If
there are no children, this is a NodeList
containing no
nodes.getChildNodes
in interface Node
select(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement[])
with null
as the two parameters.public Node getFirstChild()
null
.getFirstChild
in interface Node
getChildNodes()
public Node getLastChild()
null
.getLastChild
in interface Node
public Node getPreviousSibling()
null
.getPreviousSibling
in interface Node
null
as a Document
node
has no siblings.public Node getNextSibling()
null
.getNextSibling
in interface Node
null
as a Document
node
has no siblings.public NamedNodeMap getAttributes()
null
as a document has no attributes.getAttributes
in interface Node
public Document getOwnerDocument()
Document
object associated with this node. This is
also the Document
object used to create new nodes. When
this node is a Document
or a DocumentType
which is not used with any Document
yet, this is
null
.getOwnerDocument
in interface Node
null
as this node is a document.public Node insertBefore(Node newChild, Node refChild) throws DOMException
newChild
before the existing child node
refChild
. If refChild
is null
,
insert newChild
at the end of the list of children.
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.insertBefore
in interface Node
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new
node must be inserted.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.
newChild
was created
from a different document than the one that created this node.
refChild
is not a child of
this node.public Node replaceChild(Node newChild, Node oldChild) throws DOMException
oldChild
with newChild
in the list of children, and returns the oldChild
node.
newChild
is a DocumentFragment
object,
oldChild
is replaced by all of the
DocumentFragment
children, which are inserted in the
same order. If the newChild
is already in the tree, it
is first removed.replaceChild
in interface Node
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.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 put in is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
oldChild
is not a child of
this node.public Node removeChild(Node oldChild) throws DOMException
oldChild
from the list
of children, and returns it.removeChild
in interface Node
oldChild
- The node being removed.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldChild
is not a child of
this node.public Node appendChild(Node newChild) throws DOMException
newChild
to the end of the list of children
of this node. If the newChild
is already in the tree, it
is first removed.appendChild
in interface Node
newChild
- The node to add.If it is a DocumentFragment
object, the entire contents of the document fragment are moved
into the child list of this nodeDOMException
- 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 append is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
public boolean hasChildNodes()
hasChildNodes
in interface Node
true
if this node has any children,
false
otherwise.public Node cloneNode(boolean deep)
parentNode
is null
.).
Element
copies all attributes and their
values, including those generated by the XML processor to represent
defaulted attributes, but this method does not copy any text it
contains unless it is a deep clone, since the text is contained in a
child Text
node. Cloning an Attribute
directly, as opposed to be cloned as part of an Element
cloning operation, returns a specified attribute (
specified
is true
). Cloning any other type
of node simply returns a copy of this node.
EntityReference
clone are readonly
. In addition, clones of unspecified Attr
nodes are
specified. And, cloning Document
,
DocumentType
, Entity
, and
Notation
nodes is implementation dependent.public void normalize()
Text
nodes in the full depth of the sub-tree
underneath this Node
, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text
nodes, i.e., there are neither adjacent
Text
nodes nor empty Text
nodes. This can
be used to ensure that the DOM view of a document is the same as if
it were saved and re-loaded, and is useful when operations (such as
XPointer lookups) that depend on a particular document tree
structure are to be used.In cases where the document contains
CDATASections
, the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
Text
nodes and CDATASection
nodes.public boolean isSupported(String feature, String version)
false
. It is
overridden by the IlvXMLSettings
class to return features supported by the DOM implementation of the
associated DOM document.isSupported
in interface Node
feature
- The name of the feature to test. This is the same name
which can be passed to the method hasFeature
on
DOMImplementation
.version
- This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true
.true
if the specified feature is
supported on this node, false
otherwise.public String getNamespaceURI()
Node.getNamespaceURI()
method.
Always returns null
as documents do not support namespaces.getNamespaceURI
in interface Node
public String getPrefix()
Node.getPrefix()
method.
Always returns null
as documents do not support prefixes.getPrefix
in interface Node
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
illegal character.
prefix
is
malformed, if the namespaceURI
of this node is
null
, if the specified prefix is "xml" and the
namespaceURI
of this node is different from "
http://www.w3.org/XML/1998/namespace", if this node is an attribute
and the specified prefix is "xmlns" and the
namespaceURI
of this node is different from "
http://www.w3.org/2000/xmlns/", or if this node is an attribute and
the qualifiedName
of this node is "xmlns" .public void setPrefix(String prefix) throws DOMException
setPrefix
in interface Node
prefix
- This parameter is not used.DOMException
public String getLocalName()
null
as document
do not have local names.getLocalName
in interface Node
public boolean hasAttributes()
hasAttributes
in interface Node
false
has documents do not have attributes.public static boolean IsEveryNodeKey(String key)
true
if the specified key is null
or
equal to EVERY_NODE_KEY
; false
otherwise.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.