if(tipo_recuperado == 'enum'){ montaMap() }else if(tipo_recuperado == 'string'){atrbuirvalorstring();}
Preciso customizar esta classe, para poder adicionar outros tipos neste 'if'. A classe é usada dentro do próprio worklfow por outras classes, a classe que eu quero estender em questão é esta:
/* Licensed under the Apache License, Version 2.0 (the "License");
package org.activiti.engine.impl.form;
import java.util.HashMap;
import java.util.Map;
import org.activiti.engine.impl.bpmn.parser.BpmnParse;
import org.activiti.engine.impl.bpmn.parser.BpmnParser;
import org.activiti.engine.impl.util.xml.Element;
/**
* @author Tom Baeyens
*/
public class FormTypes {
protected Map<String, AbstractFormType> formTypes = new HashMap<String, AbstractFormType>();
public void addFormType(AbstractFormType formType) {
formTypes.put(formType.getName(), formType);
}
public AbstractFormType parseFormPropertyType(Element formPropertyElement, BpmnParse bpmnParse) {
AbstractFormType formType = null;
String typeText = formPropertyElement.attribute("type");
String datePatternText = formPropertyElement.attribute("datePattern");
if ("date".equals(typeText) && datePatternText!=null) {
formType = new DateFormType(datePatternText);
} else if ("enum".equals(typeText)) {
Map<String, String> values = new HashMap<String, String>();
for (Element valueElement: formPropertyElement.elementsNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS,"value")) {
String valueId = valueElement.attribute("id");
String valueName = valueElement.attribute("name");
values.put(valueId, valueName);
}
formType = new EnumFormType(values);
} else if (typeText!=null) {
formType = formTypes.get(typeText);
if (formType==null) {
bpmnParse.addError("unknown type '"+typeText+"'", formPropertyElement);
}
}
return formType;
}
}
public class FormTypesImpl extends FormTypes{
@Override
public AbstractFormType parseFormPropertyType(Element formPropertyElement, BpmnParse bpmnParse) {
AbstractFormType formType = null;
}
//bla bla bla bla
}
Alguém tem uma idéia?
A dificuldade desta, se dá ao fato da classe "FormTypes" ser instanciada dentro do próprio framework diretamente.
Pode ser usado algum tipo de injeção de herança no meu web.xml na inicialização?
Obrigado.