public static Features unmarshal(String uri, InputStream stream, boolean validate) { Features features; if (validate) { features = unmarshalValidate(uri, stream); } else { features = unmarshalNoValidate(uri, stream); } features.postUnmarshall(uri); return features; }
public void postUnmarshall(String repositoryUri) { if (feature != null) { for (Feature f : feature) { f.setRepositoryUrl(repositoryUri); f.setNamespace(namespace); f.setResourceRepositories(getResourceRepository()); f.postUnmarshall(); } } trim(repository); trim(resourceRepository); }
/** * Create an instance of {@link Dependency} * * @return the dependency. */ public Dependency createDependency() { return new Dependency(); }
private static Features toFeatures(Collection<Bundle> addedBundles, Collection<Dependency> addedDependencys, ObjectFactory objectFactory) { Features features = objectFactory.createFeaturesRoot(); Feature feature = objectFactory.createFeature(); feature.getBundle().addAll(addedBundles); feature.getFeature().addAll(addedDependencys); features.getFeature().add(feature); return features; }
/** * An extension point to alter {@link Features JAXB model of features} * @param processor */ public void processFeatures(FeaturesProcessor processor) { processor.process(features); if (blacklisted) { // all features of blacklisted repository are blacklisted too for (org.apache.karaf.features.internal.model.Feature feature : features.getFeature()) { feature.setBlacklisted(true); } } }
/** * Read in a Features from the input stream. * * @param uri uri to read * @param validate whether to validate the input. * @return a Features read from the input stream */ public static Features unmarshal(String uri, boolean validate) { return unmarshal(uri, null, validate); }
/** * Create an instance of {@link Features} * * @return the features. */ public Features createFeaturesRoot() { return new Features(); }
@Override public String getName() { return features.getName(); }
/** * Create an instance of {@link Feature} * * @return the feature. */ public Feature createFeature() { return new Feature(); }
/** * Return a string representation of the feature. * * @return the feature string representation. */ public String toString() { return getId(); }
/** * Create an instance of {@link Bundle} * * @return the bundle. */ public Bundle createBundle() { return new Bundle(); }
@Override public boolean include(Features repository) { return !repository.isBlacklisted(); }
@Override public boolean include(Feature feature) { return !feature.isBlacklisted(); }
/** * Create an instance of {@link Config} * * @return the config. */ public Config createConfig() { return new Config(); }
public void setBlacklisted(boolean blacklisted) { this.blacklisted = blacklisted; features.setBlacklisted(blacklisted); }
@Override public String getFilter() { return getValue(); } }
@Override public List<? extends org.apache.karaf.features.ScopeFilter> getExports() { return getExport(); } }
/** * Create an instance of {@link ConfigFile} * * @return the config file. */ public ConfigFile createConfigFile() { return new ConfigFile(); }
@Override public List<? extends org.apache.karaf.features.ScopeFilter> getImports() { return getImport(); }
private static Features toFeatures(Collection<Bundle> addedBundles, Collection<Dependency> addedDependencys, ObjectFactory objectFactory) { Features features = objectFactory.createFeaturesRoot(); Feature feature = objectFactory.createFeature(); feature.getBundle().addAll(addedBundles); feature.getFeature().addAll(addedDependencys); features.getFeature().add(feature); return features; }