org.apache.shale.clay.utils
Class ClayAmalgam

java.lang.Object
  extended by org.apache.shale.clay.utils.ClayAmalgam

public class ClayAmalgam
extends Object

This class is a mix of runtime utilities for the Clay component. It is loaded as a managed bean in application scope by the clay component's registration.


Constructor Summary
ClayAmalgam()
           
 
Method Summary
 void clayForEach(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object displayElementRoot)
           This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component.
 void clayImport(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object displayElementRoot)
           This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component.
 void clayOut(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object displayElementRoot)
           This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component.
 String decode(String value)
           Decodes a string value using the decodeMap.
 String encode(String value)
           Encodes a string value using the encodeMap.
protected  void replace(StringBuffer document, Map context)
           Replaces tokens in the document with matching tokens in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClayAmalgam

public ClayAmalgam()
Method Detail

replace

protected void replace(StringBuffer document,
                       Map context)

Replaces tokens in the document with matching tokens in the context.

Parameters:
document - containing tokens to replace
context - tokens

encode

public String encode(String value)

Encodes a string value using the encodeMap.

Parameters:
value - source string
Returns:
target encode string

decode

public String decode(String value)

Decodes a string value using the decodeMap.

Parameters:
value - source string
Returns:
decoded value

clayOut

public void clayOut(javax.faces.context.FacesContext context,
                    javax.faces.component.UIComponent component,
                    Object displayElementRoot)

This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component. It expects that the value attribute will contain an html string that represents an HTML node. The value will be encode or decode depending on the value of the escapeXml optional attribute. The default is "false".

Parameters:
context - faces context
component - clay
displayElementRoot - config bean

clayImport

public void clayImport(javax.faces.context.FacesContext context,
                       javax.faces.component.UIComponent component,
                       Object displayElementRoot)

This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component. It expects that the url attribute will contain the file to import relative to the web context root. The content of the file will be encode or decode depending on the value of the escapeXml optional attribute. The default doesn't apply any encoding.

Parameters:
context - faces context
component - clay
displayElementRoot - config bean

clayForEach

public void clayForEach(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component,
                        Object displayElementRoot)

This is a method binding "validator" signature that can be bound to the shapeValidator attribute of the Clay component. It expects four attributes value, bodyJsfid, var and scope. The value attribute is like a dataTable. It should be a value binding expression that is a Map, List or Object[]. The bodyJsfid attribute is root of the subtree that will be repeated in the for loop. The var attribute is the tag used to cache a Map of the bound objects. It will always be loaed in "session" scope. Limitation exists because the "shapeValidator" event is only called when the component is created. This means that you must take care in removing the var object from session scope.

Parameters:
context - faces
component - clay
displayElementRoot - config bean


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