@Test public void testGetCompileFlags() { final ExtractText processor = new ExtractText(); TestRunner testRunner; int flags; testRunner = TestRunners.newTestRunner(processor); flags = processor.getCompileFlags(testRunner.getProcessContext()); assertEquals(0, flags); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.UNIX_LINES, "true"); assertEquals(Pattern.UNIX_LINES, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.CASE_INSENSITIVE, "true"); assertEquals(Pattern.CASE_INSENSITIVE, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.COMMENTS, "true"); assertEquals(Pattern.COMMENTS, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.MULTILINE, "true"); assertEquals(Pattern.MULTILINE, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.LITERAL, "true"); assertEquals(Pattern.LITERAL, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.DOTALL, "true"); assertEquals(Pattern.DOTALL, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.UNICODE_CASE, "true"); assertEquals(Pattern.UNICODE_CASE, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.CANON_EQ, "true"); assertEquals(Pattern.CANON_EQ, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.UNICODE_CHARACTER_CLASS, "true"); assertEquals(Pattern.UNICODE_CHARACTER_CLASS, processor.getCompileFlags(testRunner.getProcessContext())); testRunner = TestRunners.newTestRunner(processor); testRunner.setProperty(ExtractText.DOTALL, "true"); testRunner.setProperty(ExtractText.MULTILINE, "true"); assertEquals(Pattern.DOTALL | Pattern.MULTILINE, processor.getCompileFlags(testRunner.getProcessContext())); }
int getCompileFlags(ProcessContext context) { int flags = (context.getProperty(UNIX_LINES).asBoolean() ? Pattern.UNIX_LINES : 0) | (context.getProperty(CASE_INSENSITIVE).asBoolean() ? Pattern.CASE_INSENSITIVE : 0) | (context.getProperty(COMMENTS).asBoolean() ? Pattern.COMMENTS : 0) | (context.getProperty(MULTILINE).asBoolean() ? Pattern.MULTILINE : 0) | (context.getProperty(LITERAL).asBoolean() ? Pattern.LITERAL : 0) | (context.getProperty(DOTALL).asBoolean() ? Pattern.DOTALL : 0) | (context.getProperty(UNICODE_CASE).asBoolean() ? Pattern.UNICODE_CASE : 0) | (context.getProperty(CANON_EQ).asBoolean() ? Pattern.CANON_EQ : 0) | (context.getProperty(UNICODE_CHARACTER_CLASS).asBoolean() ? Pattern.UNICODE_CHARACTER_CLASS : 0); return flags; }
ExtractText extends AbstractProcessor { int getCompileFlags(ProcessContext context) { int flags = (context.getProperty(UNIX_LINES).asBoolean() ? Pattern.UNIX_LINES : 0) | (context.getProperty(CASE_INSENSITIVE).asBoolean() ? Pattern.CASE_INSENSITIVE : 0) | (context.getProperty(COMMENTS).asBoolean() ? Pattern.COMMENTS : 0) | (context.getProperty(MULTILINE).asBoolean() ? Pattern.MULTILINE : 0) | (context.getProperty(LITERAL).asBoolean() ? Pattern.LITERAL : 0) | (context.getProperty(DOTALL).asBoolean() ? Pattern.DOTALL : 0) | (context.getProperty(UNICODE_CASE).asBoolean() ? Pattern.UNICODE_CASE : 0) | (context.getProperty(CANON_EQ).asBoolean() ? Pattern.CANON_EQ : 0) | (context.getProperty(UNICODE_CHARACTER_CLASS).asBoolean() ? Pattern.UNICODE_CHARACTER_CLASS : 0); return flags; } }
ExtractText extends AbstractProcessor { int getCompileFlags(ProcessContext context) { int flags = (context.getProperty(UNIX_LINES).asBoolean() ? Pattern.UNIX_LINES : 0) | (context.getProperty(CASE_INSENSITIVE).asBoolean() ? Pattern.CASE_INSENSITIVE : 0) | (context.getProperty(COMMENTS).asBoolean() ? Pattern.COMMENTS : 0) | (context.getProperty(MULTILINE).asBoolean() ? Pattern.MULTILINE : 0) | (context.getProperty(LITERAL).asBoolean() ? Pattern.LITERAL : 0) | (context.getProperty(DOTALL).asBoolean() ? Pattern.DOTALL : 0) | (context.getProperty(UNICODE_CASE).asBoolean() ? Pattern.UNICODE_CASE : 0) | (context.getProperty(CANON_EQ).asBoolean() ? Pattern.CANON_EQ : 0) | (context.getProperty(UNICODE_CHARACTER_CLASS).asBoolean() ? Pattern.UNICODE_CHARACTER_CLASS : 0); return flags; }  }
ExtractText extends AbstractProcessor { int getCompileFlags(ProcessContext context) { int flags = (context.getProperty(UNIX_LINES).asBoolean() ? Pattern.UNIX_LINES : 0) | (context.getProperty(CASE_INSENSITIVE).asBoolean() ? Pattern.CASE_INSENSITIVE : 0) | (context.getProperty(COMMENTS).asBoolean() ? Pattern.COMMENTS : 0) | (context.getProperty(MULTILINE).asBoolean() ? Pattern.MULTILINE : 0) | (context.getProperty(LITERAL).asBoolean() ? Pattern.LITERAL : 0) | (context.getProperty(DOTALL).asBoolean() ? Pattern.DOTALL : 0) | (context.getProperty(UNICODE_CASE).asBoolean() ? Pattern.UNICODE_CASE : 0) | (context.getProperty(CANON_EQ).asBoolean() ? Pattern.CANON_EQ : 0) | (context.getProperty(UNICODE_CHARACTER_CLASS).asBoolean() ? Pattern.UNICODE_CHARACTER_CLASS : 0); return flags; }  @Override Set<Relationship> getRelationships(); @OnScheduled final void onScheduled(final ProcessContext context); @OnStopped void onStopped(); @Override void onTrigger(final ProcessContext context, final ProcessSession session); }
ExtractText extends AbstractProcessor { int getCompileFlags(ProcessContext context) { int flags = (context.getProperty(UNIX_LINES).asBoolean() ? Pattern.UNIX_LINES : 0) | (context.getProperty(CASE_INSENSITIVE).asBoolean() ? Pattern.CASE_INSENSITIVE : 0) | (context.getProperty(COMMENTS).asBoolean() ? Pattern.COMMENTS : 0) | (context.getProperty(MULTILINE).asBoolean() ? Pattern.MULTILINE : 0) | (context.getProperty(LITERAL).asBoolean() ? Pattern.LITERAL : 0) | (context.getProperty(DOTALL).asBoolean() ? Pattern.DOTALL : 0) | (context.getProperty(UNICODE_CASE).asBoolean() ? Pattern.UNICODE_CASE : 0) | (context.getProperty(CANON_EQ).asBoolean() ? Pattern.CANON_EQ : 0) | (context.getProperty(UNICODE_CHARACTER_CLASS).asBoolean() ? Pattern.UNICODE_CHARACTER_CLASS : 0); return flags; }  @Override Set<Relationship> getRelationships(); @OnScheduled final void onScheduled(final ProcessContext context); @OnStopped void onStopped(); @Override void onTrigger(final ProcessContext context, final ProcessSession session); static final PropertyDescriptor CHARACTER_SET; static final PropertyDescriptor MAX_BUFFER_SIZE; static final PropertyDescriptor MAX_CAPTURE_GROUP_LENGTH; static final PropertyDescriptor CANON_EQ; static final PropertyDescriptor CASE_INSENSITIVE; static final PropertyDescriptor COMMENTS; static final PropertyDescriptor DOTALL; static final PropertyDescriptor LITERAL; static final PropertyDescriptor MULTILINE; static final PropertyDescriptor UNICODE_CASE; static final PropertyDescriptor UNICODE_CHARACTER_CLASS; static final PropertyDescriptor UNIX_LINES; static final PropertyDescriptor INCLUDE_CAPTURE_GROUP_ZERO; static final PropertyDescriptor ENABLE_REPEATING_CAPTURE_GROUP; static final Relationship REL_MATCH; static final Relationship REL_NO_MATCH; }