|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.icesoft.faces.context.DOMContext
DOMContext provides a component specific interface to the DOM renderer
| Constructor Summary | |
protected |
DOMContext(com.icesoft.faces.context.DOMResponseWriter writer,
org.w3c.dom.Document document,
org.w3c.dom.Element parentElement)
Construct a new DOMContext with the specified arguments |
| Method Summary | |
static DOMContext |
attachDOMContext(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
This method returns the DOMContext associated with the specified component |
org.w3c.dom.Element |
createElement(java.lang.String name)
Creates an element of the type specified. |
org.w3c.dom.Element |
createRootElement(java.lang.String name)
Creates an element of the type specified. |
org.w3c.dom.Text |
createTextNode(java.lang.String cData)
Creates a Text node given the specified string. |
static java.util.List |
findChildrenWithNodeName(org.w3c.dom.Element root,
java.lang.String nodeName)
|
org.w3c.dom.Node |
getCursor()
Get the position in the document where the next DOM node will be rendererd. |
org.w3c.dom.Node |
getCursorParent()
Get the position in the document where the next DOM node will be rendererd. |
org.w3c.dom.Document |
getDocument()
Retrieve the org.w3c.dom.Document instance associated with this DOMContext |
static DOMContext |
getDOMContext(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Get the DOMContext associated with the component. |
org.w3c.dom.Node |
getRootNode()
Get the rootNode member variable. |
boolean |
isInitialized()
Determine whether this instance is initialized. |
boolean |
isStreamWriting()
Convenience method used by renderers to determine if Stream writing is enabled. |
static void |
removeChildren(org.w3c.dom.Node parent)
Remove all children from Node parent |
static void |
removeChildrenByTagName(org.w3c.dom.Element rootElement,
java.lang.String name)
Removes from the root element all children with node name equal to the nodeName parameter |
void |
setCursor(org.w3c.dom.Node cursor)
Set the position in the document where the next DOM node will be rendererd. |
void |
setCursorParent(org.w3c.dom.Node cursorParent)
Set the position at which the next rendered node will be appended |
void |
setInitialized(boolean initialized)
Need to reset when not rendered |
void |
setRootNode(org.w3c.dom.Node rootNode)
Set the rootNode member variable to the parameter Node. |
void |
stepInto(javax.faces.component.UIComponent component)
Maintain the cursor and cursorParent such that the next rendered component will be rendered as a child of the parameter component. |
void |
stepOver()
Maintain the cursor and cursorParent position; step to the position where the next sibling should be rendered. |
void |
streamWrite(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Convenience method for streamWrite(facesContext, component,
this.rootNode, null). |
void |
streamWrite(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
org.w3c.dom.Node root,
org.w3c.dom.Node halter)
Writes the DOM subtree anchored at root to the
current ResponseWriter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected DOMContext(com.icesoft.faces.context.DOMResponseWriter writer,
org.w3c.dom.Document document,
org.w3c.dom.Element parentElement)
Construct a new DOMContext with the specified arguments
writer - The response writer for this contextdocument - the Document associated with this contextparentElement - the parent Element for this context| Method Detail |
public boolean isInitialized()
Determine whether this instance is initialized. An initialized instance is guaranteed to have a root node.
public void setInitialized(boolean initialized)
initialized -
public static DOMContext attachDOMContext(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
This method returns the DOMContext associated with the specified component
facesContext - an instance of FacesContext associated with the lifecyclecomponent - component associated with this DOMContext
DOMContext
public static DOMContext getDOMContext(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Get the DOMContext associated with the component. Do not attach the DOMContext instance to its parent element.
facesContext - component - the UIComponent instance whose DOMContext we are retrieving
DOMContextpublic org.w3c.dom.Element createElement(java.lang.String name)
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.
name - the specified Element type to create
public org.w3c.dom.Text createTextNode(java.lang.String cData)
Creates a Text node given the specified string.
Text object.public void setRootNode(org.w3c.dom.Node rootNode)
Set the rootNode member variable to the parameter Node.
rootNode - public org.w3c.dom.Element createRootElement(java.lang.String name)
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.
Set the rootNode member variable of this instance to the newly-created
Element.
name -
public org.w3c.dom.Node getRootNode()
Get the rootNode member variable.
DOMContext instancepublic void setCursor(org.w3c.dom.Node cursor)
cursor - public org.w3c.dom.Node getCursor()
public void setCursorParent(org.w3c.dom.Node cursorParent)
cursorParent - public org.w3c.dom.Node getCursorParent()
public void stepOver()
public void stepInto(javax.faces.component.UIComponent component)
component - public org.w3c.dom.Document getDocument()
public static void removeChildren(org.w3c.dom.Node parent)
public static void removeChildrenByTagName(org.w3c.dom.Element rootElement,
java.lang.String name)
rootElement - name -
public static java.util.List findChildrenWithNodeName(org.w3c.dom.Element root,
java.lang.String nodeName)
public void streamWrite(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
org.w3c.dom.Node root,
org.w3c.dom.Node halter)
throws java.io.IOException
Writes the DOM subtree anchored at root to the
current ResponseWriter. Serialization is halted at the node
halter (writing only the opening tag) and will be
resumed from this node on the next call to this function.
facesContext - current FacesContextcomponent - JSF component being renderedroot - node indicating subtree of DOM to eventually serializehalter - node upon which to halt serialization on this pass
java.io.IOException
public void streamWrite(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
throws java.io.IOException
Convenience method for streamWrite(facesContext, component,
this.rootNode, null).
facesContext - current FacesContextcomponent - JSF component being rendered
java.io.IOExceptionpublic boolean isStreamWriting()
Convenience method used by renderers to determine if Stream writing is enabled.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||