fi.hut.tml.xsmiles.mlfc.xbl2.dom
Class BindingElementImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.mlfc.xbl2.dom.ElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.xbl2.dom.BindingElementImpl
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo

public class BindingElementImpl
extends ElementImpl

XBL-element: binding.

Author:
Mikko Vestola
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
 
Fields inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
DESTROYED, elementStatus, INITIALIZED, INITIALIZING, setPseudoClasses, style, UNINITIALIZED, xblpropname
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
BindingElementImpl(org.apache.xerces.dom.DocumentImpl owner, java.lang.String namespace, java.lang.String tag)
           
 
Method Summary
 void applyBinding(XSmilesElementImpl element)
          Applies this binding to the specified element.
 boolean bindingMatchesElement(XSmilesElementImpl element)
          This function finds out if the element given in parameters matches the binding's selector in its element attribute.
 BindingHandler getBindingHandler()
          Returns the bindingHandler that knows which binding belongs to which element.
 HandlersElementImpl getHandlersElement()
          Returns the handlers element of this binding element.
 java.lang.String getOrigBaseURI()
           
 boolean matchesElementURI(java.lang.String URI)
          This method checks that does this binding match the URI given in parameters.
 java.net.URL resolveURI(java.lang.String src)
          Resolve an uri to an absolute uri using the base-uri of the current element.
 void setBindingHandler(BindingHandler handler)
          Sets the binding handler that is responsible of this binding.
 void setOrigBaseURI(java.lang.String URI)
           
 java.lang.String toString()
          Returns binding in text form: Binding [id=IDattr, element=ElemAttr]
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, destroy, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getId, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, init, initFinalFlattenedTree, initStyle, isInitedForReset, isPseudoClass, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, insertBefore, item, removeChild, replaceChild, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

BindingElementImpl

public BindingElementImpl(org.apache.xerces.dom.DocumentImpl owner,
                          java.lang.String namespace,
                          java.lang.String tag)
Method Detail

getOrigBaseURI

public java.lang.String getOrigBaseURI()

setOrigBaseURI

public void setOrigBaseURI(java.lang.String URI)

bindingMatchesElement

public boolean bindingMatchesElement(XSmilesElementImpl element)
This function finds out if the element given in parameters matches the binding's selector in its element attribute.

Parameters:
element - Element we want to find out that does it match the selector
Returns:
True if binding's selector matches element, false otherwise

getBindingHandler

public BindingHandler getBindingHandler()
Returns the bindingHandler that knows which binding belongs to which element.

Returns:
BindingHandler

setBindingHandler

public void setBindingHandler(BindingHandler handler)
Sets the binding handler that is responsible of this binding.

Parameters:
handler - BindingHandler

toString

public java.lang.String toString()
Returns binding in text form: Binding [id=IDattr, element=ElemAttr]


applyBinding

public void applyBinding(XSmilesElementImpl element)
Applies this binding to the specified element. In other words, this binding applies all the template, implementation, handlers and resources elements to the element given in parameters.

Parameters:
element - The element that this binding is going to be applied.

matchesElementURI

public boolean matchesElementURI(java.lang.String URI)
This method checks that does this binding match the URI given in parameters. For example a binding may refer to other bindigs via extends attribute (e.g. binding extends="http://www.site.com/extBindings.xml#b01").

Parameters:
URI - The absolute URI referring to the binding element.
Returns:
Returns true if the URI refers to the binding. If this binding does not have an ID attribute, returns false (since it cannot be referenced). Otherwise returns also false.

resolveURI

public java.net.URL resolveURI(java.lang.String src)
                        throws java.net.MalformedURLException
Description copied from class: XSmilesElementImpl
Resolve an uri to an absolute uri using the base-uri of the current element.

Overrides:
resolveURI in class XSmilesElementImpl
Parameters:
src - the uri to resolve
Throws:
java.net.MalformedURLException - if the resulting URL has an unsupported scheme or a parse error occured

getHandlersElement

public HandlersElementImpl getHandlersElement()
Returns the handlers element of this binding element.

Returns:
The first handlers element below this binding or null if the binding hasn't any handlers element.


X-Smiles 1.2