ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package org.jbpm.pvm.internal.wire.binding;
 
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
 
/** parses a descriptor for creating a {@link Class}.
 * 
 * See schema docs for more details.
 *
 * @author Tom Baeyens
 * @author Guillaume Porcher (documentation)
 */
public class ClassBinding extends WireDescriptorBinding {
 
  public ClassBinding() {
    super("class");
  }
 
  public Object parse(Element element, Parse parse, Parser parser) {
    ClassDescriptor classDescriptor = null;
    String className = XmlUtil.attribute(element, "class-name");
    if (className!=null) {
      classDescriptor = new ClassDescriptor();
      classDescriptor.setClassName(className);
    } else {
      parse.addProblem("class must have classname attribute: "+XmlUtil.toString(element), element);
    }
    return classDescriptor;
  }
 
}