Class XmlUtil
java.lang.Object
com.idmedia.translationstudio.impl.util.XmlUtil
Util Class
- Author:
- I-D Media AG
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddTag(@NotNull StringBuilder psXml, @NotNull String sNodeName, @Nullable Long plValue) Add an XML Nodestatic voidaddTag(@NotNull StringBuilder psXml, @NotNull String sNodeName, @Nullable String sValue) Add an XML Nodestatic voidaddTag(@NotNull StringBuilder psXml, @NotNull String sNodeName, @Nullable Date plValue) Add an XML Nodestatic voidaddTagList(@NotNull StringBuilder psXml, @NotNull String sNodeWrapper, @NotNull String sNodeEntry, @Nullable Collection<String> vsListable) Add an XML Liststatic voidaddTagList(@NotNull StringBuilder psXml, @NotNull String sNodeWrapper, @NotNull String sNodeEntry, @Nullable Collection<String> vsListable, boolean bEncodeContent) Add an XML Liststatic longconvert2Long(String sVal) static @NotNull StringextractNodeContent(String sXml, String sTag) static @NotNull StringextractNodeContent(String sXml, String sTag, int nOffset) extractNodeContentList(String sXml, String sListableNodeName) static @Nullable StringextractNodeContentWithAttributeSpace(@NotNull String sXml, @NotNull String sTag) Extract the given node and expect at least one attribute in itstatic @Nullable CDATASectionfindFirstCDataChildNode(@Nullable Node pElement) Find the very first element child nodestatic @Nullable ElementfindFirstChildNode(@Nullable Node pElement) Find the very first element child nodefindFirstNodesByType(Node pElement, @NotNull String sNodeType) Find the very first (and only) LANG nodestatic voidfindFirstNodesByType(Node pElement, @NotNull String sNodeType, @NotNull List<Element> vpList) Find the very first (and only) LANG nodestatic @Nullable ElementfindFirstNodeTypes(@Nullable Node pElement, @NotNull String sNodeType) Find the very first (and only) LANG nodestatic @Nullable ElementfindLanguageNode(Element pElement) Find the very first (and only) LANG nodestatic @Nullable ElementgetFirstChildElement(Element pElement) Find the very first (and only) LANG nodestatic booleanisElementNode(@Nullable Node pNode) static voidremoveChildNodes(Node node) remove all children of a given node
-
Method Details
-
isElementNode
-
findFirstNodeTypes
@Nullable public static @Nullable Element findFirstNodeTypes(@Nullable @Nullable Node pElement, @NotNull @NotNull String sNodeType) Find the very first (and only) LANG node- Parameters:
pElement- Root nodesNodeType- TAG name to search- Returns:
-
findFirstNodesByType
@NotNull public static @NotNull List<Element> findFirstNodesByType(Node pElement, @NotNull @NotNull String sNodeType) Find the very first (and only) LANG node- Parameters:
pElement- Root nodesNodeType- TAG name to search- Returns:
-
findFirstNodesByType
@Nullable public static void findFirstNodesByType(Node pElement, @NotNull @NotNull String sNodeType, @NotNull @NotNull List<Element> vpList) Find the very first (and only) LANG node- Parameters:
pElement- Root nodesNodeType- TAG name to searchvpList-
-
findFirstChildNode
Find the very first element child node- Parameters:
pElement- Root node- Returns:
-
getFirstChildElement
Find the very first (and only) LANG node- Parameters:
pElement-- Returns:
-
findFirstCDataChildNode
@Nullable public static @Nullable CDATASection findFirstCDataChildNode(@Nullable @Nullable Node pElement) Find the very first element child node- Parameters:
pElement- Root node- Returns:
-
findLanguageNode
Find the very first (and only) LANG node- Parameters:
pElement-- Returns:
-
removeChildNodes
remove all children of a given node- Parameters:
node- Node to be cleared
-
extractNodeContentList
-
extractNodeContent
-
extractNodeContent
-
addTag
public static void addTag(@NotNull @NotNull StringBuilder psXml, @NotNull @NotNull String sNodeName, @Nullable @Nullable String sValue) Add an XML Node- Parameters:
psXml- Target XMLsNodeName- Node NamesValue- Value
-
addTag
public static void addTag(@NotNull @NotNull StringBuilder psXml, @NotNull @NotNull String sNodeName, @Nullable @Nullable Date plValue) Add an XML Node- Parameters:
psXml- Target XMLsNodeName- Node NameplValue- Value
-
addTag
public static void addTag(@NotNull @NotNull StringBuilder psXml, @NotNull @NotNull String sNodeName, @Nullable @Nullable Long plValue) Add an XML Node- Parameters:
psXml- Target XMLsNodeName- Node NameplValue- Value
-
addTagList
public static void addTagList(@NotNull @NotNull StringBuilder psXml, @NotNull @NotNull String sNodeWrapper, @NotNull @NotNull String sNodeEntry, @Nullable @Nullable Collection<String> vsListable, boolean bEncodeContent) Add an XML List- Parameters:
psXml- Target XMLsNodeWrapper- Wrapper Node NamesNodeEntry- List Entry Node NamevsListable- ListablebEncodeContent- Encode listable entry
-
addTagList
public static void addTagList(@NotNull @NotNull StringBuilder psXml, @NotNull @NotNull String sNodeWrapper, @NotNull @NotNull String sNodeEntry, @Nullable @Nullable Collection<String> vsListable) Add an XML List- Parameters:
psXml- Target XMLsNodeWrapper- Wrapper Node NamesNodeEntry- List Entry Node NamevsListable- Listable
-
convert2Long
-
extractNodeContentWithAttributeSpace
@Nullable public static @Nullable String extractNodeContentWithAttributeSpace(@NotNull @NotNull String sXml, @NotNull @NotNull String sTag) Extract the given node and expect at least one attribute in it- Parameters:
sXml-sTag-- Returns:
-