Class XmlIndenter
java.lang.Object
edu.internet2.middleware.grouperClient.util.XmlIndenter
indent xml, assumes the input is not yet indented. Also, this is only for
testing or logging or documentation purposes, not production
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
find if the tag is a close tag (e.g.static int
findNextEndTagIndex
(String xml, int startFrom) find the end tag from xml and a start from indexstatic int
findNextStartTagIndex
(String xml, int startFrom) find the start tag from xml and a start from indexstatic boolean
see if we can ignore the tag, e.g.result()
get the resultstatic boolean
selfClosedTag
(String xml, int endTagIndex) find if the tag is closed onstatic String
find the current tag name should support: < a /> or < / b>static boolean
find if the tag contains text (note, dont call this if know it is self closed, though in that case it shouldnt be text anyways)
-
Constructor Details
-
XmlIndenter
- Parameters:
theXml
- is the xml to format indenter
-
-
Method Details
-
result
get the result- Returns:
- the result
-
ignoreTag
see if we can ignore the tag, e.g. xml header or doctype- Parameters:
theXml
-theStartTagIndex
-theEndTagIndex
-- Returns:
- true if ignore
-
tagName
find the current tag name should support: < a /> or < / b>- Parameters:
xml
-startTagIndex
-endTagIndex
- (or -1 if none found)- Returns:
- the current tag name
-
findNextStartTagIndex
find the start tag from xml and a start from index- Parameters:
xml
-startFrom
-- Returns:
- the start tag index of -1 if not found another
-
findNextEndTagIndex
find the end tag from xml and a start from index- Parameters:
xml
-startFrom
-- Returns:
- the start tag index of -1 if not found another
-
selfClosedTag
find if the tag is closed on- Parameters:
xml
-endTagIndex
-- Returns:
- true if self closed
-
closeTag
find if the tag is a close tag (e.g. </a>)- Parameters:
xml
-startTagIndex
-- Returns:
- true if self closed
-
textTag
public static boolean textTag(String xml, int endTagIndex, String tagName, String nextTagName, boolean isNextCloseTag) find if the tag contains text (note, dont call this if know it is self closed, though in that case it shouldnt be text anyways)- Parameters:
xml
-endTagIndex
-tagName
-nextTagName
-isNextCloseTag
-- Returns:
- true if contains text (as opposed to other tags)
-