@Override public EE convert(String input) throws IllegalArgumentException { if (input == null) return null; return EE.parse(input); }
@Override public String convert(EE input) throws IllegalArgumentException { return input != null ? input.getEEName() : null; }
public static EE parse(String str) { for (EE ee : values()) { if (ee.eeName.equals(str)) return ee; } return null; }
private EnumSet<EE> getCompatibleSet() { if (compatibleSet != null) { return compatibleSet; } EnumSet<EE> set = EnumSet.noneOf(getDeclaringClass()); if (compatible != null) { for (EE ee : compatible) { set.add(ee); set.addAll(ee.getCompatibleSet()); } } return compatibleSet = set; }
public void addExecutionEnvironment(EE ee) throws Exception { CapReqBuilder builder = new CapReqBuilder(resource, ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE); builder.addAttribute(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, ee.getCapabilityName()); builder.addAttribute(ExecutionEnvironmentNamespace.CAPABILITY_VERSION_ATTRIBUTE, ee.getCapabilityVersion()); addCapability(builder); // Compatibility with old version... builder = new CapReqBuilder(resource, ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE); builder.addAttribute(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, ee.getEEName()); addCapability(builder); }
/** * @return An array of EEs that this EE implicitly offers, through backwards * compatibility. */ public EE[] getCompatible() { EnumSet<EE> set = getCompatibleSet(); return set.toArray(new EE[0]); }
public void addEE(EE ee) throws Exception { addExportPackages(ee.getPackages()); EE[] compatibles = ee.getCompatible(); addExecutionEnvironment(ee); for (EE compatible : compatibles) { addExecutionEnvironment(compatible); } }
/** * Return the list of packages * * @throws IOException */ public Parameters getPackages() throws IOException { if (packages == null) { try (InputStream stream = EE.class.getResourceAsStream(name() + ".properties")) { if (stream == null) return new Parameters(); UTF8Properties props = new UTF8Properties(); props.load(stream); String exports = props.getProperty("org.osgi.framework.system.packages"); packages = new Parameters(exports); } } return packages; } }
private EnumSet<EE> getCompatibleSet() { if (compatibleSet != null) { return compatibleSet; } EnumSet<EE> set = EnumSet.noneOf(getDeclaringClass()); if (compatible != null) { for (EE ee : compatible) { set.add(ee); set.addAll(ee.getCompatibleSet()); } } return compatibleSet = set; }
public void addExecutionEnvironment(EE ee) throws Exception { CapReqBuilder builder = new CapReqBuilder(resource, ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE); builder.addAttribute(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, ee.getCapabilityName()); builder.addAttribute(ExecutionEnvironmentNamespace.CAPABILITY_VERSION_ATTRIBUTE, ee.getCapabilityVersion()); addCapability(builder); // Compatibility with old version... builder = new CapReqBuilder(resource, ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE); builder.addAttribute(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, ee.getEEName()); addCapability(builder); }
/** * @return An array of EEs that this EE implicitly offers, through backwards compatibility. */ public EE[] getCompatible() { EnumSet<EE> set = getCompatibleSet(); return set.toArray(new EE[set.size()]); }
public void addAllExecutionEnvironments(EE ee) throws Exception { addExportPackages(ee.getPackages()); addExecutionEnvironment(ee); for (EE compatibleEE : ee.getCompatible()) { addExecutionEnvironment(compatibleEE); } }
/** * Return the list of packages * * @throws IOException */ public Parameters getPackages() throws IOException { if (packages == null) { try (InputStream stream = EE.class.getResourceAsStream(name() + ".properties")) { if (stream == null) return new Parameters(); UTF8Properties props = new UTF8Properties(); props.load(stream); String exports = props.getProperty("org.osgi.framework.system.packages"); packages = new Parameters(exports); } } return packages; } }
private EnumSet<EE> getCompatibleSet() { if (compatibleSet != null) { return compatibleSet; } EnumSet<EE> set = EnumSet.noneOf(getDeclaringClass()); if (compatible != null) { for (EE ee : compatible) { set.add(ee); set.addAll(ee.getCompatibleSet()); } } return compatibleSet = set; }
public EE convert(String input) throws IllegalArgumentException { if (input == null) return null; return EE.parse(input); }
public static EE parse(String str) { for (EE ee : values()) { if (ee.eeName.equals(str)) return ee; } return null; }
@Override public String convert(EE input) throws IllegalArgumentException { return input != null ? input.getEEName() : null; }
/** * @return An array of EEs that this EE implicitly offers, through backwards * compatibility. */ public EE[] getCompatible() { EnumSet<EE> set = getCompatibleSet(); return set.toArray(new EE[0]); }
public void addEE(EE ee) throws Exception { addExportPackages(ee.getPackages()); EE[] compatibles = ee.getCompatible(); addExecutionEnvironment(ee); for (EE compatible : compatibles) { addExecutionEnvironment(compatible); } }