Package org.apache.wicket.markup.parser
Interface IXmlPullParser
-
- All Known Implementing Classes:
XmlPullParser
public interface IXmlPullParserThe interface of a streaming XML parser as required by Wicket.- Author:
- Juergen Donnerstag, Jonathan Locke
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIXmlPullParser.HttpTagTypeThe last element found
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.CharSequencegetDoctype()Gets the <!DOCTYPE ...> tag if found in the markupXmlTaggetElement()java.lang.StringgetEncoding()Return the encoding applied while reading the markup resource.java.lang.CharSequencegetInput(int fromPos, int toPos)Wicket dissects the markup into Wicket relevant tags and raw markup, which is not further analyzed by Wicket.java.lang.CharSequencegetInputFromPositionMarker(int toPos)Wicket dissects the markup into Wicket relevant tags and raw markup, which is not further analyzed by Wicket.java.lang.CharSequencegetString()IXmlPullParser.HttpTagTypenext()Move to the next XML elementvoidparse(java.io.InputStream inputStream)Reads and parses markup from an input stream, using UTF-8 encoding by default when not specified in XML declaration.voidparse(java.io.InputStream inputStream, java.lang.String encoding)Reads and parses markup from an input stream.voidparse(java.lang.CharSequence string)Parse the markup provided.voidsetPositionMarker()Set the position marker of the markup at the current position.voidsetPositionMarker(int pos)Set the position marker of the markup
-
-
-
Method Detail
-
getEncoding
java.lang.String getEncoding()
Return the encoding applied while reading the markup resource. The encoding is determined by analyzing the <?xml version=".." encoding=".." ?> tag.- Returns:
- if null, JVM defaults have been used.
-
getDoctype
java.lang.CharSequence getDoctype()
Gets the <!DOCTYPE ...> tag if found in the markup- Returns:
- Null, if not found
-
getInputFromPositionMarker
java.lang.CharSequence getInputFromPositionMarker(int toPos)
Wicket dissects the markup into Wicket relevant tags and raw markup, which is not further analyzed by Wicket. The method getInputFromPositionMarker() is used to access the raw markup.- Parameters:
toPos- To position- Returns:
- The raw markup in between the position marker and toPos
-
getInput
java.lang.CharSequence getInput(int fromPos, int toPos)Wicket dissects the markup into Wicket relevant tags and raw markup, which is not further analyzed by Wicket. The getInputSubsequence() method is used to access the raw markup.- Parameters:
fromPos- From positiontoPos- To position- Returns:
- The raw markup in between fromPos and toPos
-
parse
void parse(java.lang.CharSequence string) throws java.io.IOExceptionParse the markup provided. Use nextTag() to access the tags contained one after another.Note: xml character encoding is NOT applied. It is assumed the input provided does have the correct encoding already.
- Parameters:
string- The markup to be parsed- Throws:
java.io.IOException- Error while reading the resource
-
parse
void parse(java.io.InputStream inputStream) throws java.io.IOExceptionReads and parses markup from an input stream, using UTF-8 encoding by default when not specified in XML declaration. Use nextTag() to access the tags contained, one after another.- Parameters:
inputStream- The input stream to read and parse- Throws:
java.io.IOException- Error while reading the resource
-
parse
void parse(java.io.InputStream inputStream, java.lang.String encoding) throws java.io.IOExceptionReads and parses markup from an input stream. Use nextTag() to access the tags contained, one after another.- Parameters:
inputStream- A resource like e.g. a fileencoding- Use null to apply JVM/OS default- Throws:
java.io.IOException- Error while reading the resource
-
next
IXmlPullParser.HttpTagType next() throws java.text.ParseException
Move to the next XML element- Returns:
- o, if end of file. Else a TAG, COMMENT etc.
- Throws:
java.text.ParseException
-
getElement
XmlTag getElement()
- Returns:
- The current element
-
getString
java.lang.CharSequence getString()
- Returns:
- The xml string from the last element
-
setPositionMarker
void setPositionMarker()
Set the position marker of the markup at the current position.
-
setPositionMarker
void setPositionMarker(int pos)
Set the position marker of the markup- Parameters:
pos-
-
-