
org.ow2.bonita.env.binding.QuerierDbSessionBinding Maven / Gradle / Ivy
package org.ow2.bonita.env.binding;
import org.ow2.bonita.env.EnvConstants;
import org.ow2.bonita.env.descriptor.QuerierDbSessionDescriptor;
import org.ow2.bonita.pvm.internal.wire.xml.WireParser;
import org.ow2.bonita.util.ExceptionManager;
import org.ow2.bonita.util.xml.Parse;
import org.ow2.bonita.util.xml.Parser;
import org.ow2.bonita.util.xml.TagBinding;
import org.w3c.dom.Element;
/**
*
* @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
*/
public class QuerierDbSessionBinding extends TagBinding {
public QuerierDbSessionBinding() {
super(EnvConstants.QUERIER_DB_SESSION_TAG, null, WireParser.CATEGORY_DESCRIPTOR);
}
public Object parse(Element element, Parse parse, Parser parser) {
QuerierDbSessionDescriptor descriptor = new QuerierDbSessionDescriptor();
if (element.hasAttribute("session")) {
descriptor.setSessionName(element.getAttribute("session"));
} else {
String message = ExceptionManager.getInstance().getFullMessage(
"bse_QDSB_1", EnvConstants.QUERIER_DB_SESSION_TAG);
throw new RuntimeException(message);
}
if (element.hasAttribute("name")) {
descriptor.setName(element.getAttribute("name"));
} else {
String message = ExceptionManager.getInstance().getFullMessage(
"bse_QDSB_2", EnvConstants.QUERIER_DB_SESSION_TAG);
throw new RuntimeException(message);
}
return descriptor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy