org.apache.shale.clay.parser.builder
Class JsfDefaultBuilder

java.lang.Object
  extended by org.apache.shale.clay.parser.builder.Builder
      extended by org.apache.shale.clay.parser.builder.ElementBuilder
          extended by org.apache.shale.clay.parser.builder.JsfDefaultBuilder

public class JsfDefaultBuilder
extends ElementBuilder

A generic builder that maps the markup node name to the jsfid. The extends attribute can be used to override the default mapping to provide meta-data inheritance. The builder handles child nodes common to JSF and shale components.


Field Summary
 
Fields inherited from class org.apache.shale.clay.parser.builder.Builder
messages
 
Constructor Summary
JsfDefaultBuilder()
           
 
Method Summary
protected  void addActionListener(Node node, ElementBean target)
          Adds an ActionListenerBean to the target ElementBean using the Node as the input source.
protected  void addAttribute(Node node, ElementBean target)
          Adds markup <f:attribute> to the target ElementBean.
protected  void addConverter(Node node, ElementBean target)
          Adds a ConverterBean to the target ElementBean using the Node as the input source.
protected  void addFacet(Node node, ElementBean target)
          Adds markup <f:facet> to the target's child ElementBean.
protected  void addSymbol(Node node, ElementBean target)
          Adds markup <clay:symbol> to the target ElementBean.
protected  void addValidator(Node node, ElementBean target)
          Adds a ValidatorBean to the target ElementBean using the Node as the input source.
protected  void addValidatorVar(Node attributesNode, ComponentBean target)
          Looks for <s:validatorVar/> nodes within a <s:commonsValidator> node and converting them to AttributeBean's on the target ComponentBean.
protected  void addValueChangeListener(Node node, ElementBean target)
          Adds a ActionListenerBean to the target ElementBean using the Node as the input source.
 ElementBean createElement(Node node)
          Factory method that creates a ElementBean from a Node.
protected  void encodeBegin(Node node, ElementBean target, ComponentBean root)
          Build's a target ElementBean from a Node.
 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  String getJsfid(Node node)
          Returns the jsfid from the Node The extends attribute is giving the first order of evaluation.
 String getPrefix()
          Returns the namespace prefix that will be added to the node name when resolving the clay config.
 void setPrefix(String prefix)
          Sets the namespace preix that will override the template nodeds qname.
 
Methods inherited from class org.apache.shale.clay.parser.builder.ElementBuilder
addAttributes, addSymbols, assignNode, getComponentType, isChildrenAllowed, isNodeWhitespace, realizeComponent
 
Methods inherited from class org.apache.shale.clay.parser.builder.Builder
assignAttributes, createAttribute, encode, encodeChildren, encodeEnd, getBuildNodeBody, getRenderId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsfDefaultBuilder

public JsfDefaultBuilder()
Method Detail

getPrefix

public String getPrefix()

Returns the namespace prefix that will be added to the node name when resolving the clay config.

Returns:
URI prefix

setPrefix

public void setPrefix(String prefix)

Sets the namespace preix that will override the template nodeds qname.

Parameters:
prefix - URI prefix

createElement

public ElementBean createElement(Node node)

Factory method that creates a ElementBean from a Node.

Overrides:
createElement in class ElementBuilder
Parameters:
node - markup
Returns:
new config bean from the node

addConverter

protected void addConverter(Node node,
                            ElementBean target)
Description copied from class: ElementBuilder

Adds a ConverterBean to the target ElementBean using the Node as the input source.

Overrides:
addConverter in class ElementBuilder
Parameters:
node - markup
target - child config bean

addValidatorVar

protected void addValidatorVar(Node attributesNode,
                               ComponentBean target)

Looks for <s:validatorVar/> nodes within a <s:commonsValidator> node and converting them to AttributeBean's on the target ComponentBean.

Parameters:
attributesNode - markup
target - child config bean

addValidator

protected void addValidator(Node node,
                            ElementBean target)
Description copied from class: ElementBuilder

Adds a ValidatorBean to the target ElementBean using the Node as the input source.

Overrides:
addValidator in class ElementBuilder
Parameters:
node - markup
target - child config bean

addActionListener

protected void addActionListener(Node node,
                                 ElementBean target)
Description copied from class: ElementBuilder

Adds an ActionListenerBean to the target ElementBean using the Node as the input source.

Overrides:
addActionListener in class ElementBuilder
Parameters:
node - markup
target - child config bean

addValueChangeListener

protected void addValueChangeListener(Node node,
                                      ElementBean target)
Description copied from class: ElementBuilder

Adds a ActionListenerBean to the target ElementBean using the Node as the input source.

Overrides:
addValueChangeListener in class ElementBuilder
Parameters:
node - markup
target - child config bean

addSymbol

protected void addSymbol(Node node,
                         ElementBean target)

Adds markup <clay:symbol> to the target ElementBean.

Parameters:
node - markup
target - child config bean

addAttribute

protected void addAttribute(Node node,
                            ElementBean target)

Adds markup <f:attribute> to the target ElementBean.

Parameters:
node - markup
target - child config bean

addFacet

protected void addFacet(Node node,
                        ElementBean target)

Adds markup <f:facet> to the target's child ElementBean.

Parameters:
node - markup
target - child config bean

encodeBegin

protected void encodeBegin(Node node,
                           ElementBean target,
                           ComponentBean root)

Build's a target ElementBean from a Node. The following child nodes are handles outside of the encodeChildren method: symbol, facet, attribute, convert, validate, actionListener, and valueChangeListener.

Overrides:
encodeBegin in class ElementBuilder
Parameters:
node - markup
target - child config bean
root - parent config bean

getJsfid

protected String getJsfid(Node node)

Returns the jsfid from the Node The extends attribute is giving the first order of evaluation. If empty, the node's name is assigned to the jsfid.

Overrides:
getJsfid in class ElementBuilder
Parameters:
node - markup
Returns:
jsfid

getBuilder

public 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.

Overrides:
getBuilder in class Builder
Parameters:
node - markup node
Returns:
builder that maps markup to config beans


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.