Exemplo n.º 1
0
 private String[] getCamelLabels() {
   if (_camelLabels == null) {
     List<String> list = new ArrayList<String>();
     list.add(ComponentLabel.CAMEL.label());
     ContextMapperModel cm_model = getModel();
     if (cm_model != null) {
       BindingModel b_model = cm_model.getBindingModel();
       if (b_model != null) {
         String e_label = EndpointLabel.toLabel(b_model.getType());
         if (e_label != null) {
           list.add(e_label);
         }
       }
     }
     _camelLabels = list.toArray(new String[list.size()]);
   }
   return _camelLabels;
 }
 /**
  * Will create a new ContextMapper based on the specifications of the passed in
  * ContextMapperModel, or if a class it not specified, will apply the rest of the model properties
  * on the default/fallback implementation.
  *
  * @param model contains the config details
  * @return the new ContextMapper instance
  */
 @SuppressWarnings("unchecked")
 public final ContextMapper<D> newContextMapper(ContextMapperModel model) {
   ContextMapper<D> contextMapper = null;
   ContextMapperFactory<D> contextMapperFactory =
       ContextMapperFactory.getContextMapperFactory(getBindingDataClass());
   if (model != null) {
     contextMapper =
         contextMapperFactory.newContextMapper(
             (Class<ContextMapper<D>>) Classes.forName(model.getClazz()));
     contextMapper.setModel(model);
     if (contextMapper instanceof RegexContextMapper) {
       RegexContextMapper<D> regexContextMapper = (RegexContextMapper<D>) contextMapper;
       regexContextMapper.setIncludes(model.getIncludes());
       regexContextMapper.setExcludes(model.getExcludes());
       regexContextMapper.setIncludeNamespaces(model.getIncludeNamespaces());
       regexContextMapper.setExcludeNamespaces(model.getExcludeNamespaces());
     }
   } else {
     contextMapper = contextMapperFactory.newContextMapperDefault();
   }
   return contextMapper;
 }