@ParametersAreNonnullByDefault public class DefaultMapperWriter extends AbstractWriter<DataMapper>
Writer
that persists data into a DataMapper
.target
Constructor and Description |
---|
DefaultMapperWriter(DataMapper mapper)
Constructs a new
DefaultMapperWriter with the given mapper . |
Modifier and Type | Method and Description |
---|---|
protected void |
createElement(ProxyElement element,
boolean ignoreFailure)
Creates an element from the given
element . |
void |
onAttribute(ProxyAttribute attribute,
List<Object> values)
Handles an attribute in the current element.
|
void |
onComplete()
Handles the end of the current task.
|
void |
onInitialize()
Handles the start of a task.
|
void |
onReference(ProxyReference reference,
List<Id> values)
Handles a reference in the current element.
|
void |
onStartElement(ProxyElement element)
Handles the start of an element.
|
onAttribute, onEndElement, onReference, requireEndBeforeFlush
public DefaultMapperWriter(DataMapper mapper)
DefaultMapperWriter
with the given mapper
.mapper
- the mapper where to write datapublic void onInitialize()
Handler
Handler.onComplete()
,
Notifier.notifyInitialize()
public void onComplete()
Handler
Handler.onInitialize()
,
Notifier.notifyComplete()
public void onStartElement(ProxyElement element) throws IOException
Handler
onStartElement
in interface Handler
onStartElement
in class AbstractWriter<DataMapper>
element
- the element of the new elementIOException
Handler.onEndElement()
,
Notifier.notifyStartElement(ProxyElement)
public void onAttribute(ProxyAttribute attribute, List<Object> values)
AbstractWriter
onAttribute
in class AbstractWriter<DataMapper>
attribute
- the new attribute, without its valuevalues
- the ordered values of the attribute; when the attribute
is single-valued, this parameter
is a Collections.singletonList(Object)
public void onReference(ProxyReference reference, List<Id> values)
AbstractWriter
onReference
in class AbstractWriter<DataMapper>
reference
- the new reference, without its valuevalues
- the ordered values of the reference; when the reference
is single-valued, this parameter
is a Collections.singletonList(Object)
protected void createElement(ProxyElement element, boolean ignoreFailure)
element
.element
- the information about the new elementignoreFailure
- true
if the element can be ignored if it is already definedNullPointerException
- if the element
is null
Copyright © 2013–2019 Atlanmod. All rights reserved.