public RequiredCapability(String namespace, String name, VersionRange range, String filter, boolean optional, boolean multiple, boolean greedy) { this(namespace, name, range, filter == null ? (IMatchExpression<IInstallableUnit>) null : InstallableUnit.parseFilter(filter), optional ? 0 : 1, multiple ? Integer.MAX_VALUE : 1, greedy, null); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
public void setFilter(String filter) { setFilter(parseFilter(filter)); }
protected void addRequiredCapability(Set<IRequirement> required, String id, Version version, String filter, boolean optional) { VersionRange range = getVersionRange(version); required.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, id, range, InstallableUnit.parseFilter(filter), optional, false)); }
private IMatchExpression<IInstallableUnit> getFilter(FeatureEntry entry) { StringBuffer result = new StringBuffer(); result.append("(&"); //$NON-NLS-1$ if (entry.getFilter() != null) result.append(entry.getFilter()); expandFilter(entry.getOS(), "osgi.os", result); //$NON-NLS-1$ expandFilter(entry.getWS(), "osgi.ws", result); //$NON-NLS-1$ expandFilter(entry.getArch(), "osgi.arch", result);//$NON-NLS-1$ expandFilter(entry.getNL(), "osgi.nl", result); //$NON-NLS-1$ if (result.length() == 2) return null; result.append(')'); return InstallableUnit.parseFilter(result.toString()); }
private IMatchExpression<IInstallableUnit> getFilter(FeatureEntry entry) { StringBuffer result = new StringBuffer(); result.append("(&"); //$NON-NLS-1$ if (entry.getFilter() != null) result.append(entry.getFilter()); expandFilter(entry.getOS(), "osgi.os", result); //$NON-NLS-1$ expandFilter(entry.getWS(), "osgi.ws", result); //$NON-NLS-1$ expandFilter(entry.getArch(), "osgi.arch", result);//$NON-NLS-1$ expandFilter(entry.getNL(), "osgi.nl", result); //$NON-NLS-1$ if (result.length() == 2) return null; result.append(')'); return InstallableUnit.parseFilter(result.toString()); }
private IMatchExpression<IInstallableUnit> getFilter(FeatureEntry entry) { StringBuffer result = new StringBuffer(); result.append("(&"); //$NON-NLS-1$ if (entry.getFilter() != null) result.append(entry.getFilter()); expandFilter(entry.getOS(), "osgi.os", result); //$NON-NLS-1$ expandFilter(entry.getWS(), "osgi.ws", result); //$NON-NLS-1$ expandFilter(entry.getArch(), "osgi.arch", result);//$NON-NLS-1$ expandFilter(entry.getNL(), "osgi.nl", result); //$NON-NLS-1$ if (result.length() == 2) return null; result.append(')'); return InstallableUnit.parseFilter(result.toString()); }
private IMatchExpression<IInstallableUnit> createFilter(FeatureEntry entry) { final StringBuilder result = new StringBuilder(); if (entry.getFilter() != null) { result.append(entry.getFilter()); } expandFilter(entry.getOS(), "osgi.os", result); //$NON-NLS-1$ expandFilter(entry.getWS(), "osgi.ws", result); //$NON-NLS-1$ expandFilter(entry.getArch(), "osgi.arch", result);//$NON-NLS-1$ expandFilter(entry.getNL(), "osgi.nl", result); //$NON-NLS-1$ if (result.length() != 0) { if (getFilterCount(entry) > 1) { result.insert(0, "(&").append(')'); //$NON-NLS-1$ } return InstallableUnit.parseFilter(result.toString()); } return null; }
protected IRequirement createRequirement(String requirement, String filter, int min, int max, boolean greedy, String description) { IExpression expr = ExpressionUtil.parse(substituteVersionAndQualifier(requirement)); IMatchExpression<IInstallableUnit> requirementExp = ExpressionUtil.getFactory().matchExpression(expr); IMatchExpression<IInstallableUnit> filterExp = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(requirementExp, filterExp, min, max, greedy, description); }
protected IRequirement createRequirement(String requirement, String filter, int min, int max, boolean greedy, String description) { IExpression expr = ExpressionUtil.parse(substituteVersionAndQualifier(requirement)); IMatchExpression<IInstallableUnit> requirementExp = ExpressionUtil.getFactory().matchExpression(expr); IMatchExpression<IInstallableUnit> filterExp = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(requirementExp, filterExp, min, max, greedy, description); }
protected IRequirement createRequirement(String requirement, String filter, int min, int max, boolean greedy, String description) { IExpression expr = ExpressionUtil.parse(substituteVersionAndQualifier(requirement)); IMatchExpression<IInstallableUnit> requirementExp = ExpressionUtil.getFactory().matchExpression(expr); IMatchExpression<IInstallableUnit> filterExp = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(requirementExp, filterExp, min, max, greedy, description); }
protected IRequirement createRequirement(String requirement, String filter, int min, int max, boolean greedy, String description) { IExpression expr = ExpressionUtil.parse(substituteVersionAndQualifier(requirement)); IMatchExpression<IInstallableUnit> requirementExp = ExpressionUtil.getFactory().matchExpression(expr); IMatchExpression<IInstallableUnit> filterExp = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(requirementExp, filterExp, min, max, greedy, description); }
protected void finished() { if (!isValidXML()) return; IMatchExpression<IInstallableUnit> filter = null; if (filterHandler != null) { try { filter = InstallableUnit.parseFilter(filterHandler.getText()); } catch (ExpressionParseException e) { if (removeWhiteSpace(filterHandler.getText()).equals("(&(|)(|)(|))")) {//$NON-NLS-1$ // We could log this I guess } else { throw e; } } } String description = descriptionHandler == null ? null : descriptionHandler.getText(); IRequirement requirement; if (match != null) { IMatchExpression<IInstallableUnit> matchExpr = createMatchExpression(match, matchParams); requirement = MetadataFactory.createRequirement(matchExpr, filter, min, max, greedy, description); } else requirement = MetadataFactory.createRequirement(namespace, name, range, filter, min, max, greedy, description); capabilities.add(requirement); }