/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context .getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
public void start() { if(pattern == null || pattern.length() == 0) { addError("Empty or null pattern."); return; } try { Parser<E> p = new Parser<E>(pattern); if (getContext() != null) { p.setContext(getContext()); } Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); if (postCompileProcessor != null) { postCompileProcessor.process(head); } ConverterUtil.setContextForConverters(getContext(), head); ConverterUtil.startConverters(this.head); super.start(); } catch (ScanException sce) { StatusManager sm = getContext().getStatusManager(); sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern() + "\".", this, sce)); } }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head the head node of the converter chain * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * * @param head * @deprecated Use {@link ConverterUtil#setContextForConverters} instead. This method will * be removed in future releases. */ protected void setContextForConverters(Converter<E> head) { ConverterUtil.setContextForConverters(getContext(), head); }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context .getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
protected void setContextForConverters(Converter<E> head) { Context context = getContext(); Converter c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context .getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } // set the most specific map last effectiveMap.putAll(instanceConverterMap); return effectiveMap; }
public void start() { if (pattern == null || pattern.length() == 0) { addError("Empty or null pattern."); return; } try { Parser<E> p = new Parser<E>(pattern); if (getContext() != null) { p.setContext(getContext()); } Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); if (postCompileProcessor != null) { postCompileProcessor.process(context, head); } ConverterUtil.setContextForConverters(getContext(), head); ConverterUtil.startConverters(this.head); super.start(); } catch (ScanException sce) { StatusManager sm = getContext().getStatusManager(); sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern() + "\".", this, sce)); } }
public void start() { if(pattern == null || pattern.length() == 0) { addError("Empty or null pattern."); return; } try { Parser<E> p = new Parser<E>(pattern); if (getContext() != null) { p.setContext(getContext()); } Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); if (postCompileProcessor != null) { postCompileProcessor.process(context, head); } ConverterUtil.setContextForConverters(getContext(), head); ConverterUtil.startConverters(this.head); super.start(); } catch (ScanException sce) { StatusManager sm = getContext().getStatusManager(); sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern() + "\".", this, sce)); } }
public void start() { if (pattern == null || pattern.length() == 0) { addError("Empty or null pattern."); return; } try { Parser<E> p = new Parser<E>(pattern); if (getContext() != null) { p.setContext(getContext()); } Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); if (postCompileProcessor != null) { postCompileProcessor.process(context, head); } ConverterUtil.setContextForConverters(getContext(), head); ConverterUtil.startConverters(this.head); super.start(); } catch (ScanException sce) { StatusManager sm = getContext().getStatusManager(); sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern() + "\".", this, sce)); } }
public void start() { try { Parser<E> p = new Parser<E>(pattern); if (getContext() != null) { p.setContext(getContext()); } Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); if (postCompileProcessor != null) { postCompileProcessor.process(head); } setContextForConverters(head); ConverterUtil.startConverters(this.head); super.start(); } catch (ScanException sce) { StatusManager sm = getContext().getStatusManager(); sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern() + "\".", this, sce)); } }