use of org.xwiki.filter.instance.output.OutputInstanceFilterStreamFactory in project xwiki-platform by xwiki.
the class InstanceOutputFilterStream method setProperties.
@Override
public void setProperties(InstanceOutputProperties properties) throws FilterException {
super.setProperties(properties);
List<OutputInstanceFilterStreamFactory> factories;
try {
factories = this.componentManager.get().getInstanceList(OutputInstanceFilterStreamFactory.class);
} catch (ComponentLookupException e) {
throw new FilterException("Failed to get regsitered instance of OutputInstanceFilterStreamFactory components", e);
}
Object[] filters = new Object[factories.size()];
int i = 0;
for (OutputInstanceFilterStreamFactory factory : factories) {
filters[i++] = factory.createOutputFilterStream(properties).getFilter();
}
this.filter = this.filterManager.createCompositeFilter(filters);
}
use of org.xwiki.filter.instance.output.OutputInstanceFilterStreamFactory in project xwiki-platform by xwiki.
the class InstanceOutputFilterStreamFactory method initialize.
@Override
public void initialize() throws InitializationException {
super.initialize();
List<OutputInstanceFilterStreamFactory> factories;
try {
factories = this.componentManagerProvider.get().getInstanceList(OutputInstanceFilterStreamFactory.class);
} catch (ComponentLookupException e) {
throw new InitializationException("Failed to get registered instance of OutputInstanceFilterStreamFactory components", e);
}
FilterStreamDescriptor[] descriptors = new FilterStreamDescriptor[factories.size() + 1];
descriptors[0] = this.descriptor;
for (int i = 0; i < factories.size(); ++i) {
descriptors[i + 1] = factories.get(i).getDescriptor();
}
setDescriptor(new CompositeFilterStreamDescriptor(this.descriptor.getName(), this.descriptor.getDescription(), descriptors));
}
use of org.xwiki.filter.instance.output.OutputInstanceFilterStreamFactory in project xwiki-platform by xwiki.
the class InstanceOutputFilterStreamFactory method getFilterInterfaces.
@Override
public Collection<Class<?>> getFilterInterfaces() throws FilterException {
List<OutputInstanceFilterStreamFactory> factories;
try {
factories = this.componentManagerProvider.get().getInstanceList(OutputInstanceFilterStreamFactory.class);
} catch (ComponentLookupException e) {
throw new FilterException("Failed to get regsitered instance of OutputInstanceFilterStreamFactory components", e);
}
Set<Class<?>> filters = new HashSet<Class<?>>();
filters.addAll(super.getFilterInterfaces());
for (OutputInstanceFilterStreamFactory factory : factories) {
filters.addAll(factory.getFilterInterfaces());
}
return filters;
}
Aggregations