@Override
    public Position apply( Position position )
    {
        Position result = position;
        if ( mapper != null )
        {
            Maybe<Integer> line = position.line();
            String lineContent = position.lineContent();
            Maybe<Integer> offset = position.offset();
            Maybe<Integer> pointer = position.pointer();
            Maybe<File> sourceFile = position.sourceFile();
            SourcePosition sp =
                new DefaultSourcePosition( line.isDefined() ? line.get().intValue() : -1, lineContent,
                                           offset.isDefined() ? offset.get().intValue() : -1,
                                           pointer.isDefined() ? pointer.get().intValue() : -1,
                                           sourceFile.isDefined() ? sourceFile.get() : null );
            try
            {
                SourcePosition mappedPosition = mapper.map( sp );
                if ( mappedPosition != null )
                {
                    result = new SBT013Position( mappedPosition );
                }
            }
            catch ( Throwable t )
            {
                logger.debug( t );
            }
        }
        return result;
    }
@ Override public Position apply ( Position position ) { Position result = position ; if ( mapper != null ) { Maybe < Integer > line = position . line ( ) ; String lineContent = position . lineContent ( ) ; Maybe < Integer > offset = position . offset ( ) ; Maybe < Integer > pointer = position . pointer ( ) ; Maybe < File > sourceFile = position . sourceFile ( ) ; SourcePosition sp = new DefaultSourcePosition ( line . isDefined ( ) ? line . get ( ) . intValue ( ) : - 1 , lineContent , offset . isDefined ( ) ? offset . get ( ) . intValue ( ) : - 1 , pointer . isDefined ( ) ? pointer . get ( ) . intValue ( ) : - 1 , sourceFile . isDefined ( ) ? sourceFile . get ( ) : null ) ; try { SourcePosition mappedPosition = mapper . map ( sp ) ; if ( mappedPosition != null ) { result = new SBT013Position ( mappedPosition ) ; } } catch ( Throwable t ) { logger . debug ( t ) ; } } return result ; }
Performs mapping from the position in generated source file to the position in original source file it was
generated from.<br>
<br>
If no position in original source file can be found, input position is returned.
<br>
Position in source file cannot be found in two cases:
<ul>
<li>file was not generated,</li>
<li>no appropriate mapper was configured.</li>
</ul>

@param position compilation error/warning position in generated file
@return position in source file or input position if no source position can be found
@return position in original source file or input position if position in original source file cannot be found