public abstract class Builder extends Object
The abstract document node converter handles building meta components,
ComponentBean
, for a parsed html
document fragment. The Parser
loads the
HTML document into a tree structure of
Node
. Each node in the parsed document
tree is mapped to a Builder
by a a subclass of
BuilderRuleContext
.
Modifier and Type | Field and Description |
---|---|
protected static Messages |
messages
Message resources for this class.
|
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
protected void |
assignAttributes(Node node,
ComponentBean target)
This method applies the HTML attribute overrides to the declarative
component, an object representation of the XML configuration.
|
protected void |
assignNode(Node node,
ElementBean target)
This method resolves the
jsfid attribute for an HTML
element to a component definition in the XML configuration files. |
protected AttributeBean |
createAttribute(AttributeBean original,
String value,
ComponentBean target)
|
ElementBean |
createElement(Node node)
Factory method that creates a
ElementBean from a Node . |
void |
encode(Node node,
ElementBean target,
ComponentBean root)
The call that begins the conversion of a
Node to a
ComponentBean . |
protected void |
encodeBegin(Node node,
ElementBean target,
ComponentBean root)
Called to being building a
ElementBean from a Node . |
protected void |
encodeChildren(Node node,
ElementBean target,
ComponentBean root)
Recursively builds the clay meta component data from the parse
document of
Node 's. |
protected void |
encodeEnd(Node node,
ElementBean target,
ComponentBean root)
This call is invoked for any final processing.
|
Builder |
getBuilder(Node node)
Returns the
Builder that
is assigned the task of converting the html node to a corresponding component
metadata used to construct a JSF resource. |
protected boolean |
getBuildNodeBody(Node node,
ElementBean target)
Returns
true if the builder handles converting the node's
children or false if it's handled by the parent. |
protected abstract String |
getComponentType(Node node)
Returns the faces component type registered in the faces configuration or the
fully qualified class name for
ActionListeners and
ValueChangeListeners . |
protected abstract String |
getJsfid(Node node)
Returns a
jsfid for the component. |
protected int |
getRenderId()
Returns the next generated
renderId . |
boolean |
isChildrenAllowed()
This method returns
true if the faces component that it
builds allows children but the default is false . |
protected static Messages messages
Message resources for this class.
public boolean isChildrenAllowed()
This method returns true
if the faces component that it
builds allows children but the default is false
.
false
protected abstract String getJsfid(Node node)
Returns a jsfid
for the component.
node
- markupprotected abstract String getComponentType(Node node)
Returns the faces component type registered in the faces configuration or the
fully qualified class name for ActionListeners
and
ValueChangeListeners
.
node
- markupprotected int getRenderId()
Returns the next generated renderId
.
protected boolean getBuildNodeBody(Node node, ElementBean target)
Returns true
if the builder handles converting the node's
children or false
if it's handled by the parent. The
isBodyAllowed
attribute can also
be used to override the default option. This flag allows the HTML to be
mocked up but the body ignored when converted into a
ComponentBean
graph.
node
- markuptarget
- child config beanfalse
if the node's children should be ignoredprotected void encodeBegin(Node node, ElementBean target, ComponentBean root)
Called to being building a ElementBean
from a Node
. This
follows the JSF pattern used by the Components and Renders.
node
- markuptarget
- child config beanroot
- parent config beanprotected AttributeBean createAttribute(AttributeBean original, String value, ComponentBean target)
Factory method that creates a AttributeBean
from the original
replacing the value
.
original
- attribute being clonedvalue
- attribute property value overridetarget
- owner of the attributeprotected void encodeChildren(Node node, ElementBean target, ComponentBean root)
Recursively builds the clay meta component data from the parse
document of Node
's. A similar design pattern found in JSF.
node
- markuptarget
- child config beanroot
- parent config beanprotected void encodeEnd(Node node, ElementBean target, ComponentBean root)
This call is invoked for any final processing.
node
- markuptarget
- child config beanroot
- parent config beanpublic ElementBean createElement(Node node)
Factory method that creates a ElementBean
from a Node
.
node
- markuppublic void encode(Node node, ElementBean target, ComponentBean root)
The call that begins the conversion of a Node
to a
ComponentBean
. Each element in the html document will be
converted into a Clay meta component.
node
- markuptarget
- child config beanroot
- parent config beanprotected void assignNode(Node node, ElementBean target)
This method resolves the jsfid
attribute for an HTML
element to a component definition in the XML configuration files.
node
- markuptarget
- child config beanprotected void assignAttributes(Node node, ComponentBean target)
This method applies the HTML attribute overrides to the declarative component, an object representation of the XML configuration.
node
- markuptarget
- child config beanCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.