@Immutable public final class XMLMapHandler extends Object
Map.<mapping> <map key="..." value="..."/> <map key="..." value="..."/> ... </mapping>
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_KEY
Attribute name for key of a single mapping
|
static String |
ATTR_VALUE
Attribute name for value of a single mapping
|
static String |
ELEMENT_MAP
Element name for a single mapping
|
static String |
ELEMENT_MAPPING
Root element name
|
| Modifier and Type | Method and Description |
|---|---|
static IMicroDocument |
createMapDocument(Map<String,String> aMap) |
static Map<String,String> |
readMap(IHasInputStream aISP) |
static ESuccess |
readMap(IHasInputStream aISP,
Map<String,String> aTargetMap) |
static ESuccess |
readMap(IMicroElement aParentElement,
Map<String,String> aTargetMap) |
static Map<String,String> |
readMap(InputStream aIS)
Read a mapping from the passed input stream.
|
static ESuccess |
readMap(InputStream aIS,
Map<String,String> aTargetMap)
Read a mapping from the passed input stream.
|
static ESuccess |
writeMap(Map<String,String> aMap,
IHasOutputStream aOSP) |
static ESuccess |
writeMap(Map<String,String> aMap,
OutputStream aOS)
Write the passed map to the passed output stream using the predefined XML
layout.
|
public static final String ELEMENT_MAPPING
public static final String ELEMENT_MAP
public static final String ATTR_KEY
public static final String ATTR_VALUE
@Nullable @ReturnsMutableCopy public static Map<String,String> readMap(@Nonnull IHasInputStream aISP)
@Nonnull public static ESuccess readMap(@Nonnull IHasInputStream aISP, @Nonnull Map<String,String> aTargetMap)
@Nullable @ReturnsMutableCopy public static Map<String,String> readMap(@Nonnull@WillClose InputStream aIS)
aIS - The input stream to read from. May not be null.null if reading the map failed@Nonnull public static ESuccess readMap(@Nonnull@WillClose InputStream aIS, @Nonnull Map<String,String> aTargetMap)
aIS - The input stream to read from. May not be null.aTargetMap - The target map to be filled.ESuccess.SUCCESS if the stream could be opened, if it could
be read as XML and if the root element was correct.
ESuccess.FAILURE otherwise.@Nonnull public static ESuccess readMap(@Nonnull IMicroElement aParentElement, @Nonnull Map<String,String> aTargetMap)
@Nonnull public static IMicroDocument createMapDocument(@Nonnull Map<String,String> aMap)
@Nonnull public static ESuccess writeMap(@Nonnull Map<String,String> aMap, @Nonnull IHasOutputStream aOSP)
@Nonnull public static ESuccess writeMap(@Nonnull Map<String,String> aMap, @Nonnull@WillClose OutputStream aOS)
aMap - 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–2015 Philip Helger. All rights reserved.