Package org.jboss.as.controller.xml
Interface XMLElementReader<C>
-
- Type Parameters:
C- the reader context type
- All Superinterfaces:
XMLComponentReader<C>,org.jboss.staxmapper.XMLElementReader<C>
- All Known Implementing Classes:
ResourceXMLContainer.ResourceAttributesXMLContentReader,ResourceXMLContainer.ResourceXMLContainerReader
public interface XMLElementReader<C> extends org.jboss.staxmapper.XMLElementReader<C>, XMLComponentReader<C>
Adds absentee element handling to an {link org.jboss.staxmapper.XMLElementReader}.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default <T> XMLElementReader<T>map(Function<T,C> mapper)Returns a new reader whose context is mapped from the specified function.static <C> XMLElementReader<C>validate(QName expected, XMLElementReader<C> elementReader)Decorates anXMLElementReaderwith entry/exit criteria validation.default voidwhenAbsent(C context)Triggered when the associated XML content is absent from the XML input.default <T> XMLElementReader<T>withContext(Supplier<C> contextFactory, BiConsumer<T,C> applicator)Returns a new reader whose context is generated from the specified factory and applied via the specified consumer.
-
-
-
Method Detail
-
whenAbsent
default void whenAbsent(C context)
Description copied from interface:XMLComponentReaderTriggered when the associated XML content is absent from the XML input.- Specified by:
whenAbsentin interfaceXMLComponentReader<C>- Parameters:
context- a reader context
-
map
default <T> XMLElementReader<T> map(Function<T,C> mapper)
Returns a new reader whose context is mapped from the specified function.- Type Parameters:
T- the mapped context type- Parameters:
mapper- a context mapping function- Returns:
- a new writer whose context is mapped from the specified function.
-
withContext
default <T> XMLElementReader<T> withContext(Supplier<C> contextFactory, BiConsumer<T,C> applicator)
Returns a new reader whose context is generated from the specified factory and applied via the specified consumer.- Type Parameters:
T- the mapped context type- Parameters:
contextFactory- supplier of the read contextapplicator- application of the read context- Returns:
- a new writer whose context is generated from the specified factory and applied via the specified consumer.
-
validate
static <C> XMLElementReader<C> validate(QName expected, XMLElementReader<C> elementReader)
Decorates anXMLElementReaderwith entry/exit criteria validation.- Type Parameters:
C- the read context- Parameters:
name- the name of the expected elementelementReader- the reader of an element- Returns:
- a validating reader
-
-