public static void setSystemProperties(CPDConfiguration configuration) { Properties properties = new Properties(); if (configuration.isIgnoreLiterals()) { properties.setProperty(Tokenizer.IGNORE_LITERALS, "true"); } else { properties.remove(Tokenizer.IGNORE_LITERALS); } if (configuration.isIgnoreIdentifiers()) { properties.setProperty(Tokenizer.IGNORE_IDENTIFIERS, "true"); } else { properties.remove(Tokenizer.IGNORE_IDENTIFIERS); } if (configuration.isIgnoreAnnotations()) { properties.setProperty(Tokenizer.IGNORE_ANNOTATIONS, "true"); } else { properties.remove(Tokenizer.IGNORE_ANNOTATIONS); } if (configuration.isIgnoreUsings()) { properties.setProperty(Tokenizer.IGNORE_USINGS, "true"); } else { properties.remove(Tokenizer.IGNORE_USINGS); } properties.setProperty(Tokenizer.OPTION_SKIP_BLOCKS, Boolean.toString(!configuration.isNoSkipBlocks())); properties.setProperty(Tokenizer.OPTION_SKIP_BLOCKS_PATTERN, configuration.getSkipBlocksPattern()); configuration.getLanguage().setProperties(properties); }
public void postContruct() { if (getLanguage() == null) { setLanguage(CPDConfiguration.getLanguageFromString(DEFAULT_LANGUAGE)); } if (getRendererName() == null) { setRendererName(DEFAULT_RENDERER); } if (getRenderer() == null && getCPDRenderer() == null) { try { setCPDRenderer(getCPDRendererFromString(getRendererName(), getEncoding())); } catch (ClassCastException e) { // The renderer class configured is not using the new CPDRenderer interface... setRenderer(getRendererFromString(getRendererName(), getEncoding())); } } }
public void postContruct() { if (getLanguage() == null) { setLanguage(CPDConfiguration.getLanguageFromString(DEFAULT_LANGUAGE)); } if (getRendererName() == null) { setRendererName(DEFAULT_RENDERER); } if (getRenderer() == null && getCPDRenderer() == null) { try { setCPDRenderer(getCPDRendererFromString(getRendererName(), getEncoding())); } catch (ClassCastException e) { // The renderer class configured is not using the new CPDRenderer interface... setRenderer(getRendererFromString(getRendererName(), getEncoding())); } } }
public static void setSystemProperties(CPDConfiguration configuration) { Properties properties = new Properties(); if (configuration.isIgnoreLiterals()) { properties.setProperty(Tokenizer.IGNORE_LITERALS, "true"); } else { properties.remove(Tokenizer.IGNORE_LITERALS); } if (configuration.isIgnoreIdentifiers()) { properties.setProperty(Tokenizer.IGNORE_IDENTIFIERS, "true"); } else { properties.remove(Tokenizer.IGNORE_IDENTIFIERS); } if (configuration.isIgnoreAnnotations()) { properties.setProperty(Tokenizer.IGNORE_ANNOTATIONS, "true"); } else { properties.remove(Tokenizer.IGNORE_ANNOTATIONS); } if (configuration.isIgnoreUsings()) { properties.setProperty(Tokenizer.IGNORE_USINGS, "true"); } else { properties.remove(Tokenizer.IGNORE_USINGS); } properties.setProperty(Tokenizer.OPTION_SKIP_BLOCKS, Boolean.toString(!configuration.isNoSkipBlocks())); properties.setProperty(Tokenizer.OPTION_SKIP_BLOCKS_PATTERN, configuration.getSkipBlocksPattern()); configuration.getLanguage().setProperties(properties); }