DomTarget (DomElement parent, DomElement nameElement) { if (parent instanceof AntDomElement && nameElement.equals(((AntDomElement)parent).getId())) { // id attrib is defined return DomTarget.getTarget(parent, (GenericDomValue)nameElement); } if (parent instanceof AntDomProperty && nameElement.equals(((AntDomProperty)parent).getEnvironment())) { // environment attrib is defined return DomTarget.getTarget(parent, (GenericDomValue)nameElement); } return null; }