org.eclipse.core.runtime.preferences.PreferenceFilterEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aspectjtools Show documentation
Show all versions of aspectjtools Show documentation
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.
/*******************************************************************************
* Copyright (c) 2005, 2015 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
* Semion Chichelnitsky ([email protected]) - bug 208564
*******************************************************************************/
package org.eclipse.core.runtime.preferences;
/**
* Class which represents and preference filter entry to be used during preference
* import/export (for example).
*
* @since 3.1
* @see org.eclipse.core.runtime.preferences.IPreferenceFilter
*/
public final class PreferenceFilterEntry {
private final String key;
private String matchType;
/**
* Constructor for the class. Create a new preference filter entry with the given
* key. The key must not be null
or empty.
*
* @param key the name of the preference key
*/
public PreferenceFilterEntry(String key) {
super();
if (key == null || key.length() == 0)
throw new IllegalArgumentException();
this.key = key;
}
/**
* Constructor for the class. Create a new preference filter entry with the given
* key and match type. The key must not be null
or empty.
*
* Setting matchType to "prefix" treats the key as if it were a regular expression
* with an asterisk at the end. If matchType is null
, the key must be
* an exact match.
*
* @param key the name of the preference key
* @param matchType specifies key match type, may be null
to indicate
* that exact match is required
* @since 3.3
*/
public PreferenceFilterEntry(String key, String matchType) {
this(key);
this.matchType = matchType;
}
/**
* Return the name of the preference key for this filter entry.
* It will not return null
or the
* empty string.
*
* @return the name of the preference key
*/
public String getKey() {
return key;
}
/**
* Return the match type specified for this filter. May return null
* to indicate that exact match is used.
* @return matchType the match type, might be null
indicating that
* exact match is used
* @since 3.3
*/
public String getMatchType() {
return matchType;
}
}