org.ow2.easywsdl.extensions.multiple.MultipleExtFactoryImpl Maven / Gradle / Ivy
/**
* Copyright (c) 2008-2012 EBM WebSourcing, 2012-2016 Linagora
*
* This program/library is free software: you can redistribute it and/or modify
* it under the terms of the New BSD License (3-clause license).
*
* This program/library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the New BSD License (3-clause license)
* for more details.
*
* You should have received a copy of the New BSD License (3-clause license)
* along with this program/library; If not, see http://directory.fsf.org/wiki/License:BSD_3Clause/
* for the New BSD License (3-clause license).
*/
package org.ow2.easywsdl.extensions.multiple;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.ow2.easywsdl.extensions.multiple.api.Description;
import org.ow2.easywsdl.extensions.multiple.api.MultipleExtException;
import org.ow2.easywsdl.extensions.multiple.api.MultipleExtReader;
import org.ow2.easywsdl.extensions.multiple.api.MultipleExtWriter;
import org.ow2.easywsdl.extensions.multiple.impl.DescriptionImpl;
import org.ow2.easywsdl.extensions.multiple.impl.MultipleExtReaderImpl;
import org.ow2.easywsdl.extensions.multiple.impl.MultipleExtWriterImpl;
import org.ow2.easywsdl.wsdl.ExtensionFactory;
import org.ow2.easywsdl.wsdl.api.WSDLReader.FeatureConstants;
import org.ow2.easywsdl.wsdl.api.abstractItf.AbsItfDescription;
/**
* This class is a concrete implementation of the abstract class WSDLFactory.
*
* Some ideas used here have been shamelessly copied from the wonderful JAXP and
* Xerces work.
*
*
* @author Nicolas Boissel-Dallier - EBM WebSourcing
*/
public class MultipleExtFactoryImpl extends MultipleExtFactory {
@SuppressWarnings("unchecked")
public Description addMultipleExtElmt2Description(final List extFactories, final AbsItfDescription desc) throws MultipleExtException {
Description res = null;
AbsItfDescription newDesc = desc;
try {
Iterator i = extFactories.iterator();
while(i.hasNext()){
newDesc = ((ExtensionFactory)i.next()).addExtElmt2Description(newDesc);
}
res = new DescriptionImpl(newDesc);
} catch (final Exception e) {
throw new MultipleExtException(e);
}
return res;
}
@Override
public MultipleExtReader newMultipleExtReader() throws MultipleExtException {
return new MultipleExtReaderImpl();
}
@Override
public MultipleExtReader newMultipleExtReader(final Map features)
throws MultipleExtException {
final MultipleExtReader reader = new MultipleExtReaderImpl();
((MultipleExtReaderImpl) reader).setFeatures(features);
return reader;
}
@Override
public MultipleExtWriter newMultipleExtWriter() throws MultipleExtException {
return new MultipleExtWriterImpl();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy