public abstract class AbstractCodeParser extends java.lang.Object implements ICodeParser
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
PARAMETER_PATTERN |
| Constructor and Description |
|---|
AbstractCodeParser() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
extractKeywords(java.lang.String comment) |
ICompletionContext |
getContext(IScriptEngine scriptEngine,
java.lang.Object resource,
java.lang.String contents,
int position,
int selectionRange)
Parse the given piece of code into a language specific
ICompletionContext. |
java.lang.String |
getHeaderComment(java.io.InputStream stream)
Default implementation to extract the first comment area from a stream.
|
SignatureInfo |
getSignatureInfo(java.io.InputStream stream)
Gets signature, certificates, provider and message-digest algorithm of signature, and content excluding signature block.
|
boolean |
isAcceptedBeforeHeader(java.lang.String line)
Verify if a line of code is accepted before the header comment section.
|
public static java.util.Map<java.lang.String,java.lang.String> extractKeywords(java.lang.String comment)
public java.lang.String getHeaderComment(java.io.InputStream stream)
getHeaderComment in interface ICodeParserstream - code content streampublic boolean isAcceptedBeforeHeader(java.lang.String line)
ICodeParserisAcceptedBeforeHeader in interface ICodeParserline - line of codetrue when line is accepted before the comment headerpublic ICompletionContext getContext(IScriptEngine scriptEngine, java.lang.Object resource, java.lang.String contents, int position, int selectionRange)
ICodeParserICompletionContext.getContext in interface ICodeParserscriptEngine - running script engineresource - resource instance to be parsedcontents - code to be parsed (only up to cursor position)position - cursor position within contentsselectionRange - amount of selected characters from cursor positionICompletionContext with parsed information if successful, null in case invalid syntax given.public SignatureInfo getSignatureInfo(java.io.InputStream stream) throws ScriptSignatureException
ICodeParsergetSignatureInfo in interface ICodeParserstream - provide InputStream to get signature fromSignatureInfo instance containing signature, certificates, provider and message-digest algorithm, and content excluding signature block
or null if signature is not found or is not in proper formatScriptSignatureException - when there is text after signature block or error occurs while reading from provided input stream