public abstract class AdapterBase<Bean,Model> extends XmlAdapter<Bean,Model>
| Constructor and Description |
|---|
AdapterBase() |
| Modifier and Type | Method and Description |
|---|---|
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> |
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) |
public Bean marshal(Model model) throws CdkException
marshal in class XmlAdapter<Bean,Model>CdkExceptionpublic Bean createBean(Class<? extends Bean> beanClass, Model model) throws CdkException
This method creates adapter object and copies properties from model object to adapter.
beanClass - adapter class.model - model object class.CdkExceptionprotected void postMarshal(Model model, Bean bean)
Template method to copy non bean attributes.
model - bean - protected abstract Class<? extends Bean> getBeanClass(Model model)
Returns concrete bean class.
model - public Model unmarshal(Bean bean) throws CdkException
unmarshal in class XmlAdapter<Bean,Model>CdkExceptionprotected <D,E extends ConfigExtension> E createExtension(D destination) throws NoSuchMethodException, InstantiationException, IllegalAccessException
protected Model createModelElement(Class<? extends Model> modelClass, Bean adapter)
protected void postUnmarshal(Bean bean, Model model)
Template method to copy non bean attributes
bean - model - Copyright © 2014 JBoss by Red Hat. All Rights Reserved.