All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jdt.internal.compiler.env.ICompilationUnit Maven / Gradle / Ivy

There is a newer version: 3.39.0
Show newest version
/*******************************************************************************
 * Copyright (c) 2000, 2017 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.compiler.env;

import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;

/**
 * This interface denotes a compilation unit, providing its name and content.
 * 
 * 

* Note: This internal interface has been implemented illegally by the * org.apache.jasper.glassfish bundle from Orbit, see * bug 500211. * Avoid changing the API or supply default methods to avoid breaking the Eclipse Help system. *

*/ public interface ICompilationUnit extends IDependent { /** * Answer the contents of the compilation unit. * * In normal use, the contents are requested twice. * Once during the initial lite parsing step, then again for the * more detailed parsing step. * Implementors must never return null - return an empty char[] instead, * CharOperation.NO_CHAR being the candidate of choice. */ char[] getContents(); /** * Answer the name of the top level public type. * For example, {Hashtable}. */ char[] getMainTypeName(); /** * Answer the name of the package according to the directory structure * or null if package consistency checks should be ignored. * For example, {java, lang}. */ char[][] getPackageName(); /** * Answer if optional problems should be ignored for this compilation unit. * Implementors should return false if there is no preference. */ default boolean ignoreOptionalProblems() { return false; } /** * Returns the binding of the module that this compilation unit is associated with. * * @return the binding representing the module. */ default ModuleBinding module(LookupEnvironment environment) { return environment.getModule(getModuleName()); } /** * Returns the name of the module to which this compilation unit is associated. * A return value of {@code null} signals the unnamed module. * @return module name or {@code null} for the unnamed module. */ default char[] getModuleName() { return null; } default String getDestinationPath() { return null; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy