|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.parser.AbstractMarkupFilter org.apache.wicket.markup.parser.XmlPullParser
public final class XmlPullParser
A fairly shallow markup pull parser which parses a markup string of a given type of markup (for example, html, xml, vxml or wml) into ComponentTag and RawMarkup tokens.
Field Summary | |
---|---|
static int |
BODY
Tag body in between two tags |
static int |
CDATA
|
static int |
COMMENT
|
static int |
NOT_INITIALIZED
next() must be called at least once for the Type to be valid |
static int |
PROCESSING_INSTRUCTION
...> |
static int |
SPECIAL_TAG
all other tags which look like |
static int |
TAG
|
Constructor Summary | |
---|---|
XmlPullParser()
Construct. |
Method Summary | |
---|---|
java.lang.String |
getEncoding()
Return the encoding applied while reading the markup resource. |
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. |
java.lang.CharSequence |
getInputFromPositionMarker(int toPos)
Wicket dissects the markup into Wicket relevant tags and raw markup, which is not further analyzed by Wicket. |
java.lang.String |
getXmlDeclaration()
Return the XML declaration string, in case if found in the markup. |
boolean |
next()
Gets the next tag from the input string. |
MarkupElement |
nextTag()
Gets the next tag from the input string. |
void |
parse(java.lang.CharSequence string)
Parse the given string. |
void |
parse(java.io.InputStream in)
Reads and parses markup from an input stream, using UTF-8 encoding by default when not specified in XML declaration. |
void |
parse(java.io.InputStream inputStream,
java.lang.String encoding)
Reads and parses markup from an input stream |
void |
setPositionMarker()
Set the position marker of the markup at the current position. |
void |
setPositionMarker(int pos)
Set the position marker of the markup |
java.lang.String |
toString()
|
Methods inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter |
---|
getParent, nextComponentTag, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.wicket.markup.parser.IMarkupFilter |
---|
getParent, setParent |
Field Detail |
---|
public static final int NOT_INITIALIZED
public static final int TAG
public static final int BODY
public static final int COMMENT
public static final int CDATA
public static final int PROCESSING_INSTRUCTION
public static final int SPECIAL_TAG
Constructor Detail |
---|
public XmlPullParser()
Method Detail |
---|
public java.lang.String getEncoding()
IXmlPullParser
getEncoding
in interface IXmlPullParser
IXmlPullParser.getEncoding()
public java.lang.String getXmlDeclaration()
IXmlPullParser
getXmlDeclaration
in interface IXmlPullParser
IXmlPullParser.getXmlDeclaration()
public final java.lang.CharSequence getInputFromPositionMarker(int toPos)
IXmlPullParser
getInputFromPositionMarker
in interface IXmlPullParser
toPos
- To position
IXmlPullParser.getInputFromPositionMarker(int)
public final java.lang.CharSequence getInput(int fromPos, int toPos)
IXmlPullParser
getInput
in interface IXmlPullParser
fromPos
- From positiontoPos
- To position
IXmlPullParser.getInput(int, int)
public final boolean next() throws java.text.ParseException
next
in interface IXmlPullParser
java.text.ParseException
public final MarkupElement nextTag() throws java.text.ParseException
nextTag
in interface IMarkupFilter
java.text.ParseException
public void parse(java.lang.CharSequence string) throws java.io.IOException, ResourceStreamNotFoundException
Note: xml character encoding is NOT applied. It is assumed the input provided does have the correct encoding already.
parse
in interface IXmlPullParser
string
- The input string
java.io.IOException
- Error while reading the resource
ResourceStreamNotFoundException
- Resource not foundpublic void parse(java.io.InputStream in) throws java.io.IOException, ResourceStreamNotFoundException
parse
in interface IXmlPullParser
in
- The input stream to read and parse
java.io.IOException
ResourceStreamNotFoundException
public void parse(java.io.InputStream inputStream, java.lang.String encoding) throws java.io.IOException, ResourceStreamNotFoundException
parse
in interface IXmlPullParser
inputStream
- The input stream to read and parseencoding
- The default character encoding of the input
java.io.IOException
ResourceStreamNotFoundException
public final void setPositionMarker()
IXmlPullParser
setPositionMarker
in interface IXmlPullParser
IXmlPullParser.setPositionMarker()
public final void setPositionMarker(int pos)
IXmlPullParser
setPositionMarker
in interface IXmlPullParser
IXmlPullParser.setPositionMarker(int)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |