|
LPEX 4.4.0 |
|||||||||
| 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
public class JavaParser
Document parser for Java.
Actions and assigned keys added by this document parser:
HtmlParser#tagSelectionKeys 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)bidiPROTOKEY_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 parser| Method Detail |
|---|
protected void initParser()
initParser in class LpexCommonParserpublic void parseAll()
parseAll in class LpexCommonParserpublic void parseElement(int element)
parseElement in class LpexCommonParserelement - an element affected by a committed change in this viewLpexView.parsePending(int),
LpexView.elementParsed(int),
Total and incremental parsepublic ResourceBundle getProfile()
getProfile in class LpexCommonParserLpexCommonParser.getProperty(java.lang.String),
Parser propertiespublic String getLanguage()
"Java", the main language supported by this parser.
getLanguage in class LpexCommonParserLpexCommonParser.LANGUAGE_JAVApublic String getLanguage(LpexDocumentLocation loc)
getLanguage in class LpexCommonParserloc - document location
LpexCommonParser.getLanguage(),
Mixed content documentsprotected void propertySet(String key)
propertySet in class LpexCommonParserkey - 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 LpexCommonParserpopupLocation - 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 LpexCommonParserprotected void openLine()
openLine in class LpexCommonParserprotected void splitLine()
splitLine in class LpexCommonParserLpexCommonParser.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 LpexCommonParserch - 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 LpexCommonParserelement - 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 LpexParsergetProperty in class LpexCommonParserkey - 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 properties
protected void addErrorMessage(int element,
String message)
element - the element in errormessage - error message key in LPEX's Resources.properties
protected void expandProtoKeyword(int s,
int e,
String p)
expandProtoKeyword in class LpexCommonParsers - 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 | |||||||||