/** * Return a given named element. * * @param eName String. * @return element FingerprintedElement. */ public FingerprintedElement getElement(final String eName) { final String SEPARATOR = File.separator; final String searchPath = eName.replace(this.workspaceFile.getPath() + SEPARATOR, ""); final int nextSeparatorIndex = searchPath.indexOf(SEPARATOR); String subElementName = null; if (nextSeparatorIndex != -1) { subElementName = searchPath.substring(0, nextSeparatorIndex); } else { subElementName = searchPath; } for (final FingerprintedElement e : this.elements) { // Search For Direct SubElement if (subElementName.equals(e.getName())) { // If Direct SubElement is Target Return if (nextSeparatorIndex == -1) return e; // Else Continue Search Along Search Path else return ((Container) e).getElement(searchPath.substring(nextSeparatorIndex + 1)); } } return null; }