@Test public void strip_criteria_if_present() { EntityDAOLocator locator = newMock(EntityDAOLocator.class); InjectEntitySelectSupportWorker worker = new InjectEntitySelectSupportWorker(locator); assertEquals(worker.stripCriteriaIfPresent("something"), "something"); assertEquals(worker.stripCriteriaIfPresent("myCriteria"), "my"); assertEquals(worker.stripCriteriaIfPresent("criteria"), "criteria"); assertEquals(worker.stripCriteriaIfPresent("Criteria"), "Criteria"); }
String stripCriteriaIfPresent(String name) { if(name.endsWith("Criteria") && !name.startsWith("Criteria")) { name = name.replaceAll("Criteria$", ""); } return name; }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { String stripCriteriaIfPresent(String name) { if(name.endsWith("Criteria") && !name.startsWith("Criteria")) { name = name.replaceAll("Criteria$", ""); } return name; } }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { String stripCriteriaIfPresent(String name) { if(name.endsWith("Criteria") && !name.startsWith("Criteria")) { name = name.replaceAll("Criteria$", ""); } return name; } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { String stripCriteriaIfPresent(String name) { if(name.endsWith("Criteria") && !name.startsWith("Criteria")) { name = name.replaceAll("Criteria$", ""); } return name; } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model); }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { String stripCriteriaIfPresent(String name) { if(name.endsWith("Criteria") && !name.startsWith("Criteria")) { name = name.replaceAll("Criteria$", ""); } return name; } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model);  }