Package org.eclipse.tycho.core.ee
Class StandardExecutionEnvironment
- java.lang.Object
-
- org.eclipse.tycho.core.ee.StandardExecutionEnvironment
-
- All Implemented Interfaces:
java.lang.Comparable<StandardExecutionEnvironment>,ExecutionEnvironment
public class StandardExecutionEnvironment extends java.lang.Object implements java.lang.Comparable<StandardExecutionEnvironment>, ExecutionEnvironment
Represents a standard OSGi execution environment profile. See the list of known OSGi profiles in bundle org.eclipse.osgi, file profile.list. Standard execution environment capabilities can be referenced in MANIFEST.MF using the header "Bundle-RequiredExecutionEnvironment". In order to pick the minimal, required profile from the alternatives listed in a BREE header, instances of this class have a total ordering. TODO This class both represents an EE profile (i.e. the concrete EE implementation used by the compiler) and an EE capability (i.e. the capability required via the BREE). This should be separate classes. (An EE profile typically provides multiple EE capabilities.)
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcompilerSourceLevelprivate java.lang.StringcompilerTargetLevelprivate EEVersioneeVersionprivate java.lang.StringprofileNameprivate java.util.PropertiesprofilePropertiesprivate java.util.Set<java.lang.String>systemPackagesprivate static java.util.Map<java.lang.String,java.lang.String>TARGET_ALIASES
-
Constructor Summary
Constructors Constructor Description StandardExecutionEnvironment(java.util.Properties profileProperties)Do no instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(StandardExecutionEnvironment otherEnv)booleanequals(java.lang.Object obj)java.lang.StringgetCompilerSourceLevelDefault()Returns a reasonable compiler source level default for this execution environment.java.lang.StringgetCompilerTargetLevelDefault()Returns a reasonable compiler target level default for this execution environment.java.lang.StringgetProfileName()java.util.PropertiesgetProfileProperties()java.util.Set<java.lang.String>getSystemPackages()Returns the list of packages (without versions) provided by the execution environment.inthashCode()booleanisCompatibleCompilerTargetLevel(java.lang.String target)Returnsfalseif classes compiled with the given compiler target level can certainly not be executed on this execution environment.private EEVersionparseEEVersion(java.lang.String systemCaps)java.lang.StringtoString()private static org.osgi.framework.VersiontoTargetVersion(java.lang.String target)
-
-
-
Field Detail
-
TARGET_ALIASES
private static final java.util.Map<java.lang.String,java.lang.String> TARGET_ALIASES
-
profileName
private java.lang.String profileName
-
compilerSourceLevel
private java.lang.String compilerSourceLevel
-
compilerTargetLevel
private java.lang.String compilerTargetLevel
-
systemPackages
private java.util.Set<java.lang.String> systemPackages
-
eeVersion
private EEVersion eeVersion
-
profileProperties
private java.util.Properties profileProperties
-
-
Constructor Detail
-
StandardExecutionEnvironment
StandardExecutionEnvironment(java.util.Properties profileProperties)
Do no instantiate. Use factory method insteadExecutionEnvironmentUtils.getExecutionEnvironment(String).
-
-
Method Detail
-
parseEEVersion
private EEVersion parseEEVersion(java.lang.String systemCaps)
-
getProfileName
public java.lang.String getProfileName()
- Specified by:
getProfileNamein interfaceExecutionEnvironment
-
getCompilerSourceLevelDefault
public java.lang.String getCompilerSourceLevelDefault()
Description copied from interface:ExecutionEnvironmentReturns a reasonable compiler source level default for this execution environment.- Specified by:
getCompilerSourceLevelDefaultin interfaceExecutionEnvironment- Returns:
- a compiler source level matching the execution environment, or
nullif unknown.
-
getCompilerTargetLevelDefault
public java.lang.String getCompilerTargetLevelDefault()
Description copied from interface:ExecutionEnvironmentReturns a reasonable compiler target level default for this execution environment.- Specified by:
getCompilerTargetLevelDefaultin interfaceExecutionEnvironment- Returns:
- a compiler target level matching the execution environment, or
nullif unknown.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSystemPackages
public java.util.Set<java.lang.String> getSystemPackages()
Description copied from interface:ExecutionEnvironmentReturns the list of packages (without versions) provided by the execution environment.- Specified by:
getSystemPackagesin interfaceExecutionEnvironment
-
compareTo
public int compareTo(StandardExecutionEnvironment otherEnv)
- Specified by:
compareToin interfacejava.lang.Comparable<StandardExecutionEnvironment>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getProfileProperties
public java.util.Properties getProfileProperties()
- Specified by:
getProfilePropertiesin interfaceExecutionEnvironment
-
isCompatibleCompilerTargetLevel
public boolean isCompatibleCompilerTargetLevel(java.lang.String target)
Description copied from interface:ExecutionEnvironmentReturnsfalseif classes compiled with the given compiler target level can certainly not be executed on this execution environment. Used to detect inconsistent configuration.- Specified by:
isCompatibleCompilerTargetLevelin interfaceExecutionEnvironment
-
toTargetVersion
private static org.osgi.framework.Version toTargetVersion(java.lang.String target)
-
-