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
Modifier and TypeMethodDescriptiondefault <T> XMLElementReader<T>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.Methods inherited from interface org.jboss.staxmapper.XMLElementReader
readElement
-
Method Details
-
whenAbsent
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
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
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
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
-