blob: 08101c34d6924c3934914b5c22de96e490071408 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014, 2017 1C-Soft LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Vladimir Piskarev (1C) - initial API and implementation
*******************************************************************************/
package org.eclipse.handly.model.impl;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.handly.model.ISourceElement;
import org.eclipse.handly.model.ISourceElementInfo;
import org.eclipse.handly.snapshot.ISnapshot;
import org.eclipse.handly.snapshot.StaleSnapshotException;
/**
* All {@link ISourceElement}s must implement this interface.
*
* @noextend This interface is not intended to be extended by clients.
*/
public interface ISourceElementImpl
extends IElementImpl, ISourceElement
{
/**
* Returns the smallest element within this element that includes
* the given source position, or <code>null</code> if the given position
* is not within the source range of this element. If no finer grained
* element is found at the position, this element itself is returned.
*
* @param position a source position (0-based)
* @param base a snapshot on which the given position is based,
* or <code>null</code> if the snapshot is unknown or doesn't matter
* @return the innermost element enclosing the given source position,
* or <code>null</code> if none (including this element itself)
* @throws CoreException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
* @throws StaleSnapshotException if snapshot inconsistency is detected,
* i.e. this element's current structure and properties are based on
* a different snapshot
*/
ISourceElement hSourceElementAt(int position, ISnapshot base)
throws CoreException;
/**
* Returns an object holding cached structure and properties for this element.
*
* @return {@link ISourceElementInfo} for this element (never <code>null</code>)
* @throws CoreException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
*/
ISourceElementInfo hSourceElementInfo() throws CoreException;
}