VIEW
- is the generic type for the API of the JAXB bean
.BEAN
- is the generic type for the implementation of the JAXB bean
.public class JaxbBeanHolderImpl<VIEW,BEAN extends VIEW> extends AbstractLoggableObject implements JaxbBeanHolder<VIEW>, Flushable
JaxbBeanHolder
.Modifier and Type | Field and Description |
---|---|
private boolean |
allowSave |
private BEAN |
bean |
private XmlBeanMapper<BEAN> |
beanMapper
The
XmlBeanMapper . |
private DataResource |
dataResource
The
DataResource where the bean was loaded from. |
private Date |
modificationDate |
Constructor and Description |
---|
JaxbBeanHolderImpl(BEAN bean,
DataResource resource,
XmlBeanMapper<BEAN> beanMapper)
The constructor.
|
JaxbBeanHolderImpl(BEAN bean,
DataResource resource,
XmlBeanMapper<BEAN> beanMapper,
boolean allowSave)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
flush() |
BEAN |
getBean()
This method gets the current JAXB bean.
|
protected DataResource |
getDataResource()
This method gets the
DataResource where the bean was loaded from. |
boolean |
isAllowSave()
This method determines if this implementation allows to
save . |
boolean |
refresh()
This method will reload the
configuration if it has changed. |
getLogger
private final DataResource dataResource
DataResource
where the bean was loaded from.private final XmlBeanMapper<BEAN extends VIEW> beanMapper
XmlBeanMapper
.private final boolean allowSave
private Date modificationDate
public JaxbBeanHolderImpl(BEAN bean, DataResource resource, XmlBeanMapper<BEAN> beanMapper)
bean
- is the JAXB bean
.resource
- is the resource
.beanMapper
- is the XmlBeanMapper
used for flush()
and refresh()
.public JaxbBeanHolderImpl(BEAN bean, DataResource resource, XmlBeanMapper<BEAN> beanMapper, boolean allowSave)
bean
- is the JAXB bean
.resource
- is the resource
.beanMapper
- is the XmlBeanMapper
used for flush()
and refresh()
.allowSave
- - see isAllowSave()
.public boolean isAllowSave()
save
.true
if saving
is allowed, false
otherwise.public BEAN getBean()
getBean
in interface JaxbBeanHolder<VIEW>
protected DataResource getDataResource()
DataResource
where the bean
was loaded from.DataResource
.public boolean refresh()
JaxbBeanHolder
configuration
if it has changed.
This method refreshes the given object. This can be anything from reloading configuration to rebuilding the
internal state. An invocation of this method may be expensive and should only be invoked as needed. The
implementation of this method should be thread-safe if the object itself is to be used by separate consumers at
all.refresh
in interface Refreshable
refresh
in interface JaxbBeanHolder<VIEW>
true
if something has changed, false
otherwise. If the implementation can not determine the
change it should return true
.Copyright © 2001–2016 mmm-Team. All rights reserved.