public class ManifestParser extends java.lang.Object implements ICodeParser
Constructor and Description |
---|
ManifestParser() |
Modifier and Type | Method and Description |
---|---|
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)
Parses the file for a comment section at the beginning.
|
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 java.lang.String getHeaderComment(java.io.InputStream stream)
ICodeParser
getHeaderComment
in interface ICodeParser
stream
- code content streampublic boolean isAcceptedBeforeHeader(java.lang.String line)
ICodeParser
isAcceptedBeforeHeader
in interface ICodeParser
line
- 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)
ICodeParser
ICompletionContext
.getContext
in interface ICodeParser
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.public SignatureInfo getSignatureInfo(java.io.InputStream stream) throws ScriptSignatureException
ICodeParser
getSignatureInfo
in interface ICodeParser
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