|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.lpex.core.LpexCommonParser
com.ibm.lpex.java.JavaParser
Document parser for Java.
Actions and assigned keys added by this document parser:
HtmlParser#tagSelection
Keys already defined (for example, by the active base editor profile and by the user profile) to an action different from nullAction are not redefined in here.
Editor actions modified by this document parser:
Actions redefined by LpexCommonParser and further modified by this document parser:
Template expansion (proto action, Ctrl+R) for an empty document and for the following keywords is provided in this parser's profile:
Field Summary |
---|
Constructor Summary | |
---|---|
JavaParser(LpexView lpexView)
Constructor for the parser. |
Method Summary | |
---|---|
protected void |
addErrorMessage(int element,
String message)
Displays an embedded error message for an element. |
protected void |
delete()
Flows text inside a comment block during a delete which joins lines. |
protected void |
document(LpexDocumentLocation cursor)
Documents a class / interface / method. |
protected void |
expandProtoKeyword(int s,
int e,
String p)
Subclassed in order to effectively run the doc action when the prototype keyword to expand is "/**". |
String |
getCommentStyleCharacters()
Returns the style characters used for styling comments ("cCt"). |
String |
getLanguage()
Returns "Java" , the main language supported by this parser. |
String |
getLanguage(LpexDocumentLocation loc)
Retrieve a string identifying the language segment at the specified location. |
protected String |
getPopupItems(int popupLocation)
Returns this parser's contribution to the popup. |
ResourceBundle |
getProfile()
Returns this parser's profile resource bundle. |
String |
getProperty(String key)
Expands LpexCommonParser's getProperty() to substitute arguments for key PROTOKEY_EMPTY. |
protected SqlLexer |
getSqlLexer(LpexCharStream sqlLexerStream)
Returns the SqlLexer. |
boolean |
isTokenDelimiter(char ch)
Returns true if the specified character is a token delimiter. |
protected void |
join()
Flows text inside a comment block during a join. |
protected void |
methods()
Deprecated. |
protected void |
openLine()
Continues the comment for a line opened inside a comment block. |
protected void |
outline()
Deprecated. |
void |
parseAll()
Total parse of the entire document. |
void |
parseElement(int element)
Incremental parse. |
protected boolean |
setLexer(int newLexer)
Sets or switches the active lexer. |
protected void |
setStyleAttributes()
Defines this parser's style attributes. |
protected void |
split()
Continues the comment for a line split inside a comment block. |
protected void |
splitLine()
Continues the comment for a line split inside a comment block. |
protected void |
trace(LpexDocumentLocation cursor)
Inserts trace call(s) for a method. |
Methods inherited from class com.ibm.lpex.core.LpexCommonParser |
---|
addDocumentMessage, addMessage, addMessage, addMessage, blockMarkWord, copyDocumentMessages, cursorIndent, defineFilterAction, getInstallStyleAttributes, getLshToken, getPopupParserItems, getPopupViewItems, getStyleName, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, lineComment, lpexView, matchToken, newLine, parse, propertySet, removeDocumentMessages, removeMessages, removeMessages, resetParser, setProperty, setStyle, styleString, terminateParser, tokenBegin, tokenEnd, totalParse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavaParser(LpexView lpexView)
lpexView
- the document view associated with this parserMethod Detail |
public void parseAll()
parseAll
in class LpexCommonParser
public void parseElement(int element)
parseElement
in class LpexCommonParser
element
- an element affected by a committed change in this viewLpexView.parsePending(int)
,
LpexView.elementParsed(int)
,
Total and incremental parsepublic ResourceBundle getProfile()
getProfile
in class LpexCommonParser
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiespublic String getLanguage()
"Java"
, the main language supported by this parser.
getLanguage
in class LpexCommonParser
LpexCommonParser.LANGUAGE_JAVA
public String getLanguage(LpexDocumentLocation loc)
getLanguage
in class LpexCommonParser
loc
- document location
LpexCommonParser.getLanguage()
,
Mixed content documentsprotected String getPopupItems(int popupLocation)
getPopupItems
in class LpexCommonParser
popupLocation
- the location on the pop-up menu of the items
requested, one of: LpexCommonParser.POPUP_TOP
, LpexCommonParser.POPUP_FILTERVIEW
,
LpexCommonParser.POPUP_SOURCE
, LpexCommonParser.POPUP_END
null
if noneLpexCommonParser.defineFilterAction(java.lang.String, java.lang.String)
protected void setStyleAttributes()
'_'
(layout blanks),
'k'
(keyword),
'r'
(keyword return),
'i'
(identifier),
'n'
(constant),
'q'
(string literal),
'o'
(operator),
'p'
(punctuation),
'c'
(comment),
'C'
(javadoc comment),
't'
(javadoc comment tag),
'b'
(brace),
'u'
(Unicode sequence),
'e'
(error).
public String getCommentStyleCharacters()
getCommentStyleCharacters
in class LpexCommonParser
protected void openLine()
openLine
in class LpexCommonParser
protected void splitLine()
splitLine
in class LpexCommonParser
LpexCommonParser.getTextIndent(int)
protected void split()
protected void join()
protected void delete()
public boolean isTokenDelimiter(char ch)
true
if the specified character is a token delimiter.
isTokenDelimiter
in class LpexCommonParser
ch
- character queried, for example, ')'LpexCommonParser.getToken(com.ibm.lpex.core.LpexDocumentLocation)
public String getProperty(String key)
getProperty
in interface LpexParser
getProperty
in class LpexCommonParser
key
- property name, for example, "proto.doc" for this parser's expansion
of the keyword "doc" by the proto action, or
"view.proto.doc" for this property as defined in the current view's
instance of the parserLpexCommonParser.getLanguage()
,
LpexCommonParser.getProfile()
,
Parser propertiesprotected void addErrorMessage(int element, String message)
element
- the element in errormessage
- error message key in LPEX's Resources.propertiesprotected void methods()
protected void outline()
protected void expandProtoKeyword(int s, int e, String p)
expandProtoKeyword
in class LpexCommonParser
s
- ZERO-based keyword start offset in the current elemente
- ZERO-based keyword end offset in the current elementp
- the prototype expansion stringprotected void document(LpexDocumentLocation cursor)
cursor
- document location in the scope of the class / interface /
method to documentprotected void trace(LpexDocumentLocation cursor)
cursor
- document location in the scope of the method to documentprotected boolean setLexer(int newLexer)
newLexer
- the new lexer, one of: LEXER_JAVA, LEXER_SQL
protected SqlLexer getSqlLexer(LpexCharStream sqlLexerStream)
The implementation of this method provided by the JavaParser class does
nothing, except return null
.
sqlLexerStream
- input character stream for the SQL lexer
|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |