@Test public void testGetPathFromScopePath() { final InternalScopePathBuilderFactory factory = new InternalScopePathBuilderFactory(); final ScopePathBuilder builder = factory.createBuilder(); final Map<String, String> tmpProperties = new TreeMap<String, String>(); tmpProperties.put("className", "TestConfiguration"); builder.append(ClassScopeDescriptor.NAME, tmpProperties); builder.append(CodeDefaultScopeDescriptor.NAME); builder.append("Test", tmpProperties); final String result = gen.getPathFromScopePath(builder.create()); Assert.assertTrue(result.equals("Test" + File.separator + "className" + DefaultScopePathGenerator.PATH_PROPERTY_SEPARATOR + "TestConfiguration")); }
@Override public String getPathFromScopePath(final ScopePath scopePath) { DefaultScopePathGeneratorValidator.validateScopePath(scopePath); final StringBuilder sb = new StringBuilder(); boolean firstScope = true; for (final Scope currentScope : scopePath.getScopes()) { if (!CodeDefaultScopeDescriptor.NAME.equals(currentScope.getName()) && !ClassScopeDescriptor.NAME.equals(currentScope.getName())) { if (!firstScope) { sb.append(scopeSeparator); } firstScope = false; final Map<String, String> properties = new TreeMap<String, String>(currentScope.getProperties()); sb.append(buildScopeWithProperty(currentScope.getName(), properties)); } } return sb.toString(); }
DefaultScopePathGenerator implements ScopePathGenerator { @Override public String getPathFromScopePath(final ScopePath scopePath) { DefaultScopePathGeneratorValidator.validateScopePath(scopePath); final StringBuilder sb = new StringBuilder(); boolean firstScope = true; for (final Scope currentScope : scopePath.getScopes()) { if (!CodeDefaultScopeDescriptor.NAME.equals(currentScope.getName()) && !ClassScopeDescriptor.NAME.equals(currentScope.getName())) { if (!firstScope) { sb.append(scopeSeparator); } firstScope = false; final Map<String, String> properties = new TreeMap<String, String>(currentScope.getProperties()); sb.append(buildScopeWithProperty(currentScope.getName(), properties)); } } return sb.toString(); } }
DefaultScopePathGenerator implements ScopePathGenerator { @Override public String getPathFromScopePath(final ScopePath scopePath) { DefaultScopePathGeneratorValidator.validateScopePath(scopePath); final StringBuilder sb = new StringBuilder(); boolean firstScope = true; for (final Scope currentScope : scopePath.getScopes()) { if (!CodeDefaultScopeDescriptor.NAME.equals(currentScope.getName()) && !ClassScopeDescriptor.NAME.equals(currentScope.getName())) { if (!firstScope) { sb.append(scopeSeparator); } firstScope = false; final Map<String, String> properties = new TreeMap<String, String>(currentScope.getProperties()); sb.append(buildScopeWithProperty(currentScope.getName(), properties)); } } return sb.toString(); } DefaultScopePathGenerator(final String scopeSeparator); }
DefaultScopePathGenerator implements ScopePathGenerator { @Override public String getPathFromScopePath(final ScopePath scopePath) { DefaultScopePathGeneratorValidator.validateScopePath(scopePath); final StringBuilder sb = new StringBuilder(); boolean firstScope = true; for (final Scope currentScope : scopePath.getScopes()) { if (!CodeDefaultScopeDescriptor.NAME.equals(currentScope.getName()) && !ClassScopeDescriptor.NAME.equals(currentScope.getName())) { if (!firstScope) { sb.append(scopeSeparator); } firstScope = false; final Map<String, String> properties = new TreeMap<String, String>(currentScope.getProperties()); sb.append(buildScopeWithProperty(currentScope.getName(), properties)); } } return sb.toString(); } DefaultScopePathGenerator(final String scopeSeparator); @Override String createName(final ScopePath scopePath); @Override String getPathFromScopePath(final ScopePath scopePath); @Override String buildScopeWithProperty(final String scopeName, final Map<String, String> properties); @Override Collection<ScopePath> createScopePaths(
		final Collection<String> paths,
		final String scopeName,
		final Map<String, String> properties); }
DefaultScopePathGenerator implements ScopePathGenerator { @Override public String getPathFromScopePath(final ScopePath scopePath) { DefaultScopePathGeneratorValidator.validateScopePath(scopePath); final StringBuilder sb = new StringBuilder(); boolean firstScope = true; for (final Scope currentScope : scopePath.getScopes()) { if (!CodeDefaultScopeDescriptor.NAME.equals(currentScope.getName()) && !ClassScopeDescriptor.NAME.equals(currentScope.getName())) { if (!firstScope) { sb.append(scopeSeparator); } firstScope = false; final Map<String, String> properties = new TreeMap<String, String>(currentScope.getProperties()); sb.append(buildScopeWithProperty(currentScope.getName(), properties)); } } return sb.toString(); } DefaultScopePathGenerator(final String scopeSeparator); @Override String createName(final ScopePath scopePath); @Override String getPathFromScopePath(final ScopePath scopePath); @Override String buildScopeWithProperty(final String scopeName, final Map<String, String> properties); @Override Collection<ScopePath> createScopePaths(
		final Collection<String> paths,
		final String scopeName,
		final Map<String, String> properties); static final String PATH_PROPERTY_SEPARATOR; }