Class ManifestParser
java.lang.Object
org.eclipse.ease.lang.scriptarchive.ManifestParser
- All Implemented Interfaces:
ICodeParser
public class ManifestParser extends Object implements ICodeParser
-
Constructor Summary
Constructors Constructor Description ManifestParser() -
Method Summary
Modifier and Type Method Description ICompletionContextgetContext(IScriptEngine scriptEngine, Object resource, String contents, int position, int selectionRange)Parse the given piece of code into a language specificICompletionContext.StringgetHeaderComment(InputStream stream)Parses the file for a comment section at the beginning.SignatureInfogetSignatureInfo(InputStream stream)Gets signature, certificates, provider and message-digest algorithm of signature, and content excluding signature block.booleanisAcceptedBeforeHeader(String line)Verify if a line of code is accepted before the header comment section.
-
Constructor Details
-
ManifestParser
public ManifestParser()
-
-
Method Details
-
getHeaderComment
Description copied from interface:ICodeParserParses the file for a comment section at the beginning.- Specified by:
getHeaderCommentin interfaceICodeParser- Parameters:
stream- code content stream- Returns:
- comment data without decoration characters (eg: '*' at beginning of each line)
-
isAcceptedBeforeHeader
Description copied from interface:ICodeParserVerify if a line of code is accepted before the header comment section. This allows special magic tokens to be placed before the header comment as some script languages depend on that.- Specified by:
isAcceptedBeforeHeaderin interfaceICodeParser- Parameters:
line- line of code- Returns:
truewhen line is accepted before the comment header
-
getContext
public ICompletionContext getContext(IScriptEngine scriptEngine, Object resource, String contents, int position, int selectionRange)Description copied from interface:ICodeParserParse the given piece of code into a language specificICompletionContext.- Specified by:
getContextin interfaceICodeParser- Parameters:
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 position- Returns:
ICompletionContextwith parsed information if successful,nullin case invalid syntax given.
-
getSignatureInfo
Description copied from interface:ICodeParserGets signature, certificates, provider and message-digest algorithm of signature, and content excluding signature block.- Specified by:
getSignatureInfoin interfaceICodeParser- Parameters:
stream- provideInputStreamto get signature from- Returns:
SignatureInfoinstance containing signature, certificates, provider and message-digest algorithm, and content excluding signature block ornullif signature is not found or is not in proper format- Throws:
ScriptSignatureException- when there is text after signature block or error occurs while reading from provided input stream
-