org.ajax4jsf.renderkit.compiler
Class ElementBase

java.lang.Object
  extended by org.ajax4jsf.renderkit.compiler.ElementBase
All Implemented Interfaces:
PreparedTemplate
Direct Known Subclasses:
AttributeElement, ChildElement, ChildrensElement, ClassElement, FacetElement, IfElement, ImportResourceElement, MethodCallElement, MethodParameterElement, PlainElement, ResourceElement, RootElement, SelectorElement, TextElement

public abstract class ElementBase
extends java.lang.Object
implements PreparedTemplate

Version:
$Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:44 $
Author:
asmirnov@exadel.com (latest modification by $Author: alexsmirnov $)

Nested Class Summary
protected  class ElementBase.SkinValueGetter
           
protected  class ElementBase.ValueGetter
           
 
Field Summary
protected  ElementBase.ValueGetter valueGetter
           
 
Constructor Summary
ElementBase()
           
 
Method Summary
 void addBreakPoint(java.lang.String name)
           
 void addChild(PreparedTemplate child)
          Append child element to current.
 void encode(RendererBase renderer, javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Encode this XML component.
 void encode(TemplateContext context)
           
 void encode(TemplateContext context, java.lang.String breakPoint)
           
protected  void encodeBegin(TemplateContext context)
           
protected  void encodeEnd(TemplateContext context)
           
protected  java.lang.Class[] getAllowedClasses()
           
 java.util.List getChildren()
           
 java.lang.Object getDefault()
           
 java.lang.String getString(TemplateContext context)
           
 java.lang.Object getValue(TemplateContext context)
           
protected  boolean isValueReference(java.lang.String value)
          Get EL-enabled value.
 void setBaseSkin(java.lang.String baseSkin)
           
 void setCall(java.lang.String call)
           
 void setContext(java.lang.Object context)
           
 void setDefault(java.lang.Object default1)
           
 void setParent(PreparedTemplate parent)
          Set parent element in compiled tree for template.
 void setProperty(java.lang.String property)
           
 void setSkin(java.lang.String skin)
           
 void setValue(java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ajax4jsf.renderkit.compiler.PreparedTemplate
getTag
 

Field Detail

valueGetter

protected ElementBase.ValueGetter valueGetter
Constructor Detail

ElementBase

public ElementBase()
Method Detail

encode

public void encode(RendererBase renderer,
                   javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
            throws java.io.IOException
Description copied from interface: PreparedTemplate
Encode this XML component. May be simple send element and attributes, call specified Renderer or RendererUtils method etc. Can encode children elements ( if exist ).

Specified by:
encode in interface PreparedTemplate
Throws:
java.io.IOException

encode

public void encode(TemplateContext context,
                   java.lang.String breakPoint)
            throws java.io.IOException
Specified by:
encode in interface PreparedTemplate
Throws:
java.io.IOException

encode

public void encode(TemplateContext context)
            throws java.io.IOException
Specified by:
encode in interface PreparedTemplate
Throws:
java.io.IOException

encodeBegin

protected void encodeBegin(TemplateContext context)
                    throws java.io.IOException
Throws:
java.io.IOException

encodeEnd

protected void encodeEnd(TemplateContext context)
                  throws java.io.IOException
Throws:
java.io.IOException

getChildren

public java.util.List getChildren()
Specified by:
getChildren in interface PreparedTemplate
Returns:
List of childrens of this component.

addChild

public void addChild(PreparedTemplate child)
              throws org.xml.sax.SAXException
Description copied from interface: PreparedTemplate
Append child element to current.

Specified by:
addChild in interface PreparedTemplate
Throws:
org.xml.sax.SAXException

getAllowedClasses

protected java.lang.Class[] getAllowedClasses()
Returns:
array of classes, allowed as childs for this element.

setParent

public void setParent(PreparedTemplate parent)
               throws org.xml.sax.SAXException
Description copied from interface: PreparedTemplate
Set parent element in compiled tree for template.

Specified by:
setParent in interface PreparedTemplate
Throws:
org.xml.sax.SAXException

addBreakPoint

public void addBreakPoint(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getValue

public java.lang.Object getValue(TemplateContext context)
Specified by:
getValue in interface PreparedTemplate
Returns:
Returns the value. If is EL expression valueBinding - evaluate in.

getString

public java.lang.String getString(TemplateContext context)
                           throws javax.faces.FacesException
Throws:
javax.faces.FacesException

setValue

public void setValue(java.lang.Object value)
Parameters:
value - The value to set. if EL-expression ( #{...} ) - compile it.

getDefault

public java.lang.Object getDefault()
Returns:
Returns the default.

setDefault

public void setDefault(java.lang.Object default1)
Parameters:
default1 - The default to set.

setProperty

public void setProperty(java.lang.String property)
Parameters:
property - The property to set.

setBaseSkin

public void setBaseSkin(java.lang.String baseSkin)
Parameters:
skin - The skin to set.

setSkin

public void setSkin(java.lang.String skin)
Parameters:
skin - The skin to set.

setContext

public void setContext(java.lang.Object context)
Parameters:
context - The context to set.

setCall

public void setCall(java.lang.String call)
Parameters:
call - The call to set.

isValueReference

protected boolean isValueReference(java.lang.String value)
Get EL-enabled value. Return same string, if not el-expression. Otherthise, return parsed and evaluated expression.

Parameters:
context - - current Faces Context.
value - - string to parse.
Returns:
- interpreted el or unmodified value.


Copyright © 2009. All Rights Reserved.