|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.codegen.jet.JETReader
JETReader is an input buffer for the JSP parser. It should allow unlimited lookahead and pushback. It also has a bunch of parsing utility methods for understanding htmlesque thingies.
Field Summary | |
protected List |
baseURIs
|
protected JETMark |
current
|
protected char |
endTagFinalChar
|
protected char |
endTagInitialChar
|
protected String |
master
|
protected int |
size
|
protected List |
sourceFiles
|
protected char |
startTagInitialChar
|
protected boolean |
trimExtraNewLine
|
Constructor Summary | |
JETReader(String locationURI,
InputStream inputStream,
String encoding)
|
|
JETReader(String baseURI,
String locationURI,
InputStream inputStream,
String encoding)
|
Method Summary | |
void |
advance(int n)
|
String |
getBaseURI(int fileid)
|
char[] |
getChars(JETMark start,
JETMark stop)
|
String |
getFile(int fileid)
|
boolean |
hasMoreInput()
Returns whether more input is available. |
protected boolean |
hasTrailingNewLine()
Tests whether the current stream has at least one trailing newline, optionally followed by spaces. |
protected boolean |
isDelimiter()
Parse utils - Is current character a token delimiter ? |
protected boolean |
isSpace()
|
JETMark |
mark()
|
boolean |
matches(String string)
|
boolean |
matchesIgnoreCase(String string)
|
int |
nextChar()
|
String |
nextContent()
Gets Content until the next potential JSP element. |
protected void |
parseAttributeValue(HashMap into)
Parse an attribute/value pair, and store it in provided hash table. |
HashMap |
parseTagAttributes()
Parse some tag attributes. |
HashMap |
parseTagAttributesBean()
Parse some tag attributes for Beans. |
String |
parseToken(boolean quoted)
Parse a space delimited token. |
int |
peekChar()
|
boolean |
popFile()
|
protected void |
registerBaseURI(String baseURI)
Register a new baseURI. |
protected int |
registerSourceFile(String file)
Register a new source file. |
void |
reset(JETMark mark)
|
void |
setEndTag(String endTag)
|
void |
setStartTag(String startTag)
|
protected void |
skipNewLine()
If the next character would be a line break, moves the cursor past it. |
int |
skipSpaces()
|
JETMark |
skipUntil(String limit)
Skip until the given string is matched in the stream. |
void |
stackStream(String locationURI,
InputStream iStream,
String encoding)
|
void |
stackStream(String baseURI,
String locationURI,
InputStream iStream,
String encoding)
Stack a stream for parsing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected char startTagInitialChar
protected char endTagInitialChar
protected char endTagFinalChar
protected JETMark current
protected String master
protected List sourceFiles
protected List baseURIs
protected int size
protected boolean trimExtraNewLine
Constructor Detail |
public JETReader(String baseURI, String locationURI, InputStream inputStream, String encoding) throws JETException
public JETReader(String locationURI, InputStream inputStream, String encoding) throws JETException
Method Detail |
public String getFile(int fileid)
public String getBaseURI(int fileid)
public void stackStream(String locationURI, InputStream iStream, String encoding) throws JETException
JETException
public void stackStream(String baseURI, String locationURI, InputStream iStream, String encoding) throws JETException
iStream
- Stream ready to parseencoding
- Optional encoding to read the file.
JETException
public boolean popFile()
protected int registerSourceFile(String file)
protected void registerBaseURI(String baseURI)
public boolean hasMoreInput()
protected boolean hasTrailingNewLine()
protected void skipNewLine()
public int nextChar()
public String nextContent()
public char[] getChars(JETMark start, JETMark stop)
public int peekChar()
public JETMark mark()
public void reset(JETMark mark)
public boolean matchesIgnoreCase(String string)
public boolean matches(String string)
public void advance(int n)
public int skipSpaces()
public JETMark skipUntil(String limit)
limit
- The String to match.
JETMark
instance if found,
null otherwise.protected boolean isSpace()
public String parseToken(boolean quoted) throws JETException
quoted
- If true accept quoted strings.
JETException
protected void parseAttributeValue(HashMap into) throws JETException
av := spaces token spaces '=' spaces token spacesWhere token is defined by
parseToken
and
spaces is defined by skipSpaces
.
The name is always considered case insensitive, hence stored in its
lower case version.
into
- The HashMap instance to save the result to.
JETException
public HashMap parseTagAttributesBean() throws JETException
tag-attrs := empty | attr-list (">" | "-->" | %>) attr-list := empty | av spaces attr-list empty := spacesWhere av is defined by
parseAttributeValue
.
JETException
public HashMap parseTagAttributes() throws JETException
tag-attrs := empty | attr-list (">" | "-->" | %>) attr-list := empty | av spaces attr-list empty := spacesWhere av is defined by
parseAttributeValue
.
JETException
protected boolean isDelimiter()
isSpace
.
public void setStartTag(String startTag)
public void setEndTag(String endTag)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |