public class InternationalStringXmlReaderWriter extends Object
The helper should not be initialized, just use the static utility methods.
| Modifier and Type | Field and Description |
|---|---|
static String |
XML_ATTR_LOCALE |
static String |
XML_ATTR_TEXT |
static String |
XML_ELEMENT_LOCALIZED_STRING |
static String |
XML_TAG |
| Modifier and Type | Method and Description |
|---|---|
static Collection<org.faktorips.values.LocalizedString> |
fromXml(Element element)
Reads the
localized strings stored in the given XML Element. |
static Collection<org.faktorips.values.LocalizedString> |
fromXml(Element element,
String tagName)
Reads the
localized strings stored in the child Element with
the specified name. |
static Element |
toXml(Document doc,
Collection<org.faktorips.values.LocalizedString> localizedStrings)
Creates a new
Element containing the given localized strings. |
static Element |
toXml(Document doc,
org.faktorips.values.DefaultInternationalString internationalString)
Creates a new
Element containing the given DefaultInternationalString. |
public static final String XML_TAG
public static final String XML_ELEMENT_LOCALIZED_STRING
public static final String XML_ATTR_LOCALE
public static final String XML_ATTR_TEXT
public static Element toXml(Document doc, org.faktorips.values.DefaultInternationalString internationalString)
Element containing the given DefaultInternationalString.doc - the xml Document used to store the new element.internationalString - the DefaultInternationalString to be saved.public static Element toXml(Document doc, Collection<org.faktorips.values.LocalizedString> localizedStrings)
Element containing the given localized strings.
The element that is created represents an DefaultInternationalString even though the
element can be created from passing only the contents (the localized strings) of an
international string.doc - the xml Document used to store the new element.localizedStrings - the localized strings to be saved.public static Collection<org.faktorips.values.LocalizedString> fromXml(Element element)
localized strings stored in the given XML Element.
If the given element is not representing an international string, an empty collection is
returned.public static Collection<org.faktorips.values.LocalizedString> fromXml(Element element, String tagName)
localized strings stored in the child Element with
the specified name. If the given element does not contain a child of the given name or if
that child does not represent an international string, an empty collection is returned.element - the XML Element representing the parent of an international string.tagName - the name of the child node representing an international string.localized strings defined in the
international string.Copyright © 2014. All rights reserved.