IParseUnit

public interface IParseUnit extends IUnit

Unit representing a parsed source file. A parse unit can be passed to the IAnalysisService to analyze the parse unit into a IAnalyzeUnit, or passed to the ITransformService to transform the parse unit into a ITransformUnit.

Methods

duration

long duration()
Returns:Parse duration in nanoseconds, or -1 if the duration is unknown.

input

IInputUnit input()
Returns:The input unit this unit was made with.

messages

Iterable<IMessage> messages()
Returns:Messages produced by the parser.

success

boolean success()
Returns:True if parsing was successful, i.e. the parser produced a result and no errors were encountered. False otherwise.

valid

boolean valid()
Returns:True if this unit is valid, i.e. the parser parsed the source file without exceptions. Even when this unit is valid, it may still be unsuccessful, use success() to check for that.