use of org.freud.analysed.javasource.ClassDeclaration in project freud by LMAX-Exchange.
the class ClassDeclarationJdom method getInnerClassDeclarationByNameMap.
@SuppressWarnings("unchecked")
public Map<String, ClassDeclaration> getInnerClassDeclarationByNameMap() {
if (innerClassDeclarationByNameMap == null) {
JXPathContext context = JXPathContext.newContext(classDeclElement);
innerClassDeclarationByNameMap = new LinkedHashMap<String, ClassDeclaration>();
for (JavaSourceTokenType tokenType : POSSIBLE_CLASS_DECLARATION_TYPES) {
final String tokenName = tokenType.getName();
List<Element> innerClassElementList = context.selectNodes("/" + CLASS_TOP_LEVEL_SCOPE.getName() + "/" + tokenName);
for (Element innerClassElement : innerClassElementList) {
ClassDeclaration innerClass = new ClassDeclarationJdom(innerClassElement, DeclarationType.valueOf(tokenName), this);
innerClassDeclarationByNameMap.put(innerClass.getName(), innerClass);
}
}
}
return innerClassDeclarationByNameMap;
}
Aggregations