RichFaces CDK Generator 4.2.0.CR1

org.richfaces.cdk.xmlconfig.model
Class AdapterBase<Bean,Model>

java.lang.Object
  extended by javax.xml.bind.annotation.adapters.XmlAdapter<Bean,Model>
      extended by org.richfaces.cdk.xmlconfig.model.AdapterBase<Bean,Model>
Direct Known Subclasses:
AttributeAdapter, BehaviorRendererAdapter, ElementAdapterBase, EventAdapter, FacesConfigAdapter, FacetAdapter, FunctionAdapter, PropertyAdapter, RendererAdapter, RenderKitAdapter

public abstract class AdapterBase<Bean,Model>
extends XmlAdapter<Bean,Model>

Author:
asmirnov@exadel.com

Constructor Summary
AdapterBase()
           
 
Method Summary
 Bean createBean(Class<? extends Bean> beanClass, Model model)
          

This method creates adapter object and copies properties from model object to adapter.

protected
<D,E extends ConfigExtension>
E
createExtension(D destination)
           
protected  Model createModelElement(Class<? extends Model> modelClass, Bean adapter)
           
protected abstract  Class<? extends Bean> getBeanClass(Model model)
          

Returns concrete bean class.

protected abstract  Class<? extends Model> getModelClass(Bean bean)
          

Returns concrete model class

 Bean marshal(Model model)
           
protected  void postMarshal(Model model, Bean bean)
          

Template method to copy non bean attributes.

protected  void postUnmarshal(Bean bean, Model model)
          

Template method to copy non bean attributes

 Model unmarshal(Bean bean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdapterBase

public AdapterBase()
Method Detail

marshal

public Bean marshal(Model model)
             throws CdkException
Specified by:
marshal in class XmlAdapter<Bean,Model>
Throws:
CdkException

createBean

public Bean createBean(Class<? extends Bean> beanClass,
                       Model model)
                throws CdkException

This method creates adapter object and copies properties from model object to adapter.

Parameters:
beanClass - adapter class.
model - model object class.
Returns:
initialized instance of adapter object.
Throws:
CdkException

postMarshal

protected void postMarshal(Model model,
                           Bean bean)

Template method to copy non bean attributes.

Parameters:
model -
bean -

getBeanClass

protected abstract Class<? extends Bean> getBeanClass(Model model)

Returns concrete bean class.

Parameters:
model -
Returns:

unmarshal

public Model unmarshal(Bean bean)
                throws CdkException
Specified by:
unmarshal in class XmlAdapter<Bean,Model>
Throws:
CdkException

createExtension

protected <D,E extends ConfigExtension> E createExtension(D destination)
                                             throws NoSuchMethodException,
                                                    InstantiationException,
                                                    IllegalAccessException
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException

createModelElement

protected Model createModelElement(Class<? extends Model> modelClass,
                                   Bean adapter)

postUnmarshal

protected void postUnmarshal(Bean bean,
                             Model model)

Template method to copy non bean attributes

Parameters:
bean -
model -

getModelClass

protected abstract Class<? extends Model> getModelClass(Bean bean)

Returns concrete model class

Parameters:
bean -
Returns:

RichFaces CDK Generator 4.2.0.CR1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.