@Immutable public final class XMLListHandler extends Object
<list> <item value="..."/> <item value="..."/> ... </list>
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_VALUE
Attribute name for the item value
|
static String |
ELEMENT_ITEM
Element name of a single item
|
static String |
ELEMENT_LIST
Name of the root element
|
| Modifier and Type | Method and Description |
|---|---|
static IMicroDocument |
createListDocument(Collection<String> aCollection) |
static com.helger.commons.collection.impl.ICommonsList<String> |
readList(com.helger.commons.io.IHasInputStream aISP) |
static com.helger.commons.state.ESuccess |
readList(com.helger.commons.io.IHasInputStream aISP,
Collection<String> aTargetList) |
static com.helger.commons.state.ESuccess |
readList(IMicroElement aParentElement,
Collection<String> aTargetList) |
static com.helger.commons.collection.impl.ICommonsList<String> |
readList(InputStream aIS)
Read a predefined XML file that contains list items.
|
static com.helger.commons.state.ESuccess |
readList(InputStream aIS,
Collection<String> aTargetList)
Read a predefined XML file that contains list items.
|
static com.helger.commons.state.ESuccess |
writeList(Collection<String> aCollection,
com.helger.commons.io.IHasOutputStream aOSP) |
static com.helger.commons.state.ESuccess |
writeList(Collection<String> aCollection,
OutputStream aOS)
Write the passed collection to the passed output stream using the
predefined XML layout.
|
public static final String ELEMENT_LIST
public static final String ELEMENT_ITEM
public static final String ATTR_VALUE
@Nullable @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<String> readList(@Nonnull com.helger.commons.io.IHasInputStream aISP)
@Nonnull public static com.helger.commons.state.ESuccess readList(@Nonnull com.helger.commons.io.IHasInputStream aISP, @Nonnull Collection<String> aTargetList)
@Nullable @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<String> readList(@Nonnull @WillClose InputStream aIS)
aIS - The input stream to read from. May not be null.
Automatically closed no matter whether reading succeeded or not.null if reading fails - all list items otherwise.@Nonnull public static com.helger.commons.state.ESuccess readList(@Nonnull @WillClose InputStream aIS, @Nonnull Collection<String> aTargetList)
aIS - The input stream to read from. May not be null.
Automatically closed no matter whether reading succeeded or not.aTargetList - The target collection to be filled. May not be null.ESuccess.SUCCESS if reading succeeded,
ESuccess.FAILURE if the input stream is no valid XML or any
other error occurred.@Nonnull public static com.helger.commons.state.ESuccess readList(@Nonnull IMicroElement aParentElement, @Nonnull Collection<String> aTargetList)
@Nonnull public static IMicroDocument createListDocument(@Nonnull Collection<String> aCollection)
@Nonnull public static com.helger.commons.state.ESuccess writeList(@Nonnull Collection<String> aCollection, @Nonnull com.helger.commons.io.IHasOutputStream aOSP)
@Nonnull public static com.helger.commons.state.ESuccess writeList(@Nonnull Collection<String> aCollection, @Nonnull @WillClose OutputStream aOS)
aCollection - The map to be written. May not be null.aOS - The output stream to write to. The stream is closed independent of
success or failure. May not be null.ESuccess.SUCCESS when everything went well,
ESuccess.FAILURE otherwise.Copyright © 2014–2019 Philip Helger. All rights reserved.