|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.lpex.core.LpexCommonParser com.ibm.lpex.java.JavaParser
public class 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:
Parser properties handled directly by this parser:
TODO
)bidi
PROTOKEY_EMPTY
-
template expansion (proto action, Ctrl+R) for an empty document and for
the following keywords is provided in this parser's profile (install settings):case, do, doc, /**, err, for, if, iter, main, out, switch, try,
while, LpexAction, LpexCommand
.
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 |
getPopupItem(String key)
|
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. |
protected void |
initParser()
Initializes the parser. |
boolean |
isTokenDelimiter(char ch)
Returns true if the specified character is a token delimiter. |
boolean |
isWordCharacter(int element,
int position)
Redefines word characters for adequate word navigation in Java documents. |
protected void |
join()
Flows text inside a comment block during a join. |
protected void |
openLine()
Continues the comment for a line opened inside a comment block. |
void |
parseAll()
Total parse of the entire document. |
void |
parseElement(int element)
Incremental parse. |
protected void |
propertySet(String key)
Listens to changes to the taskTags parser property in this view. |
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, defineFilterAction, getInstallStyleAttributes, getLshToken, getStyleName, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, isPrimaryParser, lineComment, lpexView, matchToken, newLine, parse, 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 |
---|
protected void initParser()
initParser
in class LpexCommonParser
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 void propertySet(String key)
propertySet
in class LpexCommonParser
key
- base name of the parser property that was set, for example "autoIndent"LpexCommonParser.setProperty(String,String)
,
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiesprotected 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 String getPopupItem(String key)
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),
'$'
(comment task 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)
,
LpexCommonParser.tokenBegin(com.ibm.lpex.core.LpexDocumentLocation)
,
LpexCommonParser.tokenEnd(com.ibm.lpex.core.LpexDocumentLocation)
public boolean isWordCharacter(int element, int position)
isWordCharacter
in class LpexCommonParser
element
- an element in the document section currently loaded in the editorposition
- ONE-based position in the element textpublic 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 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
|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |