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.String
compilerSourceLevel
private java.lang.String
compilerTargetLevel
private EEVersion
eeVersion
private java.lang.String
profileName
private java.util.Properties
profileProperties
private java.util.Set<java.lang.String>
systemPackages
private 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 int
compareTo(StandardExecutionEnvironment otherEnv)
boolean
equals(java.lang.Object obj)
java.lang.String
getCompilerSourceLevelDefault()
Returns a reasonable compiler source level default for this execution environment.java.lang.String
getCompilerTargetLevelDefault()
Returns a reasonable compiler target level default for this execution environment.java.lang.String
getProfileName()
java.util.Properties
getProfileProperties()
java.util.Set<java.lang.String>
getSystemPackages()
Returns the list of packages (without versions) provided by the execution environment.int
hashCode()
boolean
isCompatibleCompilerTargetLevel(java.lang.String target)
Returnsfalse
if classes compiled with the given compiler target level can certainly not be executed on this execution environment.private EEVersion
parseEEVersion(java.lang.String systemCaps)
java.lang.String
toString()
private static org.osgi.framework.Version
toTargetVersion(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:
getProfileName
in interfaceExecutionEnvironment
-
getCompilerSourceLevelDefault
public java.lang.String getCompilerSourceLevelDefault()
Description copied from interface:ExecutionEnvironment
Returns a reasonable compiler source level default for this execution environment.- Specified by:
getCompilerSourceLevelDefault
in interfaceExecutionEnvironment
- Returns:
- a compiler source level matching the execution environment, or
null
if unknown.
-
getCompilerTargetLevelDefault
public java.lang.String getCompilerTargetLevelDefault()
Description copied from interface:ExecutionEnvironment
Returns a reasonable compiler target level default for this execution environment.- Specified by:
getCompilerTargetLevelDefault
in interfaceExecutionEnvironment
- Returns:
- a compiler target level matching the execution environment, or
null
if unknown.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSystemPackages
public java.util.Set<java.lang.String> getSystemPackages()
Description copied from interface:ExecutionEnvironment
Returns the list of packages (without versions) provided by the execution environment.- Specified by:
getSystemPackages
in interfaceExecutionEnvironment
-
compareTo
public int compareTo(StandardExecutionEnvironment otherEnv)
- Specified by:
compareTo
in interfacejava.lang.Comparable<StandardExecutionEnvironment>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getProfileProperties
public java.util.Properties getProfileProperties()
- Specified by:
getProfileProperties
in interfaceExecutionEnvironment
-
isCompatibleCompilerTargetLevel
public boolean isCompatibleCompilerTargetLevel(java.lang.String target)
Description copied from interface:ExecutionEnvironment
Returnsfalse
if classes compiled with the given compiler target level can certainly not be executed on this execution environment. Used to detect inconsistent configuration.- Specified by:
isCompatibleCompilerTargetLevel
in interfaceExecutionEnvironment
-
toTargetVersion
private static org.osgi.framework.Version toTargetVersion(java.lang.String target)
-
-