parser.parseAntlibDescriptor(project, antlibResource);
private static List<Pair<String, String>> readTaskListingFromAntlib(IFile resource) { URL url; try { url = resource.toURI().toURL(); } catch (MalformedURLException e) { throw GosuExceptionUtil.forceThrow(e); } URLResource antlibResource = new URLResource(url); ProjectHelperRepository helperRepository = ProjectHelperRepository.getInstance(); ProjectHelper parser = helperRepository.getProjectHelperForAntlib(antlibResource); UnknownElement ue = parser.parseAntlibDescriptor(AntlibTypeLoader.NULL_PROJECT, antlibResource); if (!ue.getTag().equals(Antlib.TAG)) { throw new BuildException("Unexpected tag " + ue.getTag() + " expecting " + Antlib.TAG, ue.getLocation()); } List<Pair<String, String>> listing = new ArrayList<Pair<String, String>>(); for (Object childObj : ue.getChildren()) { UnknownElement child = (UnknownElement) childObj; if (child.getTag().equals("taskdef")) { Map attributes = child.getWrapper().getAttributeMap(); listing.add(new Pair<String, String>((String) attributes.get("name"), (String) attributes.get("classname"))); } } return listing; }