public static String fix(final String raw) { if ( raw == null || "".equals( raw.trim() )) { return raw; } MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( raw ); } }
public static String processMacros(String consequence) { MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( delimitExpressions( consequence ) ); }
public static String processMacros(String consequence) { MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( delimitExpressions( consequence ) ); }
public String parse(String input) { return new String(parse(input.toCharArray())); }
public String parse(String input) { return new String(parse(input.toCharArray())); }
public String parse(String input) { return new String(parse(input.toCharArray())); }
public static String parseMacros(String input, Map<String, Macro> macros) { return new MacroProcessor(macros).parse(input); }
public static String parseMacros(String input, Map<String, Macro> macros) { return new MacroProcessor(macros).parse(input); }
public static String parseMacros(String input, Map<String, Macro> macros) { return new MacroProcessor(macros).parse(input); }
public static String fix(final String raw) { if ( raw == null || "".equals( raw.trim() )) { return raw; } MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( raw ); } }
public static String fix(final String raw) { if ( raw == null || "".equals( raw.trim() )) { return raw; } MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( raw ); } }
public static String processMacros(String consequence) { MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( delimitExpressions( consequence ) ); }
public static String processMacros(String consequence) { MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( delimitExpressions( consequence ) ); }
public static String processMacros(String consequence) { MacroProcessor macroProcessor = new MacroProcessor(); macroProcessor.setMacros( macros ); return macroProcessor.parse( delimitExpressions( consequence ) ); }
public void testParseConsequenceWithComments() { String raw = " // str is null, we are just testing we don't get a null pointer \n " + " list.add( p );"; try { String result = macroProcessor.parse(raw); assertEquals(raw, result); } catch (Exception ex) { ex.printStackTrace(); fail("there shouldn't be any exception: " + ex.getMessage()); } }
public void testParseStringUnmatchedChars() { String raw = "result.add( \"\\\"\\\' there are } [ unmatched characters in this string (\" );"; try { String result = macroProcessor.parse(raw); assertEquals(raw, result); } catch (Exception ex) { ex.printStackTrace(); fail("there shouldn't be any exception: " + ex.getMessage()); } }
public void testParseString() { String raw = " l.add( \"rule 2 executed \" + str);"; try { String result = macroProcessor.parse(raw); assertEquals(raw, result); } catch (Exception ex) { ex.printStackTrace(); fail("there shouldn't be any exception: " + ex.getMessage()); } }
public void testCommentParsingWithMacro() { String raw = "/** This is a block comment **/ insert /** This is a second \n\nblock comment insert **/"; String expected = "/** This is a block comment **/ drools.insert /** This is a second \n\nblock comment insert **/"; try { String result = macroProcessor.parse(raw); assertEquals(expected, result); } catch (Exception ex) { ex.printStackTrace(); fail("there shouldn't be any exception: " + ex.getMessage()); } } }
String result = macroProcessor.parse(raw); assertEquals(expected, result);
String mvelCode = macroProcessor.parse(consequence.toString());