initialization - Is there any postConstruct/afterPropertiesSet for JAXB entity? -


is there postconstruct/afterpropertiesset jaxb entity
can access initialized/parsed xml attributes , values continue feather initialization?

option #1 - unmarshaller listener

you implement unmarshaller.listener providers way capture events. specify instance on unmsrshaller class before performing unmarshal operation.

option #2 - event methods on domain object

this method called after object created , before unmarshalling of object begins. callback provides opportunity initialize javabean properties prior unmarshalling.

    void beforeunmarshal(unmarshaller, object parent); 

this method called after properties (except idref) unmarshalled object, before object set parent object.

    void afterunmarshal(unmarshaller, object parent); 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -