org.eclipse.ease.lang.scriptarchive

## Class ManifestParser

- java.lang.Object
- - org.eclipse.ease.lang.scriptarchive.ManifestParser

All Implemented Interfaces:
  ICodeParser

    public class ManifestParser
    extends java.lang.Object
    implements ICodeParser

### Constructor Summary

Constructors
Constructor and Description
`ManifestParser()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ManifestParser

    public ManifestParser()

### Method Detail

#### getHeaderComment

    public java.lang.String getHeaderComment(java.io.InputStream stream)

Description copied from interface: `ICodeParser`
Parses the file for a comment section at the beginning.

Specified by:
  `getHeaderComment` in interface `ICodeParser`
Parameters:
  `stream` - code content stream
Returns:
  comment data without decoration characters (eg: '*' at beginning of each line)

#### isAcceptedBeforeHeader

    public boolean isAcceptedBeforeHeader(java.lang.String line)

Description copied from interface: `ICodeParser`
Verify 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:
  `isAcceptedBeforeHeader` in interface `ICodeParser`
Parameters:
  `line` - line of code
Returns:
  `true` when line is accepted before the comment header

#### getContext

    public ICompletionContext getContext(IScriptEngine scriptEngine,
                                         java.lang.Object resource,
                                         java.lang.String contents,
                                         int position,
                                         int selectionRange)

Description copied from interface: `ICodeParser`
Parse the given piece of code into a language specific `ICompletionContext`.

Specified by:
  `getContext` in interface `ICodeParser`
Parameters:
  `scriptEngine` - running script engine
  `resource` - resource instance to be parsed
  `contents` - code to be parsed (only up to cursor position)
  `position` - cursor position within contents
  `selectionRange` - amount of selected characters from cursor position
Returns:
  `ICompletionContext` with parsed information if successful, `null` in case invalid syntax given.

#### getSignatureInfo

    public SignatureInfo getSignatureInfo(java.io.InputStream stream)
                                   throws ScriptSignatureException

Description copied from interface: `ICodeParser`
Gets signature, certificates, provider and message-digest algorithm of signature, and content excluding signature block.

Specified by:
  `getSignatureInfo` in interface `ICodeParser`
Parameters:
  `stream` - provide `InputStream` to get signature from
Returns:
  `SignatureInfo` 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 format
Throws:
  `ScriptSignatureException` - when there is text after signature block or error occurs while reading from provided input stream