001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.doxia.sink;
020
021/**
022 * Interface for associating a {@link Sink} event with a document location.
023 * @since 2.0.0
024 */
025public interface Locator {
026    /**
027     * Returns the underlying source reference (for file based documents a relative file path, otherwise an arbitrary string or {@code null}).
028     * @return the source for the sink event (may be {@code null})
029     */
030    String getReference();
031
032    /**
033     * Returns the line number for the sink event (starting from 1).
034     * If it is not known returns {@code -1}.
035     *
036     * @return the line number for the sink event
037     */
038    int getLineNumber();
039
040    /**
041     * Returns the column number for the sink event (starting from 1).
042     * If it is not known returns {@code -1}.
043     *
044     * @return the column number for the sink event
045     */
046    int getColumnNumber();
047}