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

org.eclipse.core.runtime.content.IContentTypeMatcher Maven / Gradle / Ivy

Go to download

AspectJ tools most notably contains the AspectJ compiler (AJC). AJC applies aspects to Java classes during compilation, fully replacing Javac for plain Java classes and also compiling native AspectJ or annotation-based @AspectJ syntax. Furthermore, AJC can weave aspects into existing class files in a post-compile binary weaving step. This library is a superset of AspectJ weaver and hence also of AspectJ runtime.

There is a newer version: 1.9.22.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.core.runtime.content;

import java.io.*;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.preferences.IScopeContext;

/**
 * An object that performs content type matching queries.
 * 

* This interface is not intended to be implemented by clients. *

* * @see IContentTypeManager#getMatcher(IContentTypeManager.ISelectionPolicy, IScopeContext) * @since 3.1 */ public interface IContentTypeMatcher { /** * Returns the preferred content type for the given contents and file name. *

* Returns null if no associated content types are * found. *

*

* If a file name is not provided, the entire content type registry will be * queried. For performance reasons, it is highly recommended * to provide a file name if available. *

*

* Any IOExceptions that may occur while reading the given input stream * will flow to the caller. The input stream will not be closed by this * operation. *

* * @param contents an input stream * @param fileName the file name associated to the contents, or null * @return the preferred content type associated to the given file name, or null * @throws IOException if an error occurs while reading the contents */ IContentType findContentTypeFor(InputStream contents, String fileName) throws IOException; /** * Returns the preferred content type for the given file name. If multiple content types * are associated with the given file name, the one considered the most appropriated will * be returned. If there are no content types associated, null is returned. * * @param fileName the name of the file * @return the preferred content type associated to the given file name, or null */ IContentType findContentTypeFor(String fileName); /** * Returns the content types associated to the given contents and file name. *

* Returns an empty array if no associated content types are found. *

*

* If a file name is not provided, the entire content type registry will be * queried. For performance reasons, it is highly recommended * to provide a file name if available. *

*

* Any IOExceptions that may occur while reading the given input stream * will flow to the caller. The input stream will not be closed by this * operation. *

* * @param contents an input stream * @param fileName the file name associated to the contents, or null * @return all content types associated to the given contents and file name * @throws IOException if an error occurs while reading the contents */ IContentType[] findContentTypesFor(InputStream contents, String fileName) throws IOException; /** * Returns all content types known by the platform that are associated to the given file name. *

* Returns an empty array if there are no content types associated. *

* * @param fileName the name of the file * @return all content types associated to the given file spec */ IContentType[] findContentTypesFor(String fileName); /** * Tries to obtain a description for the given contents and file name. *

* Any IOExceptions that may occur while reading the given input stream * will flow to the caller. The input stream will not be closed by this * operation. *

*

* If a file name is not provided, the entire content type registry will be * queried. For performance reasons, it is highly recommended * to provide a file name if available. *

* * @param contents the contents to be interpreted * @param fileName the file name associated to the contents, or null * @param options an array of keys for all properties that should be * described, or IContentDescription.ALL, for all of them * @return a content description if one could be obtained, or null * @throws IOException if an error occurs while reading the contents * @see IContentDescription */ IContentDescription getDescriptionFor(InputStream contents, String fileName, QualifiedName[] options) throws IOException; /** * Tries to obtain a description for the given contents and file name. *

* Any IOExceptions that may occur while reading the given input stream * will flow to the caller. The reader will not be closed by this * operation. *

*

* If a file name is not provided, the entire content type registry will be * queried. For performance reasons, it is highly recommended * to provide a file name if available. *

* * @param contents the contents to be interpreted * @param fileName the file name associated to the contents, or null * @param options an array of keys for all properties that should be * described, or IContentDescription.ALL, for all of them * @return a content description if one could be obtained, or null * @throws IOException if an error occurs while reading the contents * @see IContentDescription */ IContentDescription getDescriptionFor(Reader contents, String fileName, QualifiedName[] options) throws IOException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy