@Test public void testSplit() { StdJndiLoader loader = new StdJndiLoader(); List<String> result = loader.split("java:comp/env/, \"\","); assertEquals(2, result.size()); assertEquals("java:comp/env/", result.get(0)); assertEquals("", result.get(1)); result = loader.split(" comp/env , , \"_\",x/y/z"); assertEquals(3, result.size()); assertEquals("comp/env", result.get(0)); assertEquals("_", result.get(1)); assertEquals("x/y/z", result.get(2)); result = loader.split(" comp/env , \"\" , \" \""); assertEquals(3, result.size()); assertEquals("comp/env", result.get(0)); assertEquals("", result.get(1)); assertEquals(" ", result.get(2)); }
protected List<String> split(String rootStr) { List<String> cleanRoots = new ArrayList(); if (rootStr != null) { QuotedSpacePreservingTrimmer trimmer = QuotedSpacePreservingTrimmer.instance(); String[] roots = rootStr.split(","); for (int i = 0; i < roots.length; i++) { String s = trimmer.trim(roots[i]); if (s != null) cleanRoots.add(s); } return cleanRoots; } else { return TextUtil.EMPTY_STRING_LIST; } }
StdJndiLoader extends BaseLoader implements LookupLoader, StandardLoader { protected List<String> split(String rootStr) { List<String> cleanRoots = new ArrayList(); if (rootStr != null) { QuotedSpacePreservingTrimmer trimmer = QuotedSpacePreservingTrimmer.instance(); String[] roots = rootStr.split(","); for (int i = 0; i < roots.length; i++) { String s = trimmer.trim(roots[i]); if (s != null) cleanRoots.add(s); } return cleanRoots; } else { return TextUtil.EMPTY_STRING_LIST; } } }
StdJndiLoader extends BaseLoader implements LookupLoader, StandardLoader { protected List<String> split(String rootStr) { List<String> cleanRoots = new ArrayList(); if (rootStr != null) { QuotedSpacePreservingTrimmer trimmer = QuotedSpacePreservingTrimmer.instance(); String[] roots = rootStr.split(","); for (int i = 0; i < roots.length; i++) { String s = trimmer.trim(roots[i]); if (s != null) cleanRoots.add(s); } return cleanRoots; } else { return TextUtil.EMPTY_STRING_LIST; } } StdJndiLoader(); }
StdJndiLoader extends BaseLoader implements LookupLoader, StandardLoader { protected List<String> split(String rootStr) { List<String> cleanRoots = new ArrayList(); if (rootStr != null) { QuotedSpacePreservingTrimmer trimmer = QuotedSpacePreservingTrimmer.instance(); String[] roots = rootStr.split(","); for (int i = 0; i < roots.length; i++) { String s = trimmer.trim(roots[i]); if (s != null) cleanRoots.add(s); } return cleanRoots; } else { return TextUtil.EMPTY_STRING_LIST; } } StdJndiLoader(); @Override LoaderValues load(StaticPropertyConfigurationInternal appConfigDef, ValidatedValuesWithContext existingValues); @Override boolean isTrimmingRequiredForStringValues(); @Override String getSpecificLoadDescription(); @Override Class<?> getClassConfig(); @Override SamplePrinter getConfigSamplePrinter(); @Override String getLoaderType(); @Override String getLoaderDialect(); @Override void setFailedEnvironmentAProblem(boolean isAProblem); @Override boolean isFailedEnvironmentAProblem(); }
StdJndiLoader extends BaseLoader implements LookupLoader, StandardLoader { protected List<String> split(String rootStr) { List<String> cleanRoots = new ArrayList(); if (rootStr != null) { QuotedSpacePreservingTrimmer trimmer = QuotedSpacePreservingTrimmer.instance(); String[] roots = rootStr.split(","); for (int i = 0; i < roots.length; i++) { String s = trimmer.trim(roots[i]); if (s != null) cleanRoots.add(s); } return cleanRoots; } else { return TextUtil.EMPTY_STRING_LIST; } } StdJndiLoader(); @Override LoaderValues load(StaticPropertyConfigurationInternal appConfigDef, ValidatedValuesWithContext existingValues); @Override boolean isTrimmingRequiredForStringValues(); @Override String getSpecificLoadDescription(); @Override Class<?> getClassConfig(); @Override SamplePrinter getConfigSamplePrinter(); @Override String getLoaderType(); @Override String getLoaderDialect(); @Override void setFailedEnvironmentAProblem(boolean isAProblem); @Override boolean isFailedEnvironmentAProblem();  }