|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.clay.parser.builder.Builder
public abstract class Builder
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
.
Field Summary | |
---|---|
protected static org.apache.shale.util.Messages |
messages
Message resources for this class. |
Constructor Summary | |
---|---|
Builder()
|
Method Summary | |
---|---|
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)
Factory method that creates a AttributeBean from the original
replacing the value . |
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 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.shale.util.Messages messages
Message resources for this class.
Constructor Detail |
---|
public Builder()
Method Detail |
---|
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
- markup
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
.
node
- markup
protected 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 bean
false
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 attribute
protected 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
- markup
public 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 beanpublic 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.
node
- markup node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |