|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectLexer
com.opensymphony.module.sitemesh.html.tokenizer.Parser
Looks for patterns of tokens in the Lexer and translates these to calls to pass to the TokenHandler.
TagTokenizer| Field Summary | |
private CharArray |
attributeBuffer
|
private List |
attributes
|
static short |
EQUALS
|
static short |
GT
|
private TokenHandler |
handler
|
private char[] |
input
|
private int |
length
|
static short |
LT
|
static short |
LT_CLOSE_MAGIC_COMMENT
|
static short |
LT_OPEN_MAGIC_COMMENT
|
private String |
name
|
private int |
position
|
private String |
pushbackText
|
private int |
pushbackToken
|
static short |
QUOTE
|
static short |
QUOTED
|
static short |
SLASH
|
static short |
TEXT
|
private int |
type
|
static short |
WHITESPACE
|
static short |
WORD
|
| Fields inherited from interface com.opensymphony.module.sitemesh.html.Tag |
CLOSE, CLOSE_MAGIC_COMMENT, EMPTY, OPEN, OPEN_MAGIC_COMMENT |
| Constructor Summary | |
Parser(char[] input,
TokenHandler handler)
|
|
| Method Summary | |
int |
getAttributeCount()
|
String |
getAttributeName(int index)
|
String |
getAttributeValue(int index)
|
String |
getAttributeValue(String name)
|
String |
getContents()
Get the complete contents of the text block, preserving original formatting. |
String |
getName()
Name of tag (ie. |
int |
getType()
Type of tag: <blah> - Type.OPEN </blah> - Type.CLOSE <blah/> - Type.EMPTY |
boolean |
hasAttribute(String name)
|
private void |
parseAttribute()
|
void |
parsedAttribute(String name,
String value,
boolean quoted)
|
void |
parsedTag(int type,
String name,
int start,
int length)
|
void |
parsedText(int position,
int length)
|
private void |
parseFullTag(int type,
String name,
int start)
|
private void |
parseTag(int type)
|
private void |
pushBack(int next)
|
protected void |
reportError(String message,
int line,
int column)
|
private void |
skipWhiteSpace()
|
void |
start()
|
private String |
text()
|
void |
writeTo(CharArray out)
Write out the complete contents of the text block, preserving original formatting. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final CharArray attributeBuffer
private int pushbackToken
private String pushbackText
public static final short SLASH
public static final short WHITESPACE
public static final short EQUALS
public static final short QUOTE
public static final short WORD
public static final short TEXT
public static final short QUOTED
public static final short LT
public static final short GT
public static final short LT_OPEN_MAGIC_COMMENT
public static final short LT_CLOSE_MAGIC_COMMENT
private final char[] input
private TokenHandler handler
private int position
private int length
private String name
private int type
private final List attributes
| Constructor Detail |
public Parser(char[] input,
TokenHandler handler)
| Method Detail |
private String text()
private void skipWhiteSpace()
throws IOException
IOExceptionprivate void pushBack(int next)
public void start()
private void parseTag(int type)
throws IOException
IOException
private void parseFullTag(int type,
String name,
int start)
throws IOException
IOException
private void parseAttribute()
throws IOException
IOException
public void parsedText(int position,
int length)
public void parsedTag(int type,
String name,
int start,
int length)
public void parsedAttribute(String name,
String value,
boolean quoted)
protected void reportError(String message,
int line,
int column)
public String getName()
Tag
getName in interface Tagpublic int getType()
Tag
getType in interface Tagpublic String getContents()
Text
getContents in interface TextText.writeTo(com.opensymphony.module.sitemesh.html.util.CharArray)public void writeTo(CharArray out)
Text
writeTo in interface Textpublic int getAttributeCount()
getAttributeCount in interface Tagpublic String getAttributeName(int index)
getAttributeName in interface Tagpublic String getAttributeValue(int index)
getAttributeValue in interface Tagpublic String getAttributeValue(String name)
getAttributeValue in interface Tagpublic boolean hasAttribute(String name)
hasAttribute in interface Tag
|
www.opensymphony.com/sitemesh/ | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||