blob: 1ac67d43a7be8e5cbbf5c34d974bcab7b4ff98a0 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2010 xored software, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*******************************************************************************/
package org.eclipse.dltk.compiler.env;
import org.eclipse.dltk.core.IModelElement;
/**
* This interface denotes a source of a module, providing its name and content.
*
* It was renamed from org.eclipse.dltk.compiler.env.ISourceModule to make names
* unique.
*
* If the object also implements {@link org.eclipse.dltk.core.ISourceModule},
* then it could be treated as a source file of the project, otherwise it's just
* a source code, without any physical location.
*
* @since 2.0
*/
public interface IModuleSource extends IDependent {
/**
* Answer the contents of the source module as string. Should return empty
* string on error.
*/
String getSourceContents();
/**
* Answer the contents of the source module as char[]. Should return empty
* array on error.
*/
char[] getContentsAsCharArray();
/**
* Returns the {@link IModelElement} this source module is related to or
* <code>null</code> if source is not associated with any model element.
*
* It doesn't mean this source code is exactly the same as the code of this
* model element, etc
*/
IModelElement getModelElement();
}