if (state == State.DEP_ARTIFACT) {
String url = substitute(attributes.getValue("url"));
Map<String, String> extraAttributes = getExtraAttributes(attributes, new String[]{"name", "type", "ext", "url", "conf"});
confAware = new DefaultDependencyArtifactDescriptor(dd, name, type, ext, url == null ? null : new URL(url), extraAttributes);
} else if (state == State.ARTIFACT_INCLUDE) {
PatternMatcher matcher = getPatternMatcher(attributes.getValue("matcher"));
String org = elvis(substitute(attributes.getValue("org")), PatternMatcher.ANY_EXPRESSION);
String module = elvis(substitute(attributes.getValue("module")), PatternMatcher.ANY_EXPRESSION);
ArtifactId aid = new ArtifactId(IvyUtil.createModuleId(org, module), name, type, ext);
Map<String, String> extraAttributes = getExtraAttributes(attributes, new String[]{"org", "module", "name", "type", "ext", "matcher", "conf"});
confAware = new DefaultIncludeRule(aid, matcher, extraAttributes);
} else { // _state == ARTIFACT_EXCLUDE || EXCLUDE
PatternMatcher matcher = getPatternMatcher(attributes.getValue("matcher"));
String org = elvis(substitute(attributes.getValue("org")), PatternMatcher.ANY_EXPRESSION);
String module = elvis(substitute(attributes.getValue("module")), PatternMatcher.ANY_EXPRESSION);
ArtifactId aid = new ArtifactId(IvyUtil.createModuleId(org, module), name, type, ext);
Map<String, String> extraAttributes = getExtraAttributes(attributes, new String[]{"org", "module", "name", "type", "ext", "matcher", "conf"});
confAware = new DefaultExcludeRule(aid, matcher, extraAttributes);