Code example for Constructor

Methods: getDeclaringClass, newInstance

0
    Constructor constructor = (Constructor) mappings.get(elementTagName);
    if (constructor==null) {
      throw new JbpmException("no ObjectInfo class specified for element '"+elementTagName+"'");
    } 
    try { 
      objectInfo = (ObjectInfo) constructor.newInstance(new Object[]{element,this});
    } catch (Exception e) {
      throw new JbpmException("couldn't parse '"+elementTagName+"' into a '"+constructor.getDeclaringClass().getName()+"': "+XmlUtil.toString(element), e);
    } 
    return objectInfo;
  } 
 
  public void addNamedObjectInfo(String name, ObjectInfo objectInfo) {
    namedObjectInfos.put(name, objectInfo);
  } 
   
  public void addMapping(String elementName, Class objectInfoClass) {
    if (mappings==getDefaultMappings()) {
      mappings = new HashMap(getDefaultMappings());
    } 
    addMapping(mappings, elementName, objectInfoClass);