public interface ICodeParser
Modifier and Type | Method and Description |
---|---|
ICompletionContext |
getContext(IScriptEngine scriptEngine,
Object resource,
String contents,
int position,
int selectionRange)
Parse the given piece of code into a language specific
ICompletionContext . |
String |
getHeaderComment(InputStream stream)
Parses the file for a comment section at the beginning.
|
SignatureInfo |
getSignatureInfo(InputStream stream)
Gets signature, certificates, provider and message-digest algorithm of signature, and content excluding signature block.
|
boolean |
isAcceptedBeforeHeader(String line)
Verify if a line of code is accepted before the header comment section.
|
String getHeaderComment(InputStream stream)
stream
- code content streamboolean isAcceptedBeforeHeader(String line)
line
- line of codetrue
when line is accepted before the comment headerICompletionContext getContext(IScriptEngine scriptEngine, Object resource, String contents, int position, int selectionRange)
ICompletionContext
.scriptEngine
- 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.SignatureInfo getSignatureInfo(InputStream stream) throws ScriptSignatureException
stream
- 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